From: wessels <> Date: Fri, 24 Apr 1998 01:29:12 +0000 (+0000) Subject: Changed peerCheckConnect() to use cbdata instead of flag to know X-Git-Tag: SQUID_3_0_PRE1~3450 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90e675a603e17f8f2a116f8e8cfd3af90b6aedb6;p=thirdparty%2Fsquid.git Changed peerCheckConnect() to use cbdata instead of flag to know when to delete events --- diff --git a/src/neighbors.cc b/src/neighbors.cc index bc5fcd9e53..91a6655b7f 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.198 1998/04/22 16:24:15 rousskov Exp $ + * $Id: neighbors.cc,v 1.199 1998/04/23 19:29:12 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -887,8 +887,6 @@ peerDestroy(peer * p) struct _domain_ping *nl = NULL; if (p == NULL) return; - if (p->ck_conn_event_pend) - eventDelete(peerCheckConnect, p); if (p->type == PEER_MULTICAST) { if (p->mcast.flags & PEER_COUNT_EVENT_PENDING) eventDelete(peerCountMcastPeersStart, p); @@ -959,9 +957,10 @@ peerCheckConnect(void *data) { peer *p = data; int fd; - if (p->ck_conn_event_pend != 1) - debug_trap("bad ck_conn_event_pend counter"); - p->ck_conn_event_pend--; + int valid = cbdataValid(p); + cbdataUnlock(p); + if (!valid) + return; fd = comm_open(SOCK_STREAM, 0, Config.Addrs.tcp_outgoing, 0, COMM_NONBLOCKING, p->host); if (fd < 0) @@ -990,7 +989,7 @@ peerCheckConnectDone(int fd, int status, void *data) debug(15, 0) ("TCP connection to %s/%d succeeded\n", p->host, p->http_port); } else { - p->ck_conn_event_pend++; + cbdataLock(p); eventAdd("peerCheckConnect", peerCheckConnect, p, 80); } comm_close(fd); @@ -1005,7 +1004,7 @@ peerCheckConnectStart(peer * p) debug(15, 0) ("TCP connection to %s/%d failed\n", p->host, p->http_port); p->tcp_up = 0; p->last_fail_time = squid_curtime; - p->ck_conn_event_pend++; + cbdataLock(p); eventAdd("peerCheckConnect", peerCheckConnect, p, 80); } diff --git a/src/structs.h b/src/structs.h index 112e68f85a..08368059b3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -874,7 +874,6 @@ struct _peer { int n_addresses; int rr_count; peer *next; - int ck_conn_event_pend; int test_fd; };