]> code.citadel.org Git - citadel.git/blobdiff - webcit/context_loop.c
* move to the new linebuffered function while linebased reading from webbrowser and...
[citadel.git] / webcit / context_loop.c
index 5890f7fb8d1b3f9236dc48dbf402d76c9a08885a..e2697f290b1e43c781efc815b3ebdb28f1a7702e 100644 (file)
@@ -162,16 +162,6 @@ int GenerateSessionID(void)
        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
@@ -260,6 +250,7 @@ const char *nix(void *vptr) {return ChrPtr( (StrBuf*)vptr);}
  */
 void context_loop(int *sock)
 {
+       const char *Pos = NULL;
        const char *buf;
        int desired_session = 0;
        int got_cookie = 0;
@@ -295,7 +286,9 @@ void context_loop(int *sock)
        do {
                nLine ++;
                Line = NewStrBuf();
-               if (ReqGetStrBuf(sock, Line, Buf) < 0) return;
+
+
+               if (ClientGetLine(sock, Line, Buf, &Pos) < 0) return;
 
                LineLen = StrLength(Line);
 
@@ -336,8 +329,10 @@ void context_loop(int *sock)
                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); 
 
 
        /*