diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-03-11 20:38:13 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-03-11 20:38:13 +0000 |
commit | b738757f359a79b346bcc40895ed0a5ca697e8e2 (patch) | |
tree | 517f3cdbf30667c5183ba06f4d895acc78a308bf /src/http/ngx_http_parse.c | |
parent | 0dad629f63e6bb8bc61314ba0c0aed5412353947 (diff) | |
download | nginx-b738757f359a79b346bcc40895ed0a5ca697e8e2.tar.gz nginx-b738757f359a79b346bcc40895ed0a5ca697e8e2.zip |
nginx-0.0.1-2003-03-11-23:38:13 import
Diffstat (limited to 'src/http/ngx_http_parse.c')
-rw-r--r-- | src/http/ngx_http_parse.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c index 49864dde5..69528690c 100644 --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -25,16 +25,11 @@ int ngx_read_http_request_line(ngx_http_request_t *r) } state; state = r->state; - p = r->header_in->pos.mem; + p = r->header_in->pos; - while (p < r->header_in->last.mem && state < sw_done) { + while (p < r->header_in->last && state < sw_done) { ch = *p++; -/* -printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", - state, p, r->header_in->last, ch, p); -*/ - /* GCC 2.95.2 and VC 6.0 compile this switch as jump table */ switch (state) { @@ -45,7 +40,7 @@ printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", switch (ch) { case 'G': - if (p + 1 >= r->header_in->last.mem) { + if (p + 1 >= r->header_in->last) { return NGX_AGAIN; } @@ -58,7 +53,7 @@ printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", break; case 'H': - if (p + 2 >= r->header_in->last.mem) { + if (p + 2 >= r->header_in->last) { return NGX_AGAIN; } @@ -71,7 +66,7 @@ printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", break; case 'P': - if (p + 2 >= r->header_in->last.mem) { + if (p + 2 >= r->header_in->last) { return NGX_AGAIN; } @@ -228,9 +223,9 @@ printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", /* "TTP/" */ case sw_http_version: - if (p + 2 >= r->header_in->last.mem) { + if (p + 2 >= r->header_in->last) { r->state = sw_http_version; - r->header_in->pos.mem = p - 1; + r->header_in->pos = p - 1; return NGX_AGAIN; } @@ -309,7 +304,7 @@ printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", } } - r->header_in->pos.mem = p; + r->header_in->pos = p; if (state == sw_done) { if (r->request_end == NULL) { @@ -348,16 +343,11 @@ int ngx_read_http_header_line(ngx_http_request_t *r, ngx_hunk_t *h) } state; state = r->state; - p = h->pos.mem; + p = h->pos; - while (p < h->last.mem && state < sw_done) { + while (p < h->last && state < sw_done) { ch = *p++; -/* -printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", - state, p, h->last.mem, ch, p); -*/ - switch (state) { /* first char */ @@ -495,7 +485,7 @@ printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", } } - h->pos.mem = p; + h->pos = p; if (state == sw_done) { r->state = sw_start; |