technique.
Also added locks for HttpReply in ICAPAccessCheck::ICAPAccessCheck()
/*
- * $Id: ICAPConfig.cc,v 1.4 2005/12/02 19:43:38 wessels Exp $
+ * $Id: ICAPConfig.cc,v 1.5 2006/01/23 21:36:07 wessels Exp $
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
* ----------------------------------------------------------
#include "ICAPConfig.h"
#include "ICAPServiceRep.h"
#include "HttpRequest.h"
+#include "HttpReply.h"
#include "ACLChecklist.h"
ICAPConfig TheICAPConfig;
{
method = aMethod;
point = aPoint;
- req = requestLink(aReq);
- rep = aRep;
+
+ req = aReq->lock()
+
+ ;
+ rep = aRep ? aRep->lock()
+ : NULL;
+
callback = aCallback;
+
callback_data = aCallbackData;
+
candidateClasses.clean();
+
matchedClass.clean();
+
acl_checklist = NULL;
+
debug(93,5)("ICAPAccessCheck constructed for %s %s\n",
ICAP::methodStr(method),
ICAP::vectPointStr(point));
ICAPAccessCheck::~ICAPAccessCheck()
{
- requestUnlink(req);
+ if (req)
+ req->unlock();
+
+ if (rep)
+ rep->unlock();
}
/*
packHead(httpBuf, oldHead);
// allocate the adapted message
- HttpMsg *&newHead = adapted->data->header;
- Must(!newHead);
+ Must(!adapted->data->header);
+ HttpMsg *newHead = NULL;
if (dynamic_cast<const HttpRequest*>(oldHead))
newHead = new HttpRequest;
Must(newHead);
+ adapted->data->setHeader(newHead);
+
// parse the buffer back
http_status error = HTTP_STATUS_NONE;
/*
- * $Id: MsgPipeData.h,v 1.5 2006/01/23 20:04:25 wessels Exp $
+ * $Id: MsgPipeData.h,v 1.6 2006/01/23 21:36:07 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
void setCause(HttpRequest *r)
{
+ clearCause();
cause = r->lock()
private:
- void clearCause() { cause->unlock(); cause = NULL; };
+ void clearCause() { if (cause) { cause->unlock(); cause = NULL; } };
- void clearHeader() { header->unlock(); header = NULL; };
+ void clearHeader() { if (header) { header->unlock(); header = NULL; } };
};
#endif /* SQUID_MSGPIPEDATA_H */