diff options
Diffstat (limited to 'src/libhttpd/gethead.c')
| -rw-r--r-- | src/libhttpd/gethead.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libhttpd/gethead.c b/src/libhttpd/gethead.c index 91abc7c9..5983345e 100644 --- a/src/libhttpd/gethead.c +++ b/src/libhttpd/gethead.c @@ -15,11 +15,15 @@ hgethead(HConnect *c, int many) int n; hin = &c->hin; +fprint(2, "hgethead top %p - %p\n", hin->pos, hin->stop); for(;;){ s = (char*)hin->pos; pp = s; +fprint(2, "hgethead %p - %p\n", pp, hin->stop); while(p = memchr(pp, '\n', (char*)hin->stop - pp)){ - if(!many || p == pp || p == pp + 1 && *pp == '\r'){ +fprint(2, "hgethead %p - %p newline at %p %d\n", pp, hin->stop, p, *pp); + if(!many || p == pp || (p == pp + 1 && *pp == '\r')){ +fprint(2, "breaking\n"); pp = p + 1; break; } @@ -32,6 +36,7 @@ hgethead(HConnect *c, int many) memmove(c->hstop, s, n); c->hstop += n; *c->hstop = '\0'; +fprint(2, "p %p\n", p); if(p != nil) return 1; if(hreadbuf(hin, hin->pos) == nil || hin->state == Hend) |
