From 6050cb23108ee10dafcceb65b9cafab51c013ae0 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 12 May 2014 22:32:03 -0400 Subject: [PATCH] Completed the merge of a read-only, reader-only NNTP service into Citadel server. --- citadel/citadel.h | 4 ++-- citadel/config.c | 1 + citadel/control.c | 4 ++++ citadel/include/ctdl_module.h | 1 + citadel/modules/migrate/serv_migrate.c | 2 ++ citadel/modules/nntp/serv_nntp.c | 7 ++++--- citadel/modules/upgrade/serv_upgrade.c | 9 +++++---- citadel/utils/setup.c | 1 + 8 files changed, 20 insertions(+), 9 deletions(-) diff --git a/citadel/citadel.h b/citadel/citadel.h index 83c43e06f..8d4b45d7f 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -1,7 +1,7 @@ /* * Main Citadel header file * - * Copyright (c) 1987-2013 by the citadel.org team + * Copyright (c) 1987-2014 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. @@ -45,7 +45,7 @@ extern "C" { * usually more strict because you're not really supposed to dump/load and * upgrade at the same time. */ -#define REV_LEVEL 829 /* This version */ +#define REV_LEVEL 830 /* This version */ #define REV_MIN 591 /* Oldest compatible database */ #define EXPORT_REV_MIN 760 /* Oldest compatible export files */ #define LIBCITADEL_MIN 829 /* Minimum required version of libcitadel */ diff --git a/citadel/config.c b/citadel/config.c index 5aee1d72a..28084aa1e 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -92,6 +92,7 @@ void brand_new_installation_set_defaults(void) { config.c_xmpp_c2s_port = 5222; config.c_xmpp_s2s_port = 5269; config.c_nntp_port = 119; + config.c_nntps_port = 563; } void setcfglen(void) diff --git a/citadel/control.c b/citadel/control.c index 0bc49456e..0aba12404 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -388,6 +388,7 @@ void cmd_conf(char *argbuf) cprintf("%d\n", config.c_port_number); cprintf("%d\n", config.c_ctdluid); cprintf("%d\n", config.c_nntp_port); + cprintf("%d\n", config.c_nntps_port); cprintf("000\n"); } @@ -661,6 +662,9 @@ void cmd_conf(char *argbuf) case 70: config.c_nntp_port = atoi(buf); break; + case 71: + config.c_nntp_port = atoi(buf); + break; } ++a; } diff --git a/citadel/include/ctdl_module.h b/citadel/include/ctdl_module.h index 36c48bbf3..2b62fc89b 100644 --- a/citadel/include/ctdl_module.h +++ b/citadel/include/ctdl_module.h @@ -385,6 +385,7 @@ struct config { int c_spam_flag_only; int c_guest_logins; int c_nntp_port; + int c_nntps_port; }; struct configlen { long c_nodename; diff --git a/citadel/modules/migrate/serv_migrate.c b/citadel/modules/migrate/serv_migrate.c index 2005864a1..f70493e82 100644 --- a/citadel/modules/migrate/serv_migrate.c +++ b/citadel/modules/migrate/serv_migrate.c @@ -465,6 +465,7 @@ void migr_do_export(void) { cprintf("%ld\n", config.c_pop3_fastest); cprintf("%d\n", config.c_spam_flag_only); cprintf("%d\n", config.c_nntp_port); + cprintf("%d\n", config.c_nntps_port); client_write("\n", 10); /* Export the control file */ @@ -644,6 +645,7 @@ int migr_config(void *data, const char *el) else if (!strcasecmp(el, "c_pop3_fastest")) config.c_pop3_fastest = atol(ChrPtr(migr_chardata)); else if (!strcasecmp(el, "c_spam_flag_only")) config.c_spam_flag_only = atoi(ChrPtr(migr_chardata)); else if (!strcasecmp(el, "c_nntp_port")) config.c_nntp_port = atoi(ChrPtr(migr_chardata)); + else if (!strcasecmp(el, "c_nntps_port")) config.c_nntps_port = atoi(ChrPtr(migr_chardata)); else return 0; return 1; /* Found above...*/ } diff --git a/citadel/modules/nntp/serv_nntp.c b/citadel/modules/nntp/serv_nntp.c index 2a20fd4ce..b5b91db79 100644 --- a/citadel/modules/nntp/serv_nntp.c +++ b/citadel/modules/nntp/serv_nntp.c @@ -1172,12 +1172,13 @@ void nntp_cleanup_function(void) } const char *CitadelServiceNNTP="NNTP"; +const char *CitadelServiceNNTPS="NNTPS"; CTDL_MODULE_INIT(nntp) { if (!threading) { - CtdlRegisterServiceHook(119, // FIXME config.c_nntp_port, + CtdlRegisterServiceHook(config.c_nntp_port, NULL, nntp_greeting, nntp_command_loop, @@ -1185,12 +1186,12 @@ CTDL_MODULE_INIT(nntp) CitadelServiceNNTP); #ifdef HAVE_OPENSSL - CtdlRegisterServiceHook(563, // FIXME config.c_nntps_port, + CtdlRegisterServiceHook(config.c_nntps_port, NULL, nntps_greeting, nntp_command_loop, NULL, - CitadelServiceNNTP); + CitadelServiceNNTPS); #endif CtdlRegisterCleanupHook(nntp_cleanup); diff --git a/citadel/modules/upgrade/serv_upgrade.c b/citadel/modules/upgrade/serv_upgrade.c index e4a527869..085f5f046 100644 --- a/citadel/modules/upgrade/serv_upgrade.c +++ b/citadel/modules/upgrade/serv_upgrade.c @@ -1,7 +1,7 @@ /* * Transparently handle the upgrading of server data formats. * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2014 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. @@ -291,10 +291,11 @@ void update_config(void) { config.c_xmpp_s2s_port = 5269; } - if (CitControl.version < 725) { - - + if (CitControl.version < 830) { + config.c_nntp_port = 119; + config.c_nntps_port = 563; } + if (IsEmptyStr(config.c_default_cal_zone)) { guess_time_zone(); } diff --git a/citadel/utils/setup.c b/citadel/utils/setup.c index 539876b26..593456316 100644 --- a/citadel/utils/setup.c +++ b/citadel/utils/setup.c @@ -1148,6 +1148,7 @@ void set_default_values(void) GetDefaultVALINT(c_xmpp_c2s_port, 5222); GetDefaultVALINT(c_xmpp_s2s_port, 5269); GetDefaultVALINT(c_nntp_port, 119); + GetDefaultVALINT(c_nntps_port, 563); #endif } -- 2.30.2