* be more picky about what sending with hprintf and wprintf in some sluggish errormessages
* add missing begin_bursts()
StrBufAppendBufPlain(hdr->HR.plainauth, HKEY(":"), 0);
StrBufAppendBuf(hdr->HR.plainauth, hdr->HR.user_agent, 0);
hdr->HR.SessionKey = hashlittle(SKEY(hdr->HR.plainauth), 89479832);
-
+/*
+ lprintf(1, "CheckAuthBasic: calculated sessionkey %ld\n",
+ hdr->HR.SessionKey);
+*/
}
void GetAuthBasic(ParsedHttpHdrs *hdr)
(!strcasecmp(ChrPtr(Hdr->c_password), ChrPtr(sptr->wc_password))) ) {
TheSession = sptr;
}
+ if (TheSession == NULL)
+ lprintf(1, "found sessionkey [%ld], but credentials for [%s|%s] didn't match\n",
+ Hdr->HR.SessionKey,ChrPtr(Hdr->c_username), ChrPtr(sptr->wc_username));
break;
case AUTH_COOKIE:
/* If cookie-session, look for a session with matching session ID */
}
}
pthread_mutex_unlock(ListMutex);
+ if (TheSession == NULL)
+ lprintf(1, "didn't find sessionkey [%ld] for user [%s]\n",
+ Hdr->HR.SessionKey,ChrPtr(Hdr->c_username));
return TheSession;
}
hprintf("HTTP/1.1 404 not found\r\n");
groupdav_common_headers();
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf("%s\r\n",
&buf[4]
- );/* TODO: do we need to end-burst here? */
+ );
+ end_burst();
return;
}
groupdav_common_headers();
hprintf("Date: %s\r\n", datestring);
hprintf(
- "Content-Type: text/plain\r\n"
- "\r\n"
+ "Content-Type: text/plain\r\n");
+ begin_burst();
+ wprintf(
"There is no folder called \"%s\" on this server.\r\n",
ChrPtr(dav_roomname)
);
- begin_burst();
end_burst();
FreeStrBuf(&dav_roomname);
FreeStrBuf(&dav_uid);
if (dav_msgnum < 0) {
hprintf("HTTP/1.1 404 not found\r\n");
groupdav_common_headers();
- hprintf(
- "Content-Type: text/plain\r\n"
- "\r\n"
+ hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
+ wprintf(
"Object \"%s\" was not found in the \"%s\" folder.\r\n",
ChrPtr(dav_uid),
ChrPtr(dav_roomname)
);
FreeStrBuf(&dav_roomname);
FreeStrBuf(&dav_uid);
- begin_burst();end_burst();return;
+ end_burst();return;
}
hprintf("HTTP/1.1 200 OK\r\n");
hprintf("Date: %s\r\n", datestring);
hprintf("DAV: 1\r\n");
hprintf("Allow: OPTIONS, PROPFIND, GET, PUT, DELETE\r\n");
- hprintf("\r\n");
+
begin_burst();
end_burst();
FreeStrBuf(&dav_roomname);
hprintf("Date: %s\r\n", datestring);
hprintf("DAV: 1\r\n");
hprintf("Allow: OPTIONS, PROPFIND, GET, PUT\r\n");
- hprintf("\r\n");
begin_burst();
+ wprintf("\r\n");
end_burst();
}
hprintf("HTTP/1.1 502 Bad Gateway\r\n");
groupdav_common_headers();
hprintf("Content-type: text/plain\r\n");
+ begin_burst();
wprintf("%s\r\n", &buf[4]);
end_burst();
return;
hprintf("HTTP/1.1 404 not found\r\n");
groupdav_common_headers();
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf("The object you requested was not found.\r\n");
end_burst();
return;
hprintf("HTTP/1.1 404 not found\r\n");
groupdav_common_headers();
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf("There is no folder called \"%s\" on this server.\r\n",
ChrPtr(dav_roomname));
end_burst();
lprintf(9, "HTTP/1.1 412 Precondition Failed (ifmatch=%ld, old_msgnum=%ld)\r\n",
StrTol(WCC->Hdr->HR.dav_ifmatch), old_msgnum);
groupdav_common_headers();
- hprintf("Content-Length: 0\r\n");
+
end_burst();
FreeStrBuf(&dav_roomname);
FreeStrBuf(&dav_uid);
hprintf("HTTP/1.1 502 Bad Gateway\r\n");
groupdav_common_headers();
hprintf("Content-type: text/plain\r\n");
-
+ begin_burst();
wprintf("%s\r\n", &buf[4]);
end_burst();
return;
hprintf("HTTP/1.1 502 Bad Gateway\r\n");
groupdav_common_headers();
hprintf("Content-type: text/plain\r\n");
+ begin_burst();
wprintf("new_msgnum is %ld\r\n"
"\r\n", new_msgnum);
end_burst();
hprintf("HTTP/1.1 404 %s\n", ChrPtr(partnum));
output_headers(0, 0, 0, 0, 0, 0);
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf(_("An error occurred while retrieving this part: %s/%s\n"),
ChrPtr(partnum), ChrPtr(filename));
end_burst();
hprintf("HTTP/1.1 404 %s\n", ChrPtr(Buf));
output_headers(0, 0, 0, 0, 0, 0);
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf(_("An error occurred while retrieving this part: %s\n"),
ChrPtr(Buf));
end_burst();
output_headers(0, 0, 0, 0, 0, 0);
hprintf("Content-type: text/html; charset=utf-8\r\n");
+ begin_burst();
wprintf("<html>\n"
"<head>\n"
"<meta http-equiv=\"refresh\" content=\"3\" />\n"
output_headers(0, 0, 0, 0, 0, 0);
hprintf("Content-type: text/html; charset=utf-8\r\n");
+ begin_burst();
wprintf("<HTML>"
"<BODY onLoad=\"document.chatsendform.send_this.focus();\" >"
);
lprintf(9, "output_static('%s') [%s] -- NOT FOUND --\n", what, ChrPtr(WC->Hdr->this_page));
hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf("Cannot open %s: %s\r\n", what, strerror(errno));
end_burst();
} else {
lprintf(9, "output_static('%s') -- FSTAT FAILED --\n", what);
hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf("Cannot fstat %s: %s\n", what, strerror(errno));
end_burst();
return;
hprintf("HTTP/1.1 500 %s\n","Unable to get photo");
output_headers(0, 0, 0, 0, 0, 0);
hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
wprintf(_("Could Not decode vcard photo\n"));
end_burst();
return;
hprintf("Location: %s\r\n", whichpage);
hprintf("URI: %s\r\n", whichpage);
hprintf("Content-type: text/html; charset=utf-8\r\n");
+ begin_burst();
wprintf("<html><body>");
wprintf("Go <a href=\"%s\">here</A>.", whichpage);
wprintf("</body></html>\n");
);
hprintf("WWW-Authenticate: Basic realm=\"%s\"\r\n", ChrPtr(WC->serv_info->serv_humannode));
hprintf("Content-Type: text/html\r\n");
+ begin_burst();
wprintf("<h1>");
wprintf(_("Authorization Required"));
wprintf("</h1>\r\n");
wprintf(_("The resource you requested requires a valid username and password. "
"You could not be logged in: %s\n"), message);
wDumpContent(0);
- WCC->killthis = 1;
+ end_webcit_session();
}
/*
lprintf(9, "Ignoring request with mismatched nonce.\n");
hprintf("HTTP/1.1 404 Security check failed\r\n");
hprintf("Content-Type: text/plain\r\n\r\n");
+ begin_burst();
wprintf("Security check failed.\r\n");
end_burst();
goto SKIP_ALL_THIS_CRAP;