$Log$
+Revision 528.47 2005/02/09 04:37:32 ajc
+* More GroupDAV fixes and tuning.
+
Revision 528.46 2005/02/07 22:02:00 ajc
* groupdav_propfind.c: output all XML on a single line, with no linebreaks,
and no whitespace between tags. We have discovered that doing otherwise
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
char dav_method[SIZ];
char dav_pathname[SIZ];
char dav_ifmatch[SIZ];
+ int i;
strcpy(dav_method, "");
strcpy(dav_pathname, "");
* then if all that's left is an asterisk, make it go away entirely.
*/
if (strlen(dav_ifmatch) > 0) {
+ striplt(dav_ifmatch);
if (dav_ifmatch[0] == '\"') {
strcpy(dav_ifmatch, &dav_ifmatch[1]);
- if (strtok(dav_ifmatch, "\"") != NULL) {
- strcpy(strtok(dav_ifmatch, "\""), "");
+ for (i=0; i<strlen(dav_ifmatch); ++i) {
+ if (dav_ifmatch[i] == '\"') {
+ dav_ifmatch[i] = 0;
+ }
}
}
if (!strcmp(dav_ifmatch, "*")) {
* version, so we fail...
*/
if (strlen(dav_ifmatch) > 0) {
+ lprintf(9, "dav_ifmatch: %s\n", dav_ifmatch);
old_msgnum = locate_message_by_uid(dav_uid);
+ lprintf(9, "old_msgnum: %ld\n", old_msgnum);
if (atol(dav_ifmatch) != old_msgnum) {
wprintf("HTTP/1.1 412 Precondition Failed\r\n");
+ lprintf(9, "HTTP/1.1 412 Precondition Failed\r\n");
groupdav_common_headers();
wprintf("Content-Length: 0\r\n\r\n");
return;
/* We created this item for the first time. */
if (old_msgnum < 0L) {
wprintf("HTTP/1.1 201 Created\r\n");
+ lprintf(9, "HTTP/1.1 201 Created\r\n");
groupdav_common_headers();
wprintf("Content-Length: 0\r\n");
wprintf("Location: ");
/* We modified an existing item. */
wprintf("HTTP/1.1 204 No Content\r\n");
+ lprintf(9, "HTTP/1.1 204 No Content\r\n");
groupdav_common_headers();
wprintf("Content-Length: 0\r\n\r\n");
goto SKIP_ALL_THIS_CRAP;
}
+
+ /*
+ * If this isn't a GroupDAV session, it's an ordinary browser
+ * connecting to the user interface. Only allow GET and POST
+ * methods.
+ */
+ if ((strcasecmp(method, "GET")) && (strcasecmp(method, "POST"))) {
+ wprintf("HTTP/1.1 405 Method Not Allowed\r\n");
+ groupdav_common_headers();
+ wprintf("Content-Length: 0\r\n\r\n");
+ goto SKIP_ALL_THIS_CRAP;
+ }
+
check_for_instant_messages();
/*
/*
* Uncomment to dump an HTTP trace to stderr
- */
#define HTTP_TRACING 1
+ */
#include <ctype.h>
#include <stdlib.h>