From: Wilfried Goesgens Date: Sat, 17 Aug 2013 19:05:36 +0000 (+0200) Subject: Networker: more verbose INFO-logging about what we do / did with files. X-Git-Tag: v8.22~23 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=998f7ba061f498ff16d542409ffe8926671d92ea Networker: more verbose INFO-logging about what we do / did with files. --- diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index 900292e95..02dbcabb2 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -628,7 +628,7 @@ void network_process_file(char *filename, long msgend = (-1L); long msgcur = 0L; int ch; - + int nMessages = 0; fp = fopen(filename, "rb"); if (fp == NULL) { @@ -657,6 +657,7 @@ void network_process_file(char *filename, } ++msgcur; + nMessages ++; } msgend = msgcur - 1; @@ -667,8 +668,15 @@ void network_process_file(char *filename, working_ignetcfg, the_netmap, netmap_changed); + nMessages ++; } + if (nMessages > 0) + QN_syslog(LOG_INFO, + "network: processed %d messages in %s\n", + nMessages, + filename); + fclose(fp); unlink(filename); } diff --git a/citadel/modules/networkclient/serv_networkclient.c b/citadel/modules/networkclient/serv_networkclient.c index cc4ac6260..5d6a6e2dc 100644 --- a/citadel/modules/networkclient/serv_networkclient.c +++ b/citadel/modules/networkclient/serv_networkclient.c @@ -327,10 +327,20 @@ eNextState NWC_ReadNDOPReply(AsyncNetworker *NW) NWC_DBG_READ(); if (ChrPtr(NW->IO.IOBuf)[0] == '2') { + int LogLevel = LOG_DEBUG; NW->IO.IOB.TotalSentAlready = 0; + TotalSendSize = atol (ChrPtr(NW->IO.IOBuf) + 4); - EVN_syslog(LOG_DEBUG, "Expecting to transfer %d bytes\n", TotalSendSize); + + if (TotalSendSize > 0) + LogLevel = LOG_INFO; + + EVN_syslog(LogLevel, + "Expecting to transfer %d bytes to %s\n", + TotalSendSize, + ChrPtr(NW->tempFileName)); + if (TotalSendSize <= 0) { NW->State = eNUOP - 1; } @@ -434,7 +444,13 @@ eNextState NWC_ReadREADBlob(AsyncNetworker *NW) ChrPtr(NW->SpoolFileName), strerror(errno)); } - + else { + EVN_syslog(LOG_INFO, + "moved %s to %s\n", + ChrPtr(NW->tempFileName), + ChrPtr(NW->SpoolFileName)); + } + unlink(ChrPtr(NW->tempFileName)); rc = NWC_DispatchWriteDone(&NW->IO); NW->State --; @@ -464,6 +480,12 @@ eNextState NWC_ReadREADBlobDone(AsyncNetworker *NW) ChrPtr(NW->SpoolFileName), strerror(errno)); } + else { + EVN_syslog(LOG_INFO, + "moved %s to %s\n", + ChrPtr(NW->tempFileName), + ChrPtr(NW->SpoolFileName)); + } unlink(ChrPtr(NW->tempFileName)); rc = NWC_DispatchWriteDone(&NW->IO); @@ -542,6 +564,14 @@ eNextState NWC_SendNUOP(AsyncNetworker *NW) if (fd > 0) close(fd); return rc; } + else + { + EVN_syslog(LOG_INFO, + "sending %s to %s\n", + ChrPtr(NW->SpoolFileName), + ChrPtr(NW->node)); + } + FDIOBufferInit(&NW->IO.IOB, &NW->IO.SendBuf, fd, TotalSendSize); StrBufPlain(NW->IO.SendBuf.Buf, HKEY("NUOP\n")); @@ -618,7 +648,12 @@ eNextState NWC_ReadUCLS(AsyncNetworker *NW) AsyncIO *IO = &NW->IO; NWC_DBG_READ(); - EVN_syslog(LOG_NOTICE, "Sent %ld octets to <%s>\n", NW->IO.IOB.ChunkSize, ChrPtr(NW->node)); + EVN_syslog(LOG_NOTICE, + "Sent %s [%ld] octets to <%s>\n", + ChrPtr(NW->SpoolFileName), + NW->IO.IOB.ChunkSize, + ChrPtr(NW->node)); + if (ChrPtr(NW->IO.IOBuf)[0] == '2') { EVN_syslog(LOG_DEBUG, "Removing <%s>\n", ChrPtr(NW->SpoolFileName)); unlink(ChrPtr(NW->SpoolFileName));