]> code.citadel.org Git - citadel.git/commitdiff
* Debugged the GroupDAV service with KOrganizer. It's mostly working now.
authorArt Cancro <ajc@citadel.org>
Wed, 2 Feb 2005 04:13:36 +0000 (04:13 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 2 Feb 2005 04:13:36 +0000 (04:13 +0000)
webcit/ChangeLog
webcit/groupdav_put.c
webcit/webserver.c

index 76fbb627325ae9c874eaa6a6f1b927b43077366d..b053846d1b98c2d0c31e963861c92a6facae3175 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 528.35  2005/02/02 04:13:36  ajc
+* Debugged the GroupDAV service with KOrganizer.  It's mostly working now.
+
 Revision 528.34  2005/02/01 23:15:50  ajc
 * Completed GroupDAV PUT.  Untested.
 
@@ -2287,3 +2290,4 @@ 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 b41f0996d93e64a4d6ec3cf4e3670dbca198f65d..45729c7bf3874b487d9e52a4766330fe29c1f551 100644 (file)
  * The pathname is always going to be /groupdav/room_name/euid
  */
 void groupdav_put(char *dav_pathname, char *dav_ifmatch,
-               char *dav_content_type, char *dav_content
+               char *supplied_content_type, char *dav_content
 ) {
        char dav_roomname[SIZ];
        char dav_uid[SIZ];
-       long new_msgnum = (-1L);
+       char dav_content_type[SIZ];
+       long new_msgnum = (-2L);
        long old_msgnum = (-1L);
        char buf[SIZ];
        int n = 0;
@@ -70,6 +71,25 @@ 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.  FIXME remove this
+        * after getting clarification or a fix from Reinhold.
+        */
+       strcpy(dav_content_type, supplied_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;
+       }
+
        /*
         * 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
@@ -107,7 +127,7 @@ void groupdav_put(char *dav_pathname, char *dav_ifmatch,
        /* Send the content to the Citadel server */
        serv_printf("Content-type: %s\n\n", dav_content_type);
        serv_puts(dav_content);
-       serv_puts("\n000\n");
+       serv_puts("\n000");
 
        /* Fetch the reply from the Citadel server */
        n = 0;
@@ -130,7 +150,11 @@ void groupdav_put(char *dav_pathname, char *dav_ifmatch,
        if (new_msgnum < 0L) {
                wprintf("HTTP/1.1 502 Bad Gateway\n");
                groupdav_common_headers();
-               wprintf("Content-length: 0\n\n");
+               wprintf("Content-type: text/plain\n"
+                       "\n"
+                       "new_msgnum is %ld\n"
+                       "\n", new_msgnum
+               );
                return;
        }
 
index ca74302ca44bc452e65ed54df10f7699c39d30bd..86bcecbad3a479a5c5acaafded4f74d805f15449 100644 (file)
@@ -151,6 +151,7 @@ int client_read_to(int sock, char *buf, int bytes, int timeout)
                }
                len = len + rlen;
        }
+       /*write(2, buf, bytes); FIXME */
        return (1);
 }
 
@@ -162,6 +163,7 @@ ssize_t client_write(const void *buf, size_t count) {
                return(count);
        }
 #endif
+       /* write(2, buf, count); FIXME */
        return(write(WC->http_sock, buf, count));
 }