X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fwebcit.c;h=4108ecb38c3971355b6f5ad650ed7cbd02c9b133;hb=HEAD;hp=11f8afe505e14cb113fdd62a5fc58cb6bf5da5b8;hpb=d337527fdb58a5496428babc0d68736ada0d4c0e;p=citadel.git diff --git a/webcit/webcit.c b/webcit/webcit.c index 11f8afe50..b24007f09 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1,20 +1,19 @@ -/* - * This is the main transaction loop of the web service. It maintains a - * persistent session to the Citadel server, handling HTTP WebCit requests as - * they arrive and presenting a user interface. - * - * Copyright (c) 1996-2018 by the citadel.org team - * - * This program is open source software. You can redistribute it and/or - * modify it under the terms of the GNU General Public License, version 3. - */ +// This is the main transaction loop of the web service. It maintains a +// persistent session to the Citadel server, handling HTTP WebCit requests as +// they arrive and presenting a user interface. +// +// Copyright (c) 1996-2021 by the citadel.org team +// +// This program is open source software. You can redistribute it and/or +// modify it under the terms of the GNU General Public License, version 3. + #define SHOW_ME_VAPPEND_PRINTF #include #include #include "webcit.h" #include "dav.h" -#include "webserver.h" + StrBuf *csslocal = NULL; HashList *HandlerHash = NULL; @@ -391,15 +390,15 @@ void end_ajax_response(void) { /* * Wraps a Citadel server command in an AJAX transaction. */ -void ajax_servcmd(void) -{ +void ajax_servcmd(void) { int Done = 0; StrBuf *Buf; char *junk; size_t len; - if (verbose) + if (verbose) { syslog(LOG_DEBUG, "ajax_servcmd() g_cmd=\"%s\"", bstr("g_cmd") ); + } begin_ajax_response(); Buf = NewStrBuf(); serv_puts(bstr("g_cmd")); @@ -642,15 +641,15 @@ void session_loop(void) } /* If there are variables in the URL, we must grab them now */ - if (WC->Hdr->PlainArgs != NULL) + if (WC->Hdr->PlainArgs != NULL) { ParseURLParams(WC->Hdr->PlainArgs); + } /* If the client sent a nonce that is incorrect, kill the request. */ if (havebstr("nonce")) { - if (verbose) - syslog(LOG_DEBUG, "Comparing supplied nonce %s to session nonce %d", - bstr("nonce"), WC->nonce - ); + if (verbose) { + syslog(LOG_DEBUG, "Comparing supplied nonce %s to session nonce %d", bstr("nonce"), WC->nonce); + } if (ibstr("nonce") != WC->nonce) { syslog(LOG_INFO, "Ignoring request with mismatched nonce."); hprintf("HTTP/1.1 404 Security check failed\r\n"); @@ -703,9 +702,9 @@ void session_loop(void) serv_printf("PASS %s", ChrPtr(WC->Hdr->c_password)); StrBuf_ServGetln(Buf); if (GetServerStatus(Buf, NULL) == 2) { - become_logged_in(WC->Hdr->c_username, - WC->Hdr->c_password, Buf); - } else { + become_logged_in(WC->Hdr->c_username, WC->Hdr->c_password, Buf); + } + else { /* Should only display when password is wrong */ WC->ImportantMsg = NewStrBufPlain(ChrPtr(Buf) + 4, StrLength(Buf) - 4); authorization_required();