#include "FwdState.h"
#include "HttpReply.h"
#include "HttpRequest.h"
-#include "HttpRequest.h"
#include "SquidConfig.h"
#include "StatCounters.h"
#include "Store.h"
class WhoisState
{
-
public:
- ~WhoisState();
void readReply(const Comm::ConnectionPointer &, char *aBuffer, size_t aBufferLength, comm_err_t flag, int xerrno);
void setReplyToOK(StoreEntry *sentry);
StoreEntry *entry;
- HttpRequest *request;
+ HttpRequest::Pointer request;
FwdState::Pointer fwd;
char buf[BUFSIZ+1]; /* readReply adds terminating NULL */
bool dataWritten;
+
+private:
+ CBDATA_CLASS2(WhoisState);
};
+CBDATA_CLASS_INIT(WhoisState);
+
static CLCB whoisClose;
static CTCB whoisTimeout;
static IOCB whoisReadReply;
/* PUBLIC */
-CBDATA_TYPE(WhoisState);
-
-WhoisState::~WhoisState()
-{
- fwd = NULL; // refcounted
-}
-
static void
whoisWriteComplete(const Comm::ConnectionPointer &, char *buf, size_t size, comm_err_t flag, int xerrno, void *data)
{
void
whoisStart(FwdState * fwd)
{
- WhoisState *p;
char *buf;
size_t l;
- CBDATA_INIT_TYPE(WhoisState);
- p = cbdataAlloc(WhoisState);
+ WhoisState *p = new WhoisState;
p->request = fwd->request;
p->entry = fwd->entry;
p->fwd = fwd;
WhoisState *p = (WhoisState *)params.data;
debugs(75, 3, "whoisClose: FD " << params.fd);
p->entry->unlock();
- cbdataFree(p);
+ delete p;
}