- /*
- * Browser-based sessions use cookies for session authentication
- */
- if (!strncasecmp(buf, "Cookie: webcit=", 15)) {
- cookie_to_stuff(&buf[15], &desired_session,
- NULL, 0, NULL, 0, NULL, 0);
- got_cookie = 1;
+ /** Do we need to Unfold? */
+ if ((LastLine != NULL) &&
+ (isspace(*ChrPtr(Line)))) {
+ pch = pchs = ChrPtr(Line);
+ pche = pchs + StrLength(Line);
+ while (isspace(pch) && (pch < pche))
+ pch ++;
+ StrBufCutLeft(Line, pch - pchs);
+ StrBufAppendBuf(LastLine, Line, 0);
+ FreeStrBuf(&Line);
+ continue;
+ }
+
+ StrBufExtract_token(HeaderName, Line, 0, ':');
+ //// TODO: filter bad chars!
+
+ pchs = ChrPtr(Line);
+ pch = pchs + StrLength(HeaderName) + 1;
+ pche = pchs + StrLength(Line);
+ while (isspace(*pch) && (pch < pche))
+ pch ++;
+ StrBufCutLeft(Line, pch - pchs);
+
+ StrBufUpCase(HeaderName);
+ Put(HTTPHeaders, SKEY(HeaderName), Line, HFreeStrBuf);
+ LastLine = Line;
+ } while (LineLen > 0);
+ FreeStrBuf(&HeaderName);
+
+//// dbg_PrintHash(HTTPHeaders, nix, NULL);
+
+
+ /**
+ * Can we compress?
+ */
+ if (GetHash(HTTPHeaders, HKEY("ACCEPT-ENCODING"), &vLine) &&
+ (vLine != NULL)) {
+ buf = ChrPtr((StrBuf*)vLine);
+ if (strstr(&buf[16], "gzip")) {
+ gzip_ok = 1;