4 * Entry point for GroupDAV functions
14 #include <sys/types.h>
16 #include <sys/socket.h>
25 #include "webserver.h"
30 * Main entry point for GroupDAV requests
32 void groupdav_main(struct httprequest *req) {
34 struct httprequest *rptr;
36 char dav_pathname[SIZ];
40 "HTTP/1.1 401 Unauthorized\n"
41 "WWW-Authenticate: Basic realm=\"%s\"\n"
42 "Connection: close\n",
43 serv_info.serv_humannode
45 wprintf("Content-Type: text/plain\n");
47 wprintf("GroupDAV sessions require HTTP authentication.\n");
51 extract_token(dav_method, req->line, 0, ' ');
52 extract_token(dav_pathname, req->line, 1, ' ');
53 unescape_input(dav_pathname);
56 * We like the GET method ... it's nice and simple.
58 if (!strcasecmp(dav_method, "GET")) {
59 groupdav_get(dav_pathname);
64 * Couldn't find what we were looking for. Die in a car fire.
67 "HTTP/1.1 501 Method not implemented\n"
69 "Content-Type: text/plain\n"
72 wprintf("GroupDAV method \"%s\" is not implemented.\n", dav_method);
75 * FIXME ... after development is finished, get rid of all this
77 wprintf("\n\n\n ** DEBUGGING INFO FOLLOWS ** \n\n");
78 wprintf("WC->httpauth_user = %s\n", WC->httpauth_user);
79 wprintf("WC->httpauth_pass = (%d characters)\n", strlen(WC->httpauth_pass));
80 wprintf("WC->wc_session = %d\n", WC->wc_session);
82 for (rptr=req; rptr!=NULL; rptr=rptr->next) {
83 wprintf("> %s\n", rptr->line);