From: Wilfried Goesgens Date: Mon, 25 Mar 2013 13:58:48 +0000 (+0100) Subject: NSYN: fix the NSYN command X-Git-Tag: v8.20~72 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=ce8ccae34638f0a250526db7da80b7ce412eb3a2 NSYN: fix the NSYN command - 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. --- diff --git a/citadel/modules/network/serv_netmail.c b/citadel/modules/network/serv_netmail.c index a04bcfb12..5713ea82a 100644 --- a/citadel/modules/network/serv_netmail.c +++ b/citadel/modules/network/serv_netmail.c @@ -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); diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index dd049a878..ca0d6181e 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -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++; diff --git a/citadel/modules/network/serv_network.c b/citadel/modules/network/serv_network.c index 56492925e..6c9ed94b9 100644 --- a/citadel/modules/network/serv_network.c +++ b/citadel/modules/network/serv_network.c @@ -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);