/*
- * $Id: neighbors.cc,v 1.285 2000/10/04 01:13:25 wessels Exp $
+ * $Id: neighbors.cc,v 1.286 2000/10/10 02:10:42 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
neighborIgnoreNonPeer(const struct sockaddr_in *from, icp_opcode opcode)
{
peer *np;
- double x;
for (np = non_peers; np; np = np->next) {
if (np->in_addr.sin_addr.s_addr != from->sin_addr.s_addr)
continue;
np->next = non_peers;
non_peers = np;
}
- np->stats.ignored_replies++;
np->icp.counts[opcode]++;
- x = log(np->stats.ignored_replies) / log(10.0);
- if (0.0 != x - (double) (int) x)
- return;
- debug(15, 1) ("WARNING: Ignored %d replies from non-peer %s\n",
- np->stats.ignored_replies, np->host);
+ if (isPowTen(++np->stats.ignored_replies))
+ debug(15, 1) ("WARNING: Ignored %d replies from non-peer %s\n",
+ np->stats.ignored_replies, np->host);
}
/* ignoreMulticastReply
/*
- * $Id: protos.h,v 1.380 2000/10/04 15:32:13 wessels Exp $
+ * $Id: protos.h,v 1.381 2000/10/10 02:10:42 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern void linklistPush(link_list **, void *);
extern void *linklistShift(link_list **);
extern int xrename(const char *from, const char *to);
+extern int isPowTen(int);
#if USE_HTCP
extern void htcpInit(void);
/*
- * $Id: store_client.cc,v 1.96 2000/10/09 18:37:10 wessels Exp $
+ * $Id: store_client.cc,v 1.97 2000/10/10 02:10:43 wessels Exp $
*
* DEBUG: section 20 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
static void
storeClientReadHeader(void *data, const char *buf, ssize_t len)
{
+ static int md5_mismatches = 0;
store_client *sc = data;
StoreEntry *e = sc->entry;
MemObject *mem = e->mem_obj;
assert(t->length == MD5_DIGEST_CHARS);
if (!EBIT_TEST(e->flags, KEY_PRIVATE) &&
memcmp(t->value, e->key, MD5_DIGEST_CHARS)) {
- debug(20, 1) ("WARNING: swapin MD5 mismatch\n");
- debug(20, 1) ("\t%s\n", storeKeyText(t->value));
- debug(20, 1) ("\t%s\n", storeKeyText(e->key));
+ debug(20, 2) ("storeClientReadHeader: swapin MD5 mismatch\n");
+ debug(20, 2) ("\t%s\n", storeKeyText(t->value));
+ debug(20, 2) ("\t%s\n", storeKeyText(e->key));
+ if (isPowTen(++md5_mismatches))
+ debug(20, 1) ("WARNING: %d swapin MD5 mismatches\n",
+ md5_mismatches);
swap_object_ok = 0;
}
break;
/*
- * $Id: tools.cc,v 1.195 2000/09/16 21:47:46 hno Exp $
+ * $Id: tools.cc,v 1.196 2000/10/10 02:10:43 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
}
return 0;
}
+
+/*
+ * isPowTen returns true if its argument is an integer power of
+ * 10. Its used for logging of certain error messages that can
+ * occur often, but that we don't want to fill cache.log with.
+ */
+int
+isPowTen(int count)
+{
+ double x = log(count) / log(10.0);
+ if (0.0 != x - (double) (int) x)
+ return 0;
+ return 1;
+}