* migrate more of the upload handling to strbuf
[citadel.git] / webcit / webcit.c
index 1f9fd521d1db58d8e4b8a4bd0bc4475dfa42eda5..e89d2e97bf130e839ee8d75e3ed3394f95288740 100644 (file)
@@ -549,6 +549,9 @@ void ReadPostData(void)
                        WCC->Hdr->HR.ContentLength + 
                        body_start;
                mime_parser(ChrPtr(content), content_end, *upload_handler, NULL, NULL, NULL, 0);
+       } else if (WCC->Hdr->HR.ContentLength > 0) {
+               WCC->upload = content;
+               content = NULL;
        }
        FreeStrBuf(&content);
 }
@@ -833,7 +836,7 @@ SessionDetachModule_WEBCIT
 {
        DeleteHash(&sess->Hdr->urlstrings);// TODO?
        if (sess->upload_length > 0) {
-               free(sess->upload);
+               FreeStrBuf(&sess->upload);
                sess->upload_length = 0;
        }
        FreeStrBuf(&sess->trailing_javascript);