* Applied GroupDAV patches sent in by Johannes Schneider which improve the
authorArt Cancro <ajc@citadel.org>
Thu, 26 May 2005 04:28:27 +0000 (04:28 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 26 May 2005 04:28:27 +0000 (04:28 +0000)
  protocol accuracy of xmlns and etag responses.
* Fixed a MIME Content-Type bug which I had inadvertently introduced while
  removing a temporary hack that was put in during KDE 3.4 beta

webcit/ChangeLog
webcit/groupdav_propfind.c
webcit/groupdav_put.c

index 1b7bd6459e925c539522f96d8db39d09ce128bdc..346fed1dce7059eb2fec914bb8b3ede67017d183 100644 (file)
@@ -1,4 +1,10 @@
 $Log$
+Revision 610.8  2005/05/26 04:28:27  ajc
+* Applied GroupDAV patches sent in by Johannes Schneider which improve the
+  protocol accuracy of xmlns and etag responses.
+* Fixed a MIME Content-Type bug which I had inadvertently introduced while
+  removing a temporary hack that was put in during KDE 3.4 beta
+
 Revision 610.7  2005/05/24 04:26:47  ajc
 * Applied a patch sent by Johannes Schneider for correcting the XML
   namespace presented in the PROPFIND command.
@@ -2528,4 +2534,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 506c084b658e390aac400855a1b062907b633264..f79df78f0be83d15a7d4d679bb53284ad43c4745 100644 (file)
@@ -91,7 +91,7 @@ void groupdav_folder_list(void) {
        begin_burst();
 
        wprintf("<?xml version=\"1.0\" encoding=\"utf-8\"?>"
-               "<D:multistatus xmlns:D=\"DAV:\"xmlns:G=\"http://groupdav.org/\">"
+               "<D:multistatus xmlns:D=\"DAV:\" xmlns:G=\"http://groupdav.org/\">"
        );
 
        serv_puts("LKRA");
@@ -225,7 +225,7 @@ void groupdav_propfind(char *dav_pathname) {
        begin_burst();
 
        wprintf("<?xml version=\"1.0\" encoding=\"utf-8\"?>"
-               "<D:multistatus xmlns:D=\"DAV:\"xmlns:G=\"http://groupdav.org/\">"
+               "<D:multistatus xmlns:D=\"DAV:\" xmlns:G=\"http://groupdav.org/\">"
        );
                //"<D:multistatus xmlns:D=\"DAV:\">"
 
index 09c34c51f87449fb9d561e54dde12c6937e431be..8cec2d45091c2bc3b939ef9192fbf2d8cb91eae0 100644 (file)
  * The pathname is always going to be /groupdav/room_name/euid
  */
 void groupdav_put(char *dav_pathname, char *dav_ifmatch,
-               char *supplied_content_type, char *dav_content
+               char *dav_content_type, char *dav_content
 ) {
        char dav_roomname[SIZ];
        char dav_uid[SIZ];
-       char dav_content_type[SIZ];
        long new_msgnum = (-2L);
        long old_msgnum = (-1L);
        char buf[SIZ];
@@ -71,28 +70,6 @@ void groupdav_put(char *dav_pathname, char *dav_ifmatch,
                return;
        }
 
-       /**********************
-        * Ugly hack to mess with the content type.  KOrganizer is either
-        * not supplying one, or supplying the wrong one.
-        * (Commented out because Reinhold has fixed this bug in KOrg.)
-       strcpy(dav_content_type, supplied_content_type);
-       lprintf(9, "Supplied content type: %s\n", dav_content_type);
-       switch (WC->wc_view) {
-               case VIEW_ADDRESSBOOK:
-                       strcpy(dav_content_type, "text/x-vcard");
-                       break;
-               case VIEW_CALENDAR:
-                       strcpy(dav_content_type, "text/calendar");
-                       break;
-               case VIEW_TASKS:
-                       strcpy(dav_content_type, "text/calendar");
-                       break;
-               default:
-                       break;
-       }
-       lprintf(9, "  Forced content type: %s\n", dav_content_type);
-       ******************/
-
        /*
         * If an HTTP If-Match: header is present, the client is attempting
         * to replace an existing item.  We have to check to see if the
@@ -170,6 +147,7 @@ void groupdav_put(char *dav_pathname, char *dav_ifmatch,
                wprintf("HTTP/1.1 201 Created\r\n");
                lprintf(9, "HTTP/1.1 201 Created\r\n");
                groupdav_common_headers();
+               wprintf("ETag: \"%ld\"\r\n", new_msgnum);
                wprintf("Content-Length: 0\r\n");
                wprintf("Location: ");
                if (strlen(WC->http_host) > 0) {
@@ -188,6 +166,7 @@ void groupdav_put(char *dav_pathname, char *dav_ifmatch,
        wprintf("HTTP/1.1 204 No Content\r\n");
        lprintf(9, "HTTP/1.1 204 No Content\r\n");
        groupdav_common_headers();
+       wprintf("ETag: \"%ld\"\r\n", new_msgnum);
        wprintf("Content-Length: 0\r\n\r\n");
 
        /* The item we replaced has probably already been deleted by