31
31
* FIXME: break this into HTTP state and TCP socket state.
32
* See server.h for the other end.
35
/* different possible states for the client side */
36
#define CL_STHEADERS 0
43
* FIXME: break this into HTTP state and TCP socket state.
44
32
* See client.h for the other end.
47
35
/* different possible states for the server side */
48
36
#define SV_STIDLE 0
50
#define SV_STHEADERS 2
37
#define SV_STANALYZE 1 /* this server state is set by the client to study the body for server assignment */
39
#define SV_STHEADERS 3
57
46
* Transaction flags moved from session
204
193
* which marks the end of the line (LF or CRLF).
206
195
struct http_msg {
207
int msg_state; /* where we are in the current message parsing */
208
char *sol; /* start of line, also start of message when fully parsed */
209
char *eol; /* end of line */
210
int som; /* Start Of Message, relative to buffer */
211
int col, sov; /* current header: colon, start of value */
212
int eoh; /* End Of Headers, relative to buffer */
213
char **cap; /* array of captured headers (may be NULL) */
214
union { /* useful start line pointers, relative to buffer */
216
int l; /* request line length (not including CR) */
217
int m_l; /* METHOD length (method starts at ->som) */
218
int u, u_l; /* URI, length */
219
int v, v_l; /* VERSION, length */
220
} rq; /* request line : field, length */
222
int l; /* status line length (not including CR) */
223
int v_l; /* VERSION length (version starts at ->som) */
224
int c, c_l; /* CODE, length */
225
int r, r_l; /* REASON, length */
226
} st; /* status line : field, length */
227
} sl; /* start line */
196
unsigned int msg_state; /* where we are in the current message parsing */
197
char *sol; /* start of line, also start of message when fully parsed */
198
char *eol; /* end of line */
199
unsigned int som; /* Start Of Message, relative to buffer */
200
unsigned int col, sov; /* current header: colon, start of value */
201
unsigned int eoh; /* End Of Headers, relative to buffer */
202
char **cap; /* array of captured headers (may be NULL) */
203
union { /* useful start line pointers, relative to buffer */
205
int l; /* request line length (not including CR) */
206
int m_l; /* METHOD length (method starts at ->som) */
207
int u, u_l; /* URI, length */
208
int v, v_l; /* VERSION, length */
209
} rq; /* request line : field, length */
211
int l; /* status line length (not including CR) */
212
int v_l; /* VERSION length (version starts at ->som) */
213
int c, c_l; /* CODE, length */
214
int r, r_l; /* REASON, length */
215
} st; /* status line : field, length */
216
} sl; /* start line */
217
unsigned long long hdr_content_len; /* cache for parsed header value */
230
220
/* This is an HTTP transaction. It contains both a request message and a