4 * Entry point for GroupDAV functions
14 #include <sys/types.h>
16 #include <sys/socket.h>
25 #include "webserver.h"
28 void groupdav_main(struct httprequest *req) {
30 struct httprequest *rptr;
32 char dav_pathname[SIZ];
36 "HTTP/1.1 401 Authorization Required\n"
37 "WWW-Authenticate: Basic realm=\"%s\"\n"
38 "Connection: close\n",
39 serv_info.serv_humannode
41 wprintf("Content-Type: text/plain\n");
43 wprintf("GroupDAV sessions require HTTP authentication.\n");
47 extract_token(dav_method, req->line, 0, ' ');
48 extract_token(dav_pathname, req->line, 1, ' ');
51 * We like the GET method ... it's nice and simple.
53 if (!strcasecmp(dav_method, "GET")) {
54 groupdav_get(dav_pathname);
59 * Couldn't find what we were looking for. Die in a car fire.
62 "HTTP/1.1 404 not found\n"
64 "Content-Type: text/plain\n"
67 wprintf("The object or resource \"%s\" was not found.\n", dav_pathname);
70 * FIXME ... after development is finished, get rid of all this
72 wprintf("\n\n\n ** DEBUGGING INFO FOLLOWS ** \n\n");
73 wprintf("WC->httpauth_user = %s\n", WC->httpauth_user);
74 wprintf("WC->httpauth_pass = (%d characters)\n", strlen(WC->httpauth_pass));
75 wprintf("WC->wc_session = %d\n", WC->wc_session);
77 for (rptr=req; rptr!=NULL; rptr=rptr->next) {
78 wprintf("> %s\n", rptr->line);