1 |
rakinar2 |
44 |
#ifndef FREEHTTPD_REQUEST_H |
2 |
|
|
#define FREEHTTPD_REQUEST_H |
3 |
|
|
|
4 |
|
|
#include "freehttpd.h" |
5 |
|
|
#include <stdbool.h> |
6 |
|
|
#include <stddef.h> |
7 |
|
|
|
8 |
|
|
typedef struct freehttpd_header |
9 |
|
|
{ |
10 |
|
|
char *name; |
11 |
|
|
char *value; |
12 |
|
|
} freehttpd_header_t; |
13 |
|
|
|
14 |
|
|
typedef struct freehttpd_request |
15 |
|
|
{ |
16 |
|
|
char *method; |
17 |
|
|
size_t method_length; |
18 |
|
|
char *uri; |
19 |
|
|
size_t uri_length; |
20 |
|
|
char *version; |
21 |
|
|
size_t version_length; |
22 |
|
|
freehttpd_header_t **headers; |
23 |
|
|
size_t headers_count; |
24 |
|
|
char *body; |
25 |
|
|
size_t body_length; |
26 |
|
|
} freehttpd_request_t; |
27 |
|
|
|
28 |
|
|
freehttpd_request_t *freehttpd_request_init (const char *method, |
29 |
|
|
const char *uri, |
30 |
|
|
const char *version); |
31 |
|
|
void freehttpd_request_free (freehttpd_request_t *request); |
32 |
|
|
freehttpd_request_t *freehttpd_request_parse (freehttpd_t *freehttpd, |
33 |
|
|
int sockfd, ecode_t *error); |
34 |
|
|
|
35 |
|
|
#endif |