Fixed BPB bug: GNET command cuts off at 1024 characters
authorArt Cancro <ajc@citadel.org>
Sun, 9 Apr 2017 12:27:40 +0000 (08:27 -0400)
committerArt Cancro <ajc@citadel.org>
Sun, 9 Apr 2017 12:27:40 +0000 (08:27 -0400)
citadel/configure.ac
citadel/netconfig.c

index eb757b2753acadbce1a8e48c28b5a91bf7b1b05f..2a880969bc82eebb8a5e57b36ada57b82c382185 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
-AC_INIT([Citadel], [909], [http://www.citadel.org/])
+AC_INIT([Citadel], [910], [http://www.citadel.org/])
 AC_REVISION([$Revision: 5108 $])
 AC_CONFIG_SRCDIR([citserver.c])
 AC_CONFIG_HEADER(sysdep.h)
index 239796981111497f49a17efc57b359b698a6585e..a6dd412874a7e96d907a431c6c8c9842c2f4b5eb 100644 (file)
@@ -1,8 +1,7 @@
 /*
- * This module handles shared rooms, inter-Citadel mail, and outbound
- * mailing list processing.
+ * This module handles loading, saving, and parsing of room network configurations.
  *
- * Copyright (c) 2000-2016 by the citadel.org team
+ * Copyright (c) 2000-2017 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.
@@ -79,6 +78,7 @@ const CfgLineType *GetCfgTypeByStr(const char *Key, long len)
        }
 }
 
+
 const CfgLineType *GetCfgTypeByEnum(RoomNetCfg eCfg, HashPos *It)
 {
        const char *Key;
@@ -96,6 +96,7 @@ const CfgLineType *GetCfgTypeByEnum(RoomNetCfg eCfg, HashPos *It)
        return NULL;
 }
 
+
 void ParseGeneric(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos, OneRoomNetCfg *OneRNCfg)
 {
        RoomNetCfgLine *nptr;
@@ -122,6 +123,7 @@ void ParseGeneric(const CfgLineType *ThisOne, StrBuf *Line, const char *LinePos,
        OneRNCfg->NetConfigs[ThisOne->C] = nptr;
 }
 
+
 void SerializeGeneric(const CfgLineType *ThisOne, StrBuf *OutputBuffer, OneRoomNetCfg *OneRNCfg, RoomNetCfgLine *data)
 {
        int i;
@@ -137,6 +139,7 @@ void SerializeGeneric(const CfgLineType *ThisOne, StrBuf *OutputBuffer, OneRoomN
        StrBufAppendBufPlain(OutputBuffer, HKEY("\n"), 0);
 }
 
+
 void DeleteGenericCfgLine(const CfgLineType *ThisOne, RoomNetCfgLine **data)
 {
        int i;
@@ -153,6 +156,7 @@ void DeleteGenericCfgLine(const CfgLineType *ThisOne, RoomNetCfgLine **data)
        *data = NULL;
 }
 
+
 RoomNetCfgLine *DuplicateOneGenericCfgLine(const RoomNetCfgLine *data)
 {
        int i;
@@ -182,7 +186,6 @@ void netcfg_keyname(char *keybuf, long roomnum)
 }
 
 
-
 /*
  * Given a room number and a textual netconfig, convert to base64 and write to the configdb
  */
@@ -209,7 +212,6 @@ void write_netconfig_to_configdb(long roomnum, const char *raw_netconfig)
 }
 
 
-
 /*
  * Given a room number, attempt to load the netconfig configdb entry for that room.
  * If it returns NULL, there is no netconfig.
@@ -332,7 +334,6 @@ void SaveRoomNetConfigFile(OneRoomNetCfg *OneRNCfg, long roomnum)
 }
 
 
-
 void AddRoomCfgLine(OneRoomNetCfg *OneRNCfg, struct ctdlroom *qrbuf, RoomNetCfg LineType, RoomNetCfgLine *Line)
 {
        RoomNetCfgLine **pLine;
@@ -434,7 +435,11 @@ void cmd_gnet(char *argbuf)
 
        char *c = LoadRoomNetConfigFile(CC->room.QRnumber);
        if (c) {
-               cprintf("%s\n", c);
+               int len = strlen(c);
+               client_write(c, len);                   // Can't use cprintf() here, it has a limit of 1024 bytes
+               if (c[len] != '\n') {
+                       client_write(HKEY("\n"));
+               }
                free(c);
        }
        cprintf("000\n");
@@ -481,6 +486,7 @@ void DeleteCtdlNodeConf(void *vNode)
        free(Node);
 }
 
+
 CtdlNodeConf *NewNode(StrBuf *SerializedNode)
 {
        const char *Pos = NULL;
@@ -581,11 +587,7 @@ int is_recipient(OneRoomNetCfg *RNCfg, const char *Name)
 }
 
 
-
-int CtdlNetconfigCheckRoomaccess(
-       char *errmsgbuf, 
-       size_t n,
-       const char* RemoteIdentifier)
+int CtdlNetconfigCheckRoomaccess(char *errmsgbuf, size_t n, const char* RemoteIdentifier)
 {
        OneRoomNetCfg *RNCfg;
        int found;
@@ -620,7 +622,6 @@ int CtdlNetconfigCheckRoomaccess(
 }
 
 
-
 /*
  * cmd_netp() - authenticate to the server as another Citadel node polling
  *           for network traffic
@@ -703,6 +704,7 @@ void DeleteNetMap(void *vNetMap)
        free(TheNetMap);
 }
 
+
 CtdlNetMap *NewNetMap(StrBuf *SerializedNetMap)
 {
        const char *Pos = NULL;
@@ -724,6 +726,7 @@ CtdlNetMap *NewNetMap(StrBuf *SerializedNetMap)
        return NM;
 }
 
+
 HashList* CtdlReadNetworkMap(void)
 {
        const char *LinePos;
@@ -757,6 +760,7 @@ HashList* CtdlReadNetworkMap(void)
        return Hash;
 }
 
+
 StrBuf *CtdlSerializeNetworkMap(HashList *Map)
 {
        void *vMap;
@@ -928,7 +932,6 @@ void convert_legacy_netcfg_files(void)
 }
 
 
-
 /*
  * Module entry point
  */