/*
- * $Id: icmp.cc,v 1.66 1998/09/23 17:09:43 wessels Exp $
+ * $Id: icmp.cc,v 1.67 1998/11/13 20:50:51 wessels Exp $
*
* DEBUG: section 37 ICMP Routines
* AUTHOR: Duane Wessels
#if USE_ICMP
#define S_ICMP_ECHO 1
+#if ALLOW_SOURCE_PING
#define S_ICMP_ICP 2
+#endif
#define S_ICMP_DOM 3
static PF icmpRecv;
static void icmpSend(pingerEchoData * pkt, int len);
+#if ALLOW_SOURCE_PING
static void icmpHandleSourcePing(const struct sockaddr_in *from, const char *buf);
+#endif
static void
icmpSendEcho(struct in_addr to, int opcode, const char *payload, int len)
switch (preply.opcode) {
case S_ICMP_ECHO:
break;
+#if ALLOW_SOURCE_PING
case S_ICMP_ICP:
icmpHandleSourcePing(&F, preply.payload);
break;
+#endif
case S_ICMP_DOM:
netdbHandlePingReply(&F, preply.hops, preply.rtt);
break;
}
}
+#if ALLOW_SOURCE_PING
static void
icmpHandleSourcePing(const struct sockaddr_in *from, const char *buf)
{
/* call neighborsUdpAck even if ping_status != PING_WAITING */
neighborsUdpAck(key, &header, from);
}
+#endif
#endif /* USE_ICMP */
#endif
}
+#if ALLOW_SOURCE_PING
void
icmpSourcePing(struct in_addr to, const icp_common_t * header, const char *url)
{
memFree(MEM_8K_BUF, payload);
#endif
}
+#endif
void
icmpDomainPing(struct in_addr to, const char *domain)
/*
- * $Id: neighbors.cc,v 1.259 1998/11/12 06:28:16 wessels Exp $
+ * $Id: neighbors.cc,v 1.260 1998/11/13 20:50:52 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
return;
}
if (entry->ping_status != PING_WAITING) {
- debug(15, 2) ("neighborsUdpAck: Unexpected %s for %s\n",
+ debug(15, 2) ("neighborsUdpAck: Late %s for %s\n",
opcode_d, storeKeyText(key));
neighborCountIgnored(p);
return;
/*
- * $Id: net_db.cc,v 1.132 1998/11/12 06:28:17 wessels Exp $
+ * $Id: net_db.cc,v 1.133 1998/11/13 20:50:53 wessels Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
na->link_count++;
n = na;
}
- debug(38, 3) ("netdbSendPing: pinging %s\n", hostname);
- icmpDomainPing(addr, hostname);
- n->pings_sent++;
- n->next_ping_time = squid_curtime + Config.Netdb.period;
- n->last_use_time = squid_curtime;
+ if (n->next_ping_time <= squid_curtime) {
+ debug(38, 3) ("netdbSendPing: pinging %s\n", hostname);
+ icmpDomainPing(addr, hostname);
+ n->pings_sent++;
+ n->next_ping_time = squid_curtime + Config.Netdb.period;
+ n->last_use_time = squid_curtime;
+ }
cbdataFree(hostname);
}
/*
- * $Id: pinger.cc,v 1.37 1998/08/18 19:14:06 wessels Exp $
+ * $Id: pinger.cc,v 1.38 1998/11/13 20:50:54 wessels Exp $
*
* DEBUG: section 42 ICMP Pinger program
* AUTHOR: Duane Wessels
#define ip_dst daddr
#endif
+#if ALLOW_SOURCE_PING
#define MAX_PKT_SZ 8192
#define MAX_PAYLOAD (MAX_PKT_SZ - sizeof(struct icmphdr) - sizeof (char) - sizeof(struct timeval) - 1)
+#else
+#define MAX_PAYLOAD (sizeof(struct icmphdr) + sizeof (char) + sizeof(struct timeval) + 1)
+#define MAX_PKT_SZ MAX_PAYLOAD
+#endif
typedef struct {
struct timeval tv;
S.sin_family = AF_INET;
S.sin_addr = to;
S.sin_port = 0;
+ assert(icmp_pktsize <= MAX_PKT_SZ);
sendto(icmp_sock,
pkt,
icmp_pktsize,
/*
- * $Id: protos.h,v 1.287 1998/11/13 06:00:31 wessels Exp $
+ * $Id: protos.h,v 1.288 1998/11/13 20:50:55 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern const cache_key *storeKeyScan(const char *);
extern const char *storeKeyText(const cache_key *);
extern const cache_key *storeKeyPublic(const char *, const method_t);
-extern const cache_key *storeKeyPublicOld(const char *, method_t);
extern const cache_key *storeKeyPrivate(const char *, method_t, int);
extern int storeKeyHashBuckets(int);
extern int storeKeyNull(const cache_key *);
/*
- * $Id: refresh.cc,v 1.44 1998/11/12 06:28:23 wessels Exp $
+ * $Id: refresh.cc,v 1.45 1998/11/13 20:50:56 wessels Exp $
*
* DEBUG: section 22 Refresh Calculation
* AUTHOR: Harvest Derived
int request_max_age_stale;
int request_reload2ims_stale;
int request_reload_stale;
+ int negative_age_stale;
int min_age_override_exp_fresh;
int min_age_override_lmt_fresh;
int response_expires_stale;
}
}
#endif
+ if (age < 0) {
+ debug(22, 3) ("refreshCheck: YES: age < 0\n");
+ rc->negative_age_stale++;
+ return 1;
+ }
if (request->max_age > -1) {
if (age > request->max_age) {
debug(22, 3) ("refreshCheck: YES: age > client-max-age\n");
/*
- * $Id: store.cc,v 1.470 1998/11/12 06:28:27 wessels Exp $
+ * $Id: store.cc,v 1.471 1998/11/13 20:50:57 wessels Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
StoreEntry *
storeGetPublic(const char *uri, const method_t method)
{
- const cache_key *key;
- StoreEntry *e;
- key = storeKeyPublic(uri, method);
- e = storeGet(key);
- if (e == NULL && squid_curtime < 909000000) {
- key = storeKeyPublicOld(uri, method);
- e = storeGet(key);
- }
- return e;
+ return storeGet(storeKeyPublic(uri, method));
}
static int
/*
- * $Id: store_key_md5.cc,v 1.17 1998/09/21 06:52:23 wessels Exp $
+ * $Id: store_key_md5.cc,v 1.18 1998/11/13 20:50:58 wessels Exp $
*
* DEBUG: section 20 Storage Manager MD5 Cache Keys
* AUTHOR: Duane Wessels
return digest;
}
-/*
- * Compatibility transition period. Remove this after Oct 21, 1998
- */
-const cache_key *
-storeKeyPublicOld(const char *url, method_t method)
-{
- static cache_key digest[MD5_DIGEST_CHARS];
- MD5_CTX M;
- int n;
- char key_buf[MAX_URL + 100];
- n = snprintf(key_buf, sizeof(key_buf), "%s %s",
- RequestMethodStr[method],
- url);
- MD5Init(&M);
- MD5Update(&M, (unsigned char *) key_buf, n);
- MD5Final(digest, &M);
- return digest;
-}
-
const cache_key *
storeKeyDup(const cache_key * key)
{