Completed the merge of a read-only, reader-only NNTP service into Citadel server.
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 13 May 2014 02:32:03 +0000 (22:32 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Tue, 13 May 2014 02:32:03 +0000 (22:32 -0400)
citadel/citadel.h
citadel/config.c
citadel/control.c
citadel/include/ctdl_module.h
citadel/modules/migrate/serv_migrate.c
citadel/modules/nntp/serv_nntp.c
citadel/modules/upgrade/serv_upgrade.c
citadel/utils/setup.c

index 83c43e06f61b5e8fab222fbec30a50b98a1baad2..8d4b45d7f382a5d2d04987af291cabe91827887f 100644 (file)
@@ -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 */
index 5aee1d72a42782073bef40e060648709db8dd09e..28084aa1e6186fc2812a4e60fc3dcf8115823318 100644 (file)
@@ -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)
index 0bc49456ec9722722f507099fc9a75cec67c5e7c..0aba124044914bd9b1a2619d21933924ef5999f0 100644 (file)
@@ -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;
                }
index 36c48bbf3657dd8613ae1fc2ab525f880e7c1e53..2b62fc89b31cbfc6e0a21e2b114468e1e5261bcd 100644 (file)
@@ -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;
index 2005864a1f03f6ba4367a05098df5ddfb408f800..f70493e825a085ee968a80519f7a4540157c1486 100644 (file)
@@ -465,6 +465,7 @@ void migr_do_export(void) {
        cprintf("<c_pop3_fastest>%ld</c_pop3_fastest>\n", config.c_pop3_fastest);
        cprintf("<c_spam_flag_only>%d</c_spam_flag_only>\n", config.c_spam_flag_only);
        cprintf("<c_nntp_port>%d</c_nntp_port>\n", config.c_nntp_port);
+       cprintf("<c_nntps_port>%d</c_nntps_port>\n", config.c_nntps_port);
        client_write("</config>\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...*/
 }
index 2a20fd4ce290d0dfc4c7ec3b948941ae3ccd1473..b5b91db791b8d02a1bb98212088a60005266633d 100644 (file)
@@ -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);
index e4a527869a88e17b030f02a4370684c1ad3e4291..085f5f046d1ebca105e936a0ab0ef61e237cf79a 100644 (file)
@@ -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();
        }
index 539876b26bad12791e2584d39d4b65c6763c2b85..5934563160b72ebbf8d6e73e3794e85680323010 100644 (file)
@@ -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
 }