]> Pileus Git - ~andy/fetchmail/commitdiff
George Sipe's fix.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 1 Apr 1997 04:05:05 +0000 (04:05 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 1 Apr 1997 04:05:05 +0000 (04:05 -0000)
svn path=/trunk/; revision=934

NEWS
interface.c

diff --git a/NEWS b/NEWS
index 32d386480843477bd7086a8efca466ede74401eb..6d1c92879e45f467f372f7d7ba1a225bb97f0f73 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,15 @@ happens when you try that?)
 (But fetchmail -V reports the timeout option set correctly.  Are server
 timeouts really broken?  We must find a way to test this.)
 
+                               Heads-up!
+
+The .poprc compatibility hack that allows your first user declaration
+per server to omit the "username" keyword. has been causing some
+confusion (see question F3 in the FAQ for details).  Use of the
+feature now generates a warning to standard error.  In a future
+release, probably 4.0, this hack will be removed and the leading
+`username' token required for every user entry.
+
                        Release Notes:
 
 ------------------------------------------------------------------------------
@@ -47,7 +56,11 @@ features --
 
 * -U option to force UIDL use under POP3 (thanks, Ingmar Baumgart).
 
-There are 249 people on the fetchmail-friends list.
+bugs -- 
+
+* George Sipe sent a fix for the --monitor code.
+
+There are 261 people on the fetchmail-friends list.
 
 ------------------------------------------------------------------------------
 fetchmail-3.8 (Fri Mar  7 17:34:02 EST 1997)
@@ -123,13 +136,6 @@ There are 229 people on the fetchmail-friends list.
 ------------------------------------------------------------------------------
 fetchmail-3.5 (Sat Feb 15 15:19:36 EST 1997)
 
-Note: The .poprc compatibility hack that allows your first user declaration
-per server to omit the "username" keyword. has been causing some confusion (see
-question F3 in the FAQ for details).  Use of the feature now generates a 
-warning to standard error.  In a future release, probably 4.0, this hack
-will be removed and the leading `username' token required for every user
-entry.
-
 features --
 
 * The host that ETRN specifies is now set by the smtphost option.
@@ -139,6 +145,8 @@ features --
 
 * Major FAQ reorganization and additions.
 
+* .poprc-style `user'-less entry now triggers a warning.
+
 bugs --
 
 * The counter referred to by the batchlimit option used to count not only 
index 368eb2501f19e033a38b594507df0b6e51d8ed3a..1dbc7d39b2b650e953e2090dc93c30133ade9ba1 100644 (file)
@@ -13,6 +13,7 @@
 
 #ifdef linux
 
+#include <config.h>
 #include <stdio.h>
 #include <string.h>
 #if defined(STDC_HEADERS)
@@ -94,7 +95,7 @@ static int get_ifinfo(const char *ifname, ifinfo_t *ifinfo)
        int result;
 
        if (socket_fd < 0 || !stats_file)
-               result = -1;
+               result = FALSE;
        else
                result = _get_ifinfo_(socket_fd, stats_file, ifname, ifinfo);
        if (socket_fd >= 0)
@@ -137,6 +138,7 @@ void interface_note_activity(struct hostdata *hp)
 /* save interface I/O counts */
 {
        ifinfo_t ifinfo;
+       struct query *ctl;
 
        /* if not monitoring link, all done */
        if (!hp->monitor)
@@ -144,11 +146,22 @@ void interface_note_activity(struct hostdata *hp)
 
        /* get the current I/O stats for the monitored link */
        if (get_ifinfo(hp->monitor, &ifinfo))
-               hp->monitor_io = ifinfo.rx_packets + ifinfo.tx_packets;
+               /* update this and preceeding host entries using the link
+                  (they were already set during this pass but the I/O
+                  count has now changed and they need to be re-updated)
+               */
+               for (ctl = querylist; ctl; ctl = ctl->next) {
+                       if (!strcmp(hp->monitor, ctl->server.monitor))
+                               ctl->server.monitor_io =
+                                       ifinfo.rx_packets + ifinfo.tx_packets;
+                       /* do NOT update host entries following this one */
+                       if (&ctl->server == hp)
+                               break;
+               }
 
 #ifdef ACTIVITY_DEBUG
        (void) error(0, 0, "activity on %s -noted- as %d", 
-               hp->names->id, hp->monitor_io);
+               hp->monitor, hp->monitor_io);
 #endif
 }
 
@@ -182,7 +195,7 @@ int interface_approve(struct hostdata *hp)
 
 #ifdef ACTIVITY_DEBUG
        (void) error(0, 0, "activity on %s checked as %d", 
-               hp->names->id, hp->monitor_io);
+               hp->monitor, hp->monitor_io);
 #endif
        /* if monitoring, check link for activity if it is up */
        if (get_ifinfo(hp->monitor, &ifinfo) &&