$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.
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
* 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;
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
/* 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;
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;
}
}
len = len + rlen;
}
+ /*write(2, buf, bytes); FIXME */
return (1);
}
return(count);
}
#endif
+ /* write(2, buf, count); FIXME */
return(write(WC->http_sock, buf, count));
}