Networker: more verbose INFO-logging about what we do / did with files.
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 17 Aug 2013 19:05:36 +0000 (21:05 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 17 Aug 2013 19:05:36 +0000 (21:05 +0200)
citadel/modules/network/serv_netspool.c
citadel/modules/networkclient/serv_networkclient.c

index 900292e95e7279a58f81abf48041f08b8afbe230..02dbcabb23f3f7664b95a45f63ca001daf57a1fe 100644 (file)
@@ -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);
 }
index cc4ac6260a42504ebdbc84e275aa26f13e97213b..5d6a6e2dc99a39d438220856b56701bf5de588e3 100644 (file)
@@ -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));