]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
* cut all left of webcit= from cookies
[citadel.git] / webcit / webcit.c
index ed2eefc54bb4670794e31eb0a197948d4b8f32d8..e03a8154595034ceb35ca213967f218433bf5caa 100644 (file)
@@ -1436,7 +1436,9 @@ void session_loop(HashList *HTTPHeaders, StrBuf *ReqLine, StrBuf *request_method
        if ((follow_xff) &&
            GetHash(HTTPHeaders, HKEY("X-FORWARDED-HOST"), &vLine) &&
            (vLine != NULL)) {
-               safestrncpy(WCC->http_host, &buf[18], sizeof WCC->http_host);
+               safestrncpy(WCC->http_host, 
+                           ChrPtr((StrBuf*)vLine), 
+                           sizeof WCC->http_host);
        }
        if (IsEmptyStr(WCC->http_host) && 
            GetHash(HTTPHeaders, HKEY("HOST"), &vLine) &&
@@ -1470,7 +1472,7 @@ void session_loop(HashList *HTTPHeaders, StrBuf *ReqLine, StrBuf *request_method
                body_start = StrLength(content);
 
                /** Read the entire input data at once. */
-               client_read(&WCC->http_sock, content, ReadBuf, ContentLength);
+               client_read(&WCC->http_sock, content, ReadBuf, ContentLength + body_start);
 
                if (!strncasecmp(ChrPtr(ContentType), "application/x-www-form-urlencoded", 33)) {
                        StrBufCutLeft(content, body_start);