Mercurial > hg > nginx-quic
diff src/http/ngx_http_parse.c @ 67:5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 11 Mar 2003 20:38:13 +0000 |
parents | 4222c496acb3 |
children | 59229033ae93 |
line wrap: on
line diff
--- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -25,15 +25,10 @@ int ngx_read_http_request_line(ngx_http_ } state; state = r->state; - p = r->header_in->pos.mem; - - while (p < r->header_in->last.mem && state < sw_done) { - ch = *p++; + p = r->header_in->pos; -/* -printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", - state, p, r->header_in->last, ch, p); -*/ + while (p < r->header_in->last && state < sw_done) { + ch = *p++; /* GCC 2.95.2 and VC 6.0 compile this switch as jump table */ @@ -45,7 +40,7 @@ printf("\nstate: %d, pos: %x, end: %x, c 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, c 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, c 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, c /* "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, c } } - r->header_in->pos.mem = p; + r->header_in->pos = p; if (state == sw_done) { if (r->request_end == NULL) { @@ -348,15 +343,10 @@ int ngx_read_http_header_line(ngx_http_r } state; state = r->state; - p = h->pos.mem; - - while (p < h->last.mem && state < sw_done) { - ch = *p++; + p = h->pos; -/* -printf("\nstate: %d, pos: %x, end: %x, char: '%c' buf: %s", - state, p, h->last.mem, ch, p); -*/ + while (p < h->last && state < sw_done) { + ch = *p++; switch (state) { @@ -495,7 +485,7 @@ printf("\nstate: %d, pos: %x, end: %x, c } } - h->pos.mem = p; + h->pos = p; if (state == sw_done) { r->state = sw_start;