]> code.citadel.org Git - citadel.git/blobdiff - webcit/groupdav_put.c
* add logging if auth-basic session connecting fails with weird conditions
[citadel.git] / webcit / groupdav_put.c
index bacd77e0d3b12c1c0e7e0bfca9bbf375e3a214da..48f0b4a8534fd90f74693504fe13210d11123d22 100644 (file)
@@ -33,12 +33,13 @@ void groupdav_put_bigics(void)
                hprintf("HTTP/1.1 502 Bad Gateway\r\n");
                groupdav_common_headers();
                hprintf("Content-type: text/plain\r\n");
+               begin_burst();
                wprintf("%s\r\n", &buf[4]);
                end_burst();
                return;
        }
 
-       serv_write(WCC->upload, WCC->upload_length);
+       serv_putbuf(WCC->upload);
        serv_printf("\n000");
 
        /* Report success and not much else. */
@@ -70,6 +71,7 @@ void groupdav_put(void)
                hprintf("HTTP/1.1 404 not found\r\n");
                groupdav_common_headers();
                hprintf("Content-Type: text/plain\r\n");
+               begin_burst();
                wprintf("The object you requested was not found.\r\n");
                end_burst();
                return;
@@ -92,6 +94,7 @@ void groupdav_put(void)
                hprintf("HTTP/1.1 404 not found\r\n");
                groupdav_common_headers();
                hprintf("Content-Type: text/plain\r\n");
+               begin_burst();
                wprintf("There is no folder called \"%s\" on this server.\r\n",
                        ChrPtr(dav_roomname));
                end_burst();
@@ -116,7 +119,7 @@ void groupdav_put(void)
                        lprintf(9, "HTTP/1.1 412 Precondition Failed (ifmatch=%ld, old_msgnum=%ld)\r\n",
                                StrTol(WCC->Hdr->HR.dav_ifmatch), old_msgnum);
                        groupdav_common_headers();
-                       hprintf("Content-Length: 0\r\n");
+                       
                        end_burst();
                        FreeStrBuf(&dav_roomname);
                        FreeStrBuf(&dav_uid);
@@ -144,15 +147,15 @@ void groupdav_put(void)
                hprintf("HTTP/1.1 502 Bad Gateway\r\n");
                groupdav_common_headers();
                hprintf("Content-type: text/plain\r\n");
-
+               begin_burst();
                wprintf("%s\r\n", &buf[4]);
                end_burst();
                return;
        }
 
        /* Send the content to the Citadel server */
-       serv_printf("Content-type: %s\n\n", WCC->upload_content_type);
-       serv_puts(WCC->upload);
+       //serv_printf("Content-type: %s\n\n", WCC->upload_content_type);
+       serv_putbuf(WCC->upload);
        serv_puts("\n000");
 
        /* Fetch the reply from the Citadel server */
@@ -181,6 +184,7 @@ void groupdav_put(void)
                hprintf("HTTP/1.1 502 Bad Gateway\r\n");
                groupdav_common_headers();
                hprintf("Content-type: text/plain\r\n");
+               begin_burst();
                wprintf("new_msgnum is %ld\r\n"
                        "\r\n", new_msgnum);
                end_burst();
@@ -197,7 +201,7 @@ void groupdav_put(void)
                groupdav_common_headers();
                hprintf("etag: \"%ld\"\r\n", new_msgnum);
                hprintf("Location: ");
-               groupdav_identify_host();
+               groupdav_identify_hosthdr();
                hprintf("/groupdav/");/* TODO */
                hurlescputs(ChrPtr(dav_roomname));
                euid_escapize(escaped_uid, ChrPtr(dav_uid));