24
24
25
25
#include "lwan.h"
26
26
27
- struct lwan_request_parser_helper {
28
- struct lwan_value * buffer ; /* The whole request buffer */
29
- char * next_request ; /* For pipelined requests */
27
+ #define N_HEADER_START 64
28
+ #define DEFAULT_BUFFER_SIZE 4096
29
+ #define DEFAULT_HEADERS_SIZE 2048
30
30
31
- char * * header_start ; /* Headers: n: start, n+1: end */
32
- size_t n_header_start ; /* len(header_start) */
31
+ struct lwan_request_parser_helper {
32
+ struct lwan_value * buffer ; /* The whole request buffer */
33
+ char * next_request ; /* For pipelined requests */
33
34
34
- struct lwan_value accept_encoding ; /* Accept-Encoding: */
35
+ struct lwan_value accept_encoding ; /* Accept-Encoding: */
35
36
36
- struct lwan_value query_string ; /* Stuff after ? and before # */
37
+ struct lwan_value query_string ; /* Stuff after ? and before # */
37
38
38
- struct lwan_value body_data ; /* Request body for POST and PUT */
39
- struct lwan_value content_type ; /* Content-Type: for POST and PUT */
40
- struct lwan_value content_length ; /* Content-Length: */
39
+ struct lwan_value body_data ; /* Request body for POST and PUT */
40
+ struct lwan_value content_type ; /* Content-Type: for POST and PUT */
41
+ struct lwan_value content_length ; /* Content-Length: */
41
42
42
- struct lwan_value connection ; /* Connection: */
43
+ struct lwan_value connection ; /* Connection: */
43
44
44
- struct lwan_value host ; /* Host: */
45
+ struct lwan_value host ; /* Host: */
45
46
46
47
struct lwan_key_value_array cookies , query_params , post_params ;
47
48
49
+ char * header_start [N_HEADER_START ]; /* Headers: n: start, n+1: end */
50
+ size_t n_header_start ; /* len(header_start) */
51
+
48
52
struct { /* If-Modified-Since: */
49
53
struct lwan_value raw ;
50
54
time_t parsed ;
@@ -55,17 +59,13 @@ struct lwan_request_parser_helper {
55
59
off_t from , to ;
56
60
} range ;
57
61
58
- uint64_t request_id ; /* Request ID for debugging purposes */
62
+ uint64_t request_id ; /* Request ID for debugging purposes */
59
63
60
- time_t error_when_time ; /* Time to abort request read */
61
- int error_when_n_packets ; /* Max. number of packets */
62
- int urls_rewritten ; /* Times URLs have been rewritten */
64
+ time_t error_when_time ; /* Time to abort request read */
65
+ int error_when_n_packets ; /* Max. number of packets */
66
+ int urls_rewritten ; /* Times URLs have been rewritten */
63
67
};
64
68
65
- #define DEFAULT_BUFFER_SIZE 4096
66
- #define DEFAULT_HEADERS_SIZE 2048
67
-
68
- #define N_HEADER_START 64
69
69
70
70
#define LWAN_CONCAT (a_ , b_ ) a_ ## b_
71
71
#define LWAN_TMP_ID_DETAIL (n_ ) LWAN_CONCAT(lwan_tmp_id, n_)
0 commit comments