forked from redis/memtier_benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp.h
More file actions
41 lines (36 loc) · 680 Bytes
/
Copy pathhttp.h
File metadata and controls
41 lines (36 loc) · 680 Bytes
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
#ifndef _http_h_
#define _http_h_
struct http_message {
struct {
int code;
int length;
} header;
char *content;
int length;
struct {
int in_content;
int chunk;
char buf[4096];
int size;
char *offset;
char *last;
int free;
int left;
int total;
} state;
};
/* low level methods */
struct http_url {
const char *protocol;
char *host;
const char *query;
const char *body;
};
struct http_url *http_parse_url(const char *);
int http_connect(struct http_url *);
int http_send(int, const char *);
int http_read(int, struct http_message *);
/* high level methods */
int http_request(const char *);
int http_response(int, struct http_message *);
#endif