* Fix single-item groupdav requests being considered as the whole collection
authorMatt <matt@uncensored.citadel.org>
Sat, 7 Feb 2009 11:08:37 +0000 (11:08 +0000)
committerMatt <matt@uncensored.citadel.org>
Sat, 7 Feb 2009 11:08:37 +0000 (11:08 +0000)
* Add some begin/end_burst where needed
Please test with your Web/GroupDAV clients

webcit/groupdav_get.c
webcit/groupdav_put.c

index 39008e53a23a4214c7a671ee7038d0e6fc2c2817..2a4d4cb543e78de07f1d68968bcea056ee839f20 100644 (file)
@@ -140,7 +140,7 @@ void groupdav_get(StrBuf *dav_pathname) {
 
        /** GET on the collection itself returns an ICS of the entire collection.
         */
-       if (StrLength(dav_uid) > 0) {
+       if (StrLength(dav_uid) == 0) {
                groupdav_get_big_ics();
                FreeStrBuf(&dav_roomname);
                FreeStrBuf(&dav_uid);
index 512cea0980e79068d52e0fe1cbcbd940c725f201..7f4cc810cc17ba68d5b89b81d8a868d0ba42536f 100644 (file)
@@ -44,7 +44,8 @@ void groupdav_put_bigics(StrBuf *dav_content, int offset)
        hprintf("HTTP/1.1 204 No Content\r\n");
        lprintf(9, "HTTP/1.1 204 No Content\r\n");
        groupdav_common_headers();
-       hprintf("Content-Length: 0\r\n");
+       begin_burst();
+       end_burst();
 }
 
 
@@ -125,7 +126,7 @@ void groupdav_put(StrBuf *dav_pathname, char *dav_ifmatch,
 
        /** PUT on the collection itself uploads an ICS of the entire collection.
         */
-       if (StrLength(dav_uid) > 0) {
+       if (StrLength(dav_uid) == 0) {
                groupdav_put_bigics(dav_content, offset);
                FreeStrBuf(&dav_roomname);
                FreeStrBuf(&dav_uid);
@@ -211,14 +212,13 @@ void groupdav_put(StrBuf *dav_pathname, char *dav_ifmatch,
        hprintf("HTTP/1.1 204 No Content\r\n");
        lprintf(9, "HTTP/1.1 204 No Content\r\n");
        groupdav_common_headers();
-       hprintf("etag: \"%ld\"\r\n", new_msgnum);
-       hprintf("Content-Length: 0\r\n");
-
+       hprintf("Etag: \"%ld\"\r\n", new_msgnum);
        /* The item we replaced has probably already been deleted by
         * the Citadel server, but we'll do this anyway, just in case.
         */
        serv_printf("DELE %ld", old_msgnum);
        serv_getln(buf, sizeof buf);
+       begin_burst();
        end_burst();
        FreeStrBuf(&dav_roomname);
        FreeStrBuf(&dav_uid);