#include "webserver.h"
-/*
- * String to unset the cookie.
- * Any date "in the past" will work, so I chose my birthday, right down to
- * the exact minute. :)
- */
-static char *unset = "; expires=28-May-1971 18:10:00 GMT";
StrBuf *csslocal = NULL;
HashList *HandlerHash = NULL;
{
WebcitHandler *Handler = (WebcitHandler*) vHandler;
FreeStrBuf(&Handler->Name);
+ FreeStrBuf(&Handler->DisplayName);
free (Handler);
-
}
void WebcitAddUrlHandler(const char * UrlString, long UrlSLen,
int cache /* 1 = allow browser to cache this page */
) {
wcsession *WCC = WC;
- char cookie[1024];
char httpnow[128];
hprintf("HTTP/1.1 200 OK\n");
);
}
- if (cache < 2) {
-
- stuff_to_cookie(cookie, 1024,
- WCC->wc_session,
- WCC->wc_username,
- WCC->wc_password,
- WCC->wc_roomname,
- get_selected_language()
- );
-
- if (unset_cookies) {
- hprintf("Set-cookie: webcit=%s; path=/\r\n", unset);
- } else {
- hprintf("Set-cookie: webcit=%s; path=/\r\n", cookie);
- if (server_cookie != NULL) {
- hprintf("%s\n", server_cookie);
- }
- }
- }
+ if (cache < 2) stuff_to_cookie(unset_cookies);
if (do_htmlhead) {
begin_burst();
if (Floors != NULL)
{
if (GetHash(Floors, SKEY(pFloor), &vFloor))
- WCC->CurrentFloor = (floor*) vFloor;
+ WCC->CurrentFloor = (Floor*) vFloor;
}
}
}
if (ibstr("nonce") != WCC->nonce) {
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");
+ hprintf("Content-Type: text/plain\r\n");
begin_burst();
wc_printf("Security check failed.\r\n");
end_burst();
* If we aren't in any room yet, but we have cookie data telling us where we're
* supposed to be, and 'gotofirst' was not specified, then go there.
*/
- else if ( (StrLength(WCC->wc_roomname) == 0) && ( (StrLength(WCC->Hdr->c_roomname) > 0) )) {
+ else if ( (StrLength(WCC->CurRoom.name) == 0) && ( (StrLength(WCC->Hdr->c_roomname) > 0) )) {
int ret;
lprintf(9, "We are in '%s' but cookie indicates '%s', going there...\n",
- ChrPtr(WCC->wc_roomname),
+ ChrPtr(WCC->CurRoom.name),
ChrPtr(WCC->Hdr->c_roomname)
);
ret = gotoroom(WCC->Hdr->c_roomname); /* do quietly to avoid session output! */
snprintf(dir, SIZ, "%s/webcit.css", static_local_dir);
if (!access(dir, R_OK)) {
lprintf(9, "Using local Stylesheet [%s]\n", dir);
- csslocal = NewStrBufPlain(HKEY("<link href=\"static.local/webcit.css\" rel=\"stylesheet\" type=\"text/css\">"));
+ csslocal = NewStrBufPlain(HKEY("<link href=\"static.local/webcit.css\" rel=\"stylesheet\" type=\"text/css\" />"));
}
else
lprintf(9, "No Site-local Stylesheet [%s] installed. \n", dir);