/*
- * $Id: CommRead.h,v 1.5 2003/07/10 09:37:56 robertc Exp $
+ * $Id: CommRead.h,v 1.6 2004/02/18 01:58:59 adrian Exp $
*
* DEBUG: section 5 Comms
* AUTHOR: Robert Collins <robertc@squid-cache.org>
return *this;
}
+ bool dataValid()
+ {
+ return cbdataReferenceValid(data);
+ }
bool operator == (CallBack const &rhs) { return handler==rhs.handler && data==rhs.data;}
/*
- * $Id: comm.cc,v 1.391 2003/10/20 12:33:01 robertc Exp $
+ * $Id: comm.cc,v 1.392 2004/02/18 01:58:59 adrian Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
cs->fd = fd;
cs->host = xstrdup(host);
cs->port = port;
- cs->callback = CallBack<CNCB>(callback,cbdataReference(data));
+ cs->callback = CallBack<CNCB>(callback, data);
comm_add_close_handler(fd, commConnectFree, cs);
cs->locks++;
ipcache_nbgethostbyname(host, commConnectDnsHandle, cs);
callback = CallBack<CNCB>();
commSetTimeout(fd, -1, NULL, NULL);
- if (cbdataReferenceValid(aCallback.data))
+ if (aCallback.dataValid())
aCallback.handler(fd, status, xerrno, aCallback.data);
- cbdataReferenceDone(aCallback.data);
-
commConnectFree(fd, this);
}
{
ConnectStateData *cs = (ConnectStateData *)data;
debug(5, 3) ("commConnectFree: FD %d\n", fd);
- cbdataReferenceDone(cs->callback.data);
+ cs->callback = CallBack<CNCB>();
safe_free(cs->host);
delete cs;
}