return ++seq;
}
-/*
- * Collapse multiple cookies on one line
- */
-int ReqGetStrBuf(int *sock, StrBuf *Target, StrBuf *buf)
-{
-
- return ClientGetLine(sock, Target, buf);
-}
-
-
/*
* lingering_close() a`la Apache. see
*/
void context_loop(int *sock)
{
+ const char *Pos = NULL;
const char *buf;
int desired_session = 0;
int got_cookie = 0;
do {
nLine ++;
Line = NewStrBuf();
- if (ReqGetStrBuf(sock, Line, Buf) < 0) return;
+
+
+ if (ClientGetLine(sock, Line, Buf, &Pos) < 0) return;
LineLen = StrLength(Line);
LastLine = Line;
} while (LineLen > 0);
FreeStrBuf(&HeaderName);
+ /* finish linebuffered fast reading, cut the read part: */
+ StrBufCutLeft(Buf, Pos - ChrPtr(Buf));
-/*/// dbg_PrintHash(HTTPHeaders, nix, NULL); */
+ dbg_PrintHash(HTTPHeaders, nix, NULL);
/*