-
Notifications
You must be signed in to change notification settings - Fork 4
/
urlcmd.h
56 lines (49 loc) · 2.03 KB
/
urlcmd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef URLCMD_H
#define URLCMD_H
#include <stdbool.h>
#include "tpool.h"
#include "kweb.h"
/* Struct representing query parameters */
#define MAX_PARAMS 100
struct query_params {
char src[BUFSIZE];
struct {
char *key;
char *value;
} p[MAX_PARAMS];
};
struct intercept_buf {
void *buf;
size_t size;
char *mime_type;
};
/* The top level function that knows how to intercept an entire request and
* do something special with it. */
bool intercept_request(struct intercept_buf *ib,
struct http_request *r);
/* Individual commands to run */
void start_measurements (struct intercept_buf *ib,
struct query_params *params,
struct http_request *r);
void stop_measurements (struct intercept_buf *ib,
struct query_params *params,
struct http_request *r);
void add_vcores (struct intercept_buf *ib,
struct query_params *params,
struct http_request *r);
void yield_pcores (struct intercept_buf *ib,
struct query_params *params,
struct http_request *r);
void terminate (struct intercept_buf *ib,
struct query_params *params,
struct http_request *r);
void generate_thumbnails_serial (struct intercept_buf *ib,
struct query_params *params,
struct http_request *r);
void generate_thumbnails_pthreads (struct intercept_buf *ib,
struct query_params *params,
struct http_request *r);
void generate_thumbnails_lithe (struct intercept_buf *ib,
struct query_params *params,
struct http_request *r);
#endif // URLCMD_H