Mercurial > hg > nginx
comparison src/http/ngx_http_parse.c @ 432:11362a3e3911
nginx-0.0.11-2004-09-21-09:38:28 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 21 Sep 2004 05:38:28 +0000 |
parents | 47709bff4468 |
children | da8c5707af39 |
comparison
equal
deleted
inserted
replaced
431:358bbd2561b5 | 432:11362a3e3911 |
---|---|
2 #include <ngx_config.h> | 2 #include <ngx_config.h> |
3 #include <ngx_core.h> | 3 #include <ngx_core.h> |
4 #include <ngx_http.h> | 4 #include <ngx_http.h> |
5 | 5 |
6 | 6 |
7 ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r) | 7 ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b) |
8 { | 8 { |
9 u_char ch, *p, *m; | 9 u_char ch, *p, *m; |
10 enum { | 10 enum { |
11 sw_start = 0, | 11 sw_start = 0, |
12 sw_method, | 12 sw_method, |
32 sw_almost_done, | 32 sw_almost_done, |
33 sw_done | 33 sw_done |
34 } state; | 34 } state; |
35 | 35 |
36 state = r->state; | 36 state = r->state; |
37 p = r->header_in->pos; | 37 p = b->pos; |
38 | 38 |
39 while (p < r->header_in->last && state < sw_done) { | 39 while (p < b->last && state < sw_done) { |
40 ch = *p++; | 40 ch = *p++; |
41 | 41 |
42 /* gcc 2.95.2 and vc 6.0 compile this switch as an jump table */ | 42 /* gcc 2.95.2 and vc 6.0 compile this switch as an jump table */ |
43 | 43 |
44 switch (state) { | 44 switch (state) { |
414 case sw_done: | 414 case sw_done: |
415 break; | 415 break; |
416 } | 416 } |
417 } | 417 } |
418 | 418 |
419 r->header_in->pos = p; | 419 b->pos = p; |
420 | 420 |
421 if (state == sw_done) { | 421 if (state == sw_done) { |
422 if (r->request_end == NULL) { | 422 if (r->request_end == NULL) { |
423 r->request_end = p - 1; | 423 r->request_end = p - 1; |
424 } | 424 } |