NSYN: fix the NSYN command
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 25 Mar 2013 13:58:48 +0000 (14:58 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 25 Mar 2013 13:58:48 +0000 (14:58 +0100)
  - construct the recipients the way the networking functions expect them
  - add debug log when combining the spoolfile to log the current outbound file size
  - check whether we are able to load the message from disk before calling the recipient handlers.

citadel/modules/network/serv_netmail.c
citadel/modules/network/serv_netspool.c
citadel/modules/network/serv_network.c

index a04bcfb12719aed29726c6a83410af3724d4c2b6..5713ea82ac00b1ee2f8feba851daa780a88a7ea9 100644 (file)
@@ -526,7 +526,7 @@ void network_process_ignetpush(SpoolControl *sc, struct CtdlMessage *omsg, long
                        }
                        
                        QN_syslog(LOG_INFO,
-                                 "%sSending to %s\n",
+                                 " %sSending to %s\n",
                                  (send)?"":"Not ",
                                  ChrPtr(Recipient));
                }
@@ -600,6 +600,7 @@ void network_process_ignetpush(SpoolControl *sc, struct CtdlMessage *omsg, long
 void network_spool_msg(long msgnum,
                       void *userdata)
 {
+       struct CitContext *CCC = CC;
        struct CtdlMessage *msg = NULL;
        long delete_after_send = 0;     /* Set to 1 to delete after spooling */
        SpoolControl *sc;
@@ -608,6 +609,13 @@ void network_spool_msg(long msgnum,
 
        msg = CtdlFetchMessage(msgnum, 1);
 
+       if (msg == NULL)
+       {
+               QN_syslog(LOG_ERR,
+                         "failed to load Message <%ld> from disk\n",
+                         msgnum);
+               return;
+       }
        network_process_list(sc, msg, &delete_after_send);
        network_process_digest(sc, msg, &delete_after_send);
        network_process_participate(sc, msg, &delete_after_send);
index dd049a878445e24f91b3a39c6442d5dae006592b..ca0d6181e3309362dd4c436cb16a1ec6664f8fb3 100644 (file)
@@ -923,6 +923,11 @@ void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
                        do {} while ((FileMoveChunked(&FDIO, &err) > 0) && (err == NULL));
                        if (err == NULL) {
                                unlink(filename);
+                               QN_syslog(LOG_DEBUG,
+                                         "Spoolfile %s now %ld k\n",
+                                         spooloutfilename,
+                                         (dsize + fsize)/1024
+                                       );                              
                        }
                        else {
                                nFailed++;
index 56492925e221a7ce68e1b769378db4e9e3d75f52..6c9ed94b95c7625c1656f1b8814ccb8aa02383bf 100644 (file)
@@ -184,11 +184,24 @@ int network_sync_to(char *target_node, long len)
        {
                return -1;
        }
+
        memset(&sc, 0, sizeof(SpoolControl));
        memset(&OneRNCFG, 0, sizeof(OneRoomNetCfg));
        sc.RNCfg = &OneRNCFG;
        sc.RNCfg->NetConfigs[ignet_push_share] = DuplicateOneGenericCfgLine(pCfgLine);
-
+       sc.Users[ignet_push_share] = NewStrBufPlain(NULL,
+                                                   StrLength(pCfgLine->Value[0]) +
+                                                   StrLength(pCfgLine->Value[1]) + 10);
+       StrBufAppendBuf(sc.Users[ignet_push_share], 
+                       pCfgLine->Value[0],
+                       0);
+       StrBufAppendBufPlain(sc.Users[ignet_push_share], 
+                            HKEY(","),
+                            0);
+
+       StrBufAppendBuf(sc.Users[ignet_push_share], 
+                       pCfgLine->Value[1],
+                       0);
        CalcListID(&sc);
 
        end_critical_section(S_NETCONFIGS);