void upload_handler(char *name, char *filename, char *partnum, char *disp,
- void *content, char *cbtype, size_t length,
- char *encoding, void *userdata)
+ void *content, char *cbtype, char *cbcharset,
+ size_t length, char *encoding, void *userdata)
{
struct urlcontent *u;
+ lprintf(9, "upload_handler() name=%s, type=%s, len=%d\n",
+ name, cbtype, length);
+
/* Form fields */
if ( (length > 0) && (strlen(cbtype) == 0) ) {
u = (struct urlcontent *) malloc(sizeof(struct urlcontent));
/*
- * If this isn't a GroupDAV session, it's an ordinary browser
- * connecting to the user interface. Only allow GET and POST
- * methods.
+ * Automatically send requests with any method other than GET or
+ * POST to the GroupDAV code as well.
*/
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");
+ groupdav_main(req, ContentType, /* do GroupDAV methods */
+ ContentLength, content+body_start);
+ if (!WC->logged_in) {
+ WC->killthis = 1; /* If not logged in, don't */
+ } /* keep the session active */
goto SKIP_ALL_THIS_CRAP;
}