7 * read in some header lines, either one or all of them.
8 * copy results into header log buffer.
11 hgethead(HConnect *c, int many)
18 fprint(2, "hgethead top %p - %p\n", hin->pos, hin->stop);
22 fprint(2, "hgethead %p - %p\n", pp, hin->stop);
23 while(p = memchr(pp, '\n', (char*)hin->stop - pp)){
24 fprint(2, "hgethead %p - %p newline at %p %d\n", pp, hin->stop, p, *pp);
25 if(!many || p == pp || (p == pp + 1 && *pp == '\r')){
26 fprint(2, "breaking\n");
32 hin->pos = (uchar*)pp;
34 if(c->hstop + n > &c->header[HBufSize])
36 memmove(c->hstop, s, n);
39 fprint(2, "p %p\n", p);
42 if(hreadbuf(hin, hin->pos) == nil || hin->state == Hend)