void session_loop(struct httprequest *req)
{
char cmd[SIZ];
+ char method[SIZ];
char action[SIZ];
char buf[SIZ];
int a, b;
strcpy(cmd, hptr->line);
hptr = hptr->next;
+ extract_token(method, cmd, 0, ' ');
extract_action(action, cmd);
while (hptr != NULL) {
ContentType, ContentLength);
body_start = strlen(content);
-/***** old version
- BytesRead = 0;
- while (BytesRead < ContentLength) {
- a=read(WC->http_sock, &content[BytesRead+body_start],
- ContentLength - BytesRead);
- if (a <= 0) BytesRead = ContentLength;
- else BytesRead += a;
- }
-*******/
-
- /* Now we're daring and read it all at once. */
- client_read(WC->http_sock, &content[BytesRead+body_start], ContentLength);
+ /* Be daring and read it all at once. */
+ client_read(WC->http_sock, &content[BytesRead+body_start],
+ ContentLength);
if (!strncasecmp(ContentType,
"application/x-www-form-urlencoded", 33)) {
goto SKIP_ALL_THIS_CRAP;
}
#endif
+ /*
+ * The GroupDAV stuff relies on HTTP authentication instead of
+ * our session's authentication.
+ */
+ if (!strncasecmp(action, "groupdav", 8)) {
+ groupdav_main(cmd);
+ goto SKIP_ALL_THIS_CRAP;
+ }
check_for_instant_messages();