/*
- * $Id: neighbors.cc,v 1.178 1998/03/05 08:33:42 wessels Exp $
+ * $Id: neighbors.cc,v 1.179 1998/03/06 22:53:07 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
void *callback_data,
int *exprep)
{
- char *host = request->host;
const char *url = storeUrl(entry);
MemObject *mem = entry->mem_obj;
- const ipcache_addrs *ia = NULL;
- struct sockaddr_in to_addr;
peer *p = NULL;
int i;
int reqnum = 0;
if ((first_ping = first_ping->next) == NULL)
first_ping = Config.peers;
+#if ALLOW_SOURCE_PING
/* only do source_ping if we have neighbors */
if (Config.npeers) {
+ const ipcache_addrs *ia = NULL;
+ struct sockaddr_in to_addr;
+ char *host = request->host;
if (!Config.onoff.source_ping) {
debug(15, 6) ("neighborsUdpPing: Source Ping is disabled.\n");
} else if ((ia = ipcache_gethostbyname(host, 0))) {
host);
}
}
+#endif
#if LOG_ICP_NUMBERS
request->hierarchy.n_sent = peers_pinged;
request->hierarchy.n_expect = *exprep;
if (p) {
debug(15, 1) ("Ignoring SECHO from neighbor %s\n", p->host);
neighborCountIgnored(p, opcode);
- } else if (!Config.onoff.source_ping) {
- debug(15, 1) ("Unsolicited SECHO from %s\n", inet_ntoa(from->sin_addr));
- } else {
+#if ALLOW_SOURCE_PING
+ } else if (Config.onoff.source_ping) {
mem->icp_reply_callback(NULL, ntype, header, mem->ircb_data);
+#endif
+ } else {
+ debug(15, 1) ("Unsolicited SECHO from %s\n", inet_ntoa(from->sin_addr));
}
} else if (opcode == ICP_DENIED) {
if (p == NULL) {
/*
- * $Id: peer_select.cc,v 1.39 1998/03/05 08:28:01 wessels Exp $
+ * $Id: peer_select.cc,v 1.40 1998/03/06 22:53:06 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
assert(direct != DIRECT_YES);
if (!EBIT_TEST(entry->flag, HIERARCHICAL) && direct != DIRECT_NO)
return 0;
- if (Config.onoff.single_parent_bypass && !Config.onoff.source_ping)
- if (getSingleParent(request))
- return 0;
+ if (Config.onoff.single_parent_bypass)
+#if ALLOW_SOURCE_PING
+ if (!Config.onoff.source_ping)
+#endif
+ if (getSingleParent(request))
+ return 0;
if (EBIT_TEST(entry->flag, KEY_PRIVATE) && !neighbors_do_private_keys)
if (direct != DIRECT_NO)
return 0;