/*
- * $Id: neighbors.cc,v 1.264 1998/12/05 00:54:33 wessels Exp $
+ * $Id: neighbors.cc,v 1.265 1998/12/15 23:51:19 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
}
safe_free(p->host);
#if USE_CACHE_DIGESTS
- if (p->digest) {
- if (cbdataValid(p->digest))
- peerDigestNotePeerGone(p->digest);
+ if (p->digest)
cbdataUnlock(p->digest);
- p->digest = NULL;
- }
+ p->digest = NULL;
#endif
xfree(p);
}
{
#if USE_CACHE_DIGESTS
if (p->digest) {
- cbdataUnlock(p->digest);
+ PeerDigest *pd = p->digest;
p->digest = NULL;
+ cbdataUnlock(pd);
}
#endif
}
/*
- * $Id: peer_digest.cc,v 1.64 1998/12/14 23:45:15 rousskov Exp $
+ * $Id: peer_digest.cc,v 1.65 1998/12/15 23:51:20 wessels Exp $
*
* DEBUG: section 72 Peer Digest Routines
* AUTHOR: Alex Rousskov
void
peerDigestDestroy(PeerDigest * pd)
{
+ peer *p;
assert(pd);
assert(cbdataValid(pd));
- /* inform peer (if any) that we are gone */
- if (cbdataValid(pd->peer))
- peerNoteDigestGone(pd->peer);
- cbdataUnlock(pd->peer); /* must unlock, valid or not */
+ p = pd->peer;
pd->peer = NULL;
+ /* inform peer (if any) that we are gone */
+ if (cbdataValid(p))
+ peerNoteDigestGone(p);
+ cbdataUnlock(p); /* must unlock, valid or not */
peerDigestClean(pd);
cbdataFree(pd);