From: Art Cancro Date: Fri, 5 Jan 2018 22:23:54 +0000 (-0500) Subject: MAKE WEBCIT GREAT AGAIN! X-Git-Tag: v939~456 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=52b6f96d74b3faf7e25f87618493c1ffd8cc3571;p=citadel.git MAKE WEBCIT GREAT AGAIN! --- diff --git a/webcit-ng/admin_functions.c b/webcit-ng/admin_functions.c index 6071dcacc..dbd3eca95 100644 --- a/webcit-ng/admin_functions.c +++ b/webcit-ng/admin_functions.c @@ -1,7 +1,7 @@ /* * Admin functions * - * Copyright (c) 1996-2017 by the citadel.org team + * 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. @@ -32,7 +32,7 @@ void try_login(struct http_transaction *h, struct ctdlsession *c) snprintf(buf, sizeof buf, "%s:%s", username, password); CtdlEncodeBase64(auth, buf, strlen(buf), 0); - syslog(LOG_DEBUG, "try_login(username='%s',password=(%d bytes))", username, strlen(password)); + syslog(LOG_DEBUG, "try_login(username='%s',password=(%d bytes))", username, (int)strlen(password)); ctdl_printf(c, "LOUT"); // log out, in case we were logged in ctdl_readline(c, buf, sizeof(buf)); // ignore the result diff --git a/webcit-ng/caldav_reports.c b/webcit-ng/caldav_reports.c index b34581a0c..74980518e 100644 --- a/webcit-ng/caldav_reports.c +++ b/webcit-ng/caldav_reports.c @@ -2,7 +2,7 @@ * This file contains functions which handle all of the CalDAV "REPORT" queries * specified in RFC4791 section 7. * - * Copyright (c) 2016 by the citadel.org team + * Copyright (c) 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. @@ -171,7 +171,7 @@ StrBuf *fetch_ical(struct ctdlsession *c, long msgnum) * Called by caldav_report() to output a single item. * Our policy is to throw away the list of properties the client asked for, and just send everything. */ -caldav_response(struct http_transaction *h, struct ctdlsession *c, StrBuf *ReportOut, StrBuf *ThisHref) +void caldav_response(struct http_transaction *h, struct ctdlsession *c, StrBuf *ReportOut, StrBuf *ThisHref) { long msgnum; StrBuf *Caldata = NULL; diff --git a/webcit-ng/ctdl_commands.c b/webcit-ng/ctdl_commands.c index 64193556b..2017c908b 100644 --- a/webcit-ng/ctdl_commands.c +++ b/webcit-ng/ctdl_commands.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996-2016 by the citadel.org team + * 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. diff --git a/webcit-ng/ctdlclient.c b/webcit-ng/ctdlclient.c index b6f204aad..a75d18a02 100644 --- a/webcit-ng/ctdlclient.c +++ b/webcit-ng/ctdlclient.c @@ -1,7 +1,7 @@ /* * Functions that handle communication with a Citadel Server * - * Copyright (c) 1987-2016 by the citadel.org team + * Copyright (c) 1987-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. @@ -28,7 +28,7 @@ int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes) int len = 0; int c = 0; - if (buf == NULL) return; + if (buf == NULL) return(-1); while (len < maxbytes) { c = read(ctdl->sock, &buf[len], 1); diff --git a/webcit-ng/ctdlfunctions.c b/webcit-ng/ctdlfunctions.c index 9c16ded02..cba9747e2 100644 --- a/webcit-ng/ctdlfunctions.c +++ b/webcit-ng/ctdlfunctions.c @@ -1,7 +1,7 @@ /* * These utility functions loosely make up a Citadel protocol client library. * - * Copyright (c) 2016 by the citadel.org team + * Copyright (c) 2016-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. diff --git a/webcit-ng/html2html.c b/webcit-ng/html2html.c index f7db44db9..8e118e694 100644 --- a/webcit-ng/html2html.c +++ b/webcit-ng/html2html.c @@ -2,7 +2,7 @@ * Output an HTML message, modifying it slightly to make sure it plays nice * with the rest of our web framework. * - * Copyright (c) 2005-2017 by the citadel.org team + * Copyright (c) 2005-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. diff --git a/webcit-ng/http.c b/webcit-ng/http.c index 0749a21a1..a7df97156 100644 --- a/webcit-ng/http.c +++ b/webcit-ng/http.c @@ -1,7 +1,7 @@ /* * This module handles HTTP transactions. * - * Copyright (c) 1996-2016 by the citadel.org team + * 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. diff --git a/webcit-ng/main.c b/webcit-ng/main.c index 69f4ecad8..4270d3c5d 100644 --- a/webcit-ng/main.c +++ b/webcit-ng/main.c @@ -1,7 +1,7 @@ /* * Main entry point for the program. * - * Copyright (c) 1996-2017 by the citadel.org team + * 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. @@ -105,7 +105,7 @@ int main(int argc, char **argv) /* Tell 'em who's in da house */ syslog(LOG_NOTICE, "MAKE WEBCIT GREAT AGAIN!"); - syslog(LOG_NOTICE, "Copyright (C) 1996-2017 by the citadel.org team"); + syslog(LOG_NOTICE, "Copyright (C) 1996-2018 by the citadel.org team"); syslog(LOG_NOTICE, " "); syslog(LOG_NOTICE, "This program is open source software: you can redistribute it and/or"); syslog(LOG_NOTICE, "modify it under the terms of the GNU General Public License, version 3."); diff --git a/webcit-ng/messages.c b/webcit-ng/messages.c index 3b9f09649..fa0ada03d 100644 --- a/webcit-ng/messages.c +++ b/webcit-ng/messages.c @@ -1,7 +1,7 @@ /* * Message base functions * - * Copyright (c) 1996-2016 by the citadel.org team + * 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. @@ -269,7 +269,7 @@ void download_mime_component(struct http_transaction *h, struct ctdlsession *c, do { thisblock = read(c->sock, &h->response_body[bytes], (h->response_body_length - bytes)); bytes += thisblock; - syslog(LOG_DEBUG, "Bytes read: %d of %d", bytes, h->response_body_length); + syslog(LOG_DEBUG, "Bytes read: %d of %d", (int)bytes, (int)h->response_body_length); } while ((bytes < h->response_body_length) && (thisblock >= 0)); h->response_body[h->response_body_length] = 0; // null terminate it just for good measure syslog(LOG_DEBUG, "content type: %s", content_type); diff --git a/webcit-ng/request.c b/webcit-ng/request.c index 186b2ac66..c182a2912 100644 --- a/webcit-ng/request.c +++ b/webcit-ng/request.c @@ -5,7 +5,7 @@ * and pass control back down to the HTTP layer to output the response back to * the client. * - * Copyright (c) 1996-2016 by the citadel.org team + * 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. diff --git a/webcit-ng/room_functions.c b/webcit-ng/room_functions.c index 4d166e320..dc4551ae5 100644 --- a/webcit-ng/room_functions.c +++ b/webcit-ng/room_functions.c @@ -1,7 +1,7 @@ /* * Room functions * - * Copyright (c) 1996-2017 by the citadel.org team + * 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. diff --git a/webcit-ng/ssl.c b/webcit-ng/ssl.c index 05d62de6a..f0e24e671 100644 --- a/webcit-ng/ssl.c +++ b/webcit-ng/ssl.c @@ -2,7 +2,7 @@ * Functions in this module handle SSL encryption when WebCit is running * as an HTTPS server. * - * Copyright (c) 1996-2016 by the citadel.org team + * 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. diff --git a/webcit-ng/static.c b/webcit-ng/static.c index 5508abae7..207cbabdb 100644 --- a/webcit-ng/static.c +++ b/webcit-ng/static.c @@ -1,7 +1,7 @@ /* * Output static content * - * Copyright (c) 1996-2016 by the citadel.org team + * 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. diff --git a/webcit-ng/tcp_sockets.c b/webcit-ng/tcp_sockets.c index 55899bb04..767582eb2 100644 --- a/webcit-ng/tcp_sockets.c +++ b/webcit-ng/tcp_sockets.c @@ -1,7 +1,7 @@ /* * TCP sockets layer * - * Copyright (c) 1987-2016 by the citadel.org team + * Copyright (c) 1987-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. diff --git a/webcit-ng/text2html.c b/webcit-ng/text2html.c index 708d3e1ca..bffb90e88 100644 --- a/webcit-ng/text2html.c +++ b/webcit-ng/text2html.c @@ -1,7 +1,7 @@ /* * Convert text/plain to text/html * - * Copyright (c) 2017 by the citadel.org team + * Copyright (c) 2017-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. @@ -119,4 +119,3 @@ StrBuf *variformat2html(StrBuf *Source) } - diff --git a/webcit-ng/threaded_view.c b/webcit-ng/threaded_view.c index 07d689c24..12c70b60d 100644 --- a/webcit-ng/threaded_view.c +++ b/webcit-ng/threaded_view.c @@ -1,7 +1,7 @@ /* * Threaded message view * - * Copyright (c) 1996-2017 by the citadel.org team + * 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. diff --git a/webcit-ng/util.c b/webcit-ng/util.c index 9fdf58a64..6d0c69d62 100644 --- a/webcit-ng/util.c +++ b/webcit-ng/util.c @@ -1,7 +1,7 @@ /* * Utility functions * - * Copyright (c) 1996-2016 by the citadel.org team + * 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. diff --git a/webcit-ng/webcit.h b/webcit-ng/webcit.h index 1eae0ca10..8dfcf7116 100644 --- a/webcit-ng/webcit.h +++ b/webcit-ng/webcit.h @@ -152,8 +152,12 @@ StrBuf *html2html(const char *supplied_charset, int treat_as_wiki, char *roomnam void download_mime_component(struct http_transaction *h, struct ctdlsession *c, long msgnum, char *partnum); StrBuf *text2html(const char *supplied_charset, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source); StrBuf *variformat2html(StrBuf *Source); - -void *mallok(size_t size); -void phree(void *ptr); -void *reallok(void *ptr, size_t size); - +int ctdl_readline(struct ctdlsession *ctdl, char *buf, int maxbytes); +void ctdl_c(struct http_transaction *h, struct ctdlsession *c); +int webserver(char *webserver_interface, int webserver_port, int webserver_protocol); +void ctdl_printf(struct ctdlsession *ctdl, const char *format,...); +int webcit_tcp_server(const char *ip_addr, int port_number, int queue_len); +void do_502(struct http_transaction *h); +void do_404(struct http_transaction *h); +void do_412(struct http_transaction *h); +void UrlizeText(StrBuf* Target, StrBuf *Source, StrBuf *WrkBuf); diff --git a/webcit-ng/webserver.c b/webcit-ng/webserver.c index 1a0776c82..25b87ec10 100644 --- a/webcit-ng/webserver.c +++ b/webcit-ng/webserver.c @@ -5,7 +5,7 @@ * connections, and dispatching active connections onto a pool of worker * threads. * - * Copyright (c) 1996-2016 by the citadel.org team + * 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.