with HTTPMSGLOCK() and HTTPMSGUNLOCK() macros.
/*
- * $Id: ACLChecklist.cc,v 1.29 2005/12/08 20:08:46 wessels Exp $
+ * $Id: ACLChecklist.cc,v 1.30 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
if (extacl_entry)
cbdataReferenceDone(extacl_entry);
- if (request)
- requestUnlink(request);
-
- request = NULL;
+ HTTPMSGUNLOCK(request);
conn_ = NULL;
checklist->accessList = cbdataReference(A);
if (request != NULL) {
- checklist->request = requestLink(request);
+ checklist->request = HTTPMSGLOCK(request);
checklist->src_addr = request->client_addr;
checklist->my_addr = request->my_addr;
checklist->my_port = request->my_port;
ClientBody::ClientBody(ConnStateData::Pointer & aConn, HttpRequest *Request) : conn(aConn), request(NULL), buf (NULL), bufsize(0), callback(NULL), cbdata(NULL)
{
- request = requestLink(Request);
+ request = HTTPMSGLOCK(Request);
}
ClientBody::~ClientBody()
if (cbdata)
cbdataReferenceDone(cbdata);
- requestUnlink(request);
+ HTTPMSGUNLOCK(request);
conn = NULL; // refcounted
}
/*
- * $Id: DelayId.cc,v 1.18 2005/12/08 20:08:46 wessels Exp $
+ * $Id: DelayId.cc,v 1.19 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 77 Delay Pools
* AUTHOR: Robert Collins <robertc@squid-cache.org>
if (http->getConn().getRaw() != NULL)
ch.conn(http->getConn());
- ch.request = requestLink(r);
+ ch.request = HTTPMSGLOCK(r);
ch.accessList = cbdataReference(DelayPools::delay_data[pool].access);
/*
- * $Id: HttpMsg.cc,v 1.24 2006/01/23 20:04:24 wessels Exp $
+ * $Id: HttpMsg.cc,v 1.25 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 74 HTTP Message
* AUTHOR: Alex Rousskov
HttpMsg *
-HttpMsg::lock()
+// use HTTPMSGLOCK() instead of calling this directly
+HttpMsg::_lock()
{
lock_count++;
return this;
}
+// use HTTPMSGUNLOCK() instead of calling this directly
void
-HttpMsg::unlock()
+HttpMsg::_unlock()
{
assert(lock_count > 0);
--lock_count;
/*
- * $Id: HttpMsg.h,v 1.7 2006/01/23 20:04:24 wessels Exp $
+ * $Id: HttpMsg.h,v 1.8 2006/02/17 18:10:59 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
void packInto(Packer * p, bool full_uri) const;
- virtual HttpMsg *lock()
-
- ;
- virtual void unlock();
+ virtual HttpMsg *_lock(); // please use HTTPMSGLOCK()
+ virtual void _unlock(); // please use HTTPMSGUNLOCK()
public:
HttpVersion http_ver;
SQUIDCEXTERN int httpMsgIsolateHeaders(const char **parse_start, const char **blk_start, const char **blk_end);
+#define HTTPMSGUNLOCK(a) if(a){(a)->_unlock();(a)=NULL;}
+#define HTTPMSGLOCK(a) (a)->_lock()
+
#endif /* SQUID_HTTPMSG_H */
/*
- * $Id: HttpReply.h,v 1.15 2006/01/23 20:04:24 wessels Exp $
+ * $Id: HttpReply.h,v 1.16 2006/02/17 18:10:59 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
virtual void reset();
- virtual HttpReply *lock()
-
+ // use HTTPMSGLOCK() instead of calling this directly
+ virtual HttpReply *_lock()
{
-
- return static_cast<HttpReply*>(HttpMsg::lock())
-
- ;
- } ;
+ return static_cast<HttpReply*>(HttpMsg::_lock());
+ };
//virtual void unlock(); // only needed for debugging
/*
- * $Id: HttpRequest.cc,v 1.59 2006/01/23 20:04:24 wessels Exp $
+ * $Id: HttpRequest.cc,v 1.60 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 73 HTTP Request
* AUTHOR: Duane Wessels
return true;
}
-HttpRequest *
-requestLink(HttpRequest * request)
-{
- assert(request);
-
- return request->lock()
-
- ;
-}
-
-void
-requestUnlink(HttpRequest * request)
-{
- if (!request)
- return;
-
- request->unlock();
-}
-
int
HttpRequest::parseHeader(const char *parse_start)
{
/*
- * $Id: HttpRequest.h,v 1.18 2006/01/23 20:04:24 wessels Exp $
+ * $Id: HttpRequest.h,v 1.19 2006/02/17 18:10:59 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
#include "HierarchyLogEntry.h"
/* Http Request */
-extern HttpRequest *requestLink(HttpRequest *);
-extern void requestUnlink(HttpRequest *);
extern int httpRequestHdrAllowed(const HttpHeaderEntry * e, String * strConnection);
extern int httpRequestHdrAllowedByName(http_hdr_type id);
extern void httpRequestPack(void *obj, Packer *p);
~HttpRequest();
virtual void reset();
- virtual HttpRequest *lock()
-
+ // use HTTPMSGLOCK() instead of calling this directly
+ virtual HttpRequest *_lock()
{
-
- return static_cast<HttpRequest*>(HttpMsg::lock())
-
- ;
+ return static_cast<HttpRequest*>(HttpMsg::_lock());
};
void initHTTP(method_t aMethod, protocol_t aProtocol, const char *aUrlpath);
/*
- * $Id: ICAPConfig.cc,v 1.5 2006/01/23 21:36:07 wessels Exp $
+ * $Id: ICAPConfig.cc,v 1.6 2006/02/17 18:11:00 wessels Exp $
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
* ----------------------------------------------------------
method = aMethod;
point = aPoint;
- req = aReq->lock()
-
- ;
- rep = aRep ? aRep->lock()
- : NULL;
+ req = HTTPMSGLOCK(aReq);
+ rep = aRep ? HTTPMSGLOCK(aRep) : NULL;
callback = aCallback;
ICAPAccessCheck::~ICAPAccessCheck()
{
- if (req)
- req->unlock();
-
- if (rep)
- rep->unlock();
+ HTTPMSGUNLOCK(req);
+ HTTPMSGUNLOCK(rep);
}
/*
/*
- * $Id: MsgPipeData.h,v 1.6 2006/01/23 21:36:07 wessels Exp $
+ * $Id: MsgPipeData.h,v 1.7 2006/02/17 18:11:00 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
~MsgPipeData()
{
- clearCause();
- clearHeader();
+ HTTPMSGUNLOCK(cause);
+ HTTPMSGUNLOCK(header);
if (body) {
body->clean();
void setCause(HttpRequest *r)
{
- clearCause();
-
- cause = r->lock()
-
- ;
+ HTTPMSGUNLOCK(cause);
+ cause = HTTPMSGLOCK(r);
};
void setHeader(HttpMsg *msg)
{
- clearHeader();
-
- header = msg->lock()
-
- ;
+ HTTPMSGUNLOCK(header);
+ header = HTTPMSGLOCK(msg);
};
public:
// HTTP request header for piped responses (the cause of the response)
HttpRequest *cause;
-private:
-
- void clearCause() { if (cause) { cause->unlock(); cause = NULL; } };
-
- void clearHeader() { if (header) { header->unlock(); header = NULL; } };
};
#endif /* SQUID_MSGPIPEDATA_H */
/*
- * $Id: MemObject.cc,v 1.21 2006/01/23 20:04:24 wessels Exp $
+ * $Id: MemObject.cc,v 1.22 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 19 Store Memory Primitives
* AUTHOR: Robert Collins
debugs(20, 3, HERE << "new MemObject " << this);
HttpReply *rep = new HttpReply;
- _reply = rep->lock()
-
- ;
+ _reply = HTTPMSGLOCK(rep);
url = xstrdup(aUrl);
#if URL_CHECKSUM_DEBUG
#endif
- _reply->unlock();
-
- requestUnlink(request);
+ HTTPMSGUNLOCK(_reply);
- request = NULL;
+ HTTPMSGUNLOCK(request);
ctx_exit(ctx); /* must exit before we free mem->url */
void
MemObject::unlinkRequest()
{
- /* XXX Should we assert(request)? */
- requestUnlink(request);
- request = NULL;
+ HTTPMSGUNLOCK(request);
}
void
void
MemObject::replaceHttpReply(HttpReply *newrep)
{
- if (_reply)
- _reply->unlock();
-
- _reply = newrep->lock()
-
- ;
+ HTTPMSGUNLOCK(_reply);
+ _reply = HTTPMSGLOCK(newrep);
}
struct LowestMemReader : public unary_function<store_client, void>
/*
- * $Id: Server.cc,v 1.2 2006/01/25 19:26:14 wessels Exp $
+ * $Id: Server.cc,v 1.3 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG:
* AUTHOR: Duane Wessels
fwd = theFwdState;
entry = fwd->entry;
storeLockObject(entry);
- request = requestLink(fwd->request);
+ request = HTTPMSGLOCK(fwd->request);
}
ServerStateData::~ServerStateData()
{
storeUnlockObject(entry);
- if (request)
- request->unlock();
-
- if (reply)
- reply->unlock();
+ HTTPMSGUNLOCK(request);
+ HTTPMSGUNLOCK(reply);
fwd = NULL; // refcounted
/*
- * $Id: access_log.cc,v 1.107 2005/11/05 00:08:32 wessels Exp $
+ * $Id: access_log.cc,v 1.108 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 46 Access Log
* AUTHOR: Duane Wessels
aLogEntry->reply = NULL;
}
- if (aLogEntry->request) {
- requestUnlink(aLogEntry->request);
- aLogEntry->request = NULL;
- }
+ HTTPMSGUNLOCK(aLogEntry->request);
}
int
/*
- * $Id: asn.cc,v 1.102 2006/01/03 17:22:30 wessels Exp $
+ * $Id: asn.cc,v 1.103 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 53 AS Number handling
* AUTHOR: Duane Wessels, Kostas Anagnostakis
asState->as_number = as;
req = urlParse(METHOD_GET, asres);
assert(NULL != req);
- asState->request = requestLink(req);
+ asState->request = HTTPMSGLOCK(req);
if ((e = storeGetPublic(asres, METHOD_GET)) == NULL) {
e = storeCreateEntry(asres, asres, request_flags(), METHOD_GET);
debug(53, 3) ("asnStateFree: %s\n", storeUrl(asState->entry));
storeUnregister(asState->sc, asState->entry, asState);
storeUnlockObject(asState->entry);
- requestUnlink(asState->request);
+ HTTPMSGUNLOCK(asState->request);
cbdataFree(asState);
}
/*
- * $Id: cache_manager.cc,v 1.35 2006/01/23 20:04:24 wessels Exp $
+ * $Id: cache_manager.cc,v 1.36 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 16 Cache Manager Objects
* AUTHOR: Duane Wessels
if ((mgr = cachemgrParseUrl(storeUrl(entry))) == NULL) {
err = errorCon(ERR_INVALID_URL, HTTP_NOT_FOUND);
err->url = xstrdup(storeUrl(entry));
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
errorAppendEntry(entry, err);
entry->expires = squid_curtime;
return;
mgr->user_name ? mgr->user_name : "<unknown>",
fd_table[fd].ipaddr, mgr->action);
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
rep = errorBuildReply(err);
/*
- * $Id: client_side.cc,v 1.709 2006/01/19 22:15:18 wessels Exp $
+ * $Id: client_side.cc,v 1.710 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
checklist->reply = al.reply;
if (!Config.accessList.log || checklist->fastCheck()) {
- al.request = requestLink(request);
+ al.request = HTTPMSGLOCK(request);
accessLogLog(&al, checklist);
updateCounters();
safe_free(log_uri);
safe_free(redirect.location);
range_iter.boundary.clean();
- requestUnlink(request);
- request = NULL;
+ HTTPMSGUNLOCK(request);
if (client_stream.tail)
clientStreamAbort((clientStreamNode *)client_stream.tail->data, this);
return;
}
- http->request = requestLink(request);
+ http->request = HTTPMSGLOCK(request);
clientSetKeepaliveFlag(http);
/* Do we expect a request-body? */
/*
- * $Id: client_side_reply.cc,v 1.94 2006/01/23 20:04:24 wessels Exp $
+ * $Id: client_side_reply.cc,v 1.95 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 88 Client-side Reply Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
int unlink_request = 0;
if (old_entry->mem_obj->request == NULL) {
- old_entry->mem_obj->request = requestLink(http->memObject()->request);
+ old_entry->mem_obj->request = HTTPMSGLOCK(http->memObject()->request);
unlink_request = 1;
}
old_entry->timestamp = squid_curtime;
- if (unlink_request) {
- requestUnlink(old_entry->mem_obj->request);
- old_entry->mem_obj->request = NULL;
- }
+ HTTPMSGUNLOCK(old_entry->mem_obj->request);
}
sendClientOldEntry();
*/
if (http->request == NULL)
- http->request = requestLink(new HttpRequest(m, PROTO_NONE, null_string));
+ http->request = HTTPMSGLOCK(new HttpRequest(m, PROTO_NONE, null_string));
StoreEntry *e = storeCreateEntry(http->uri, http->log_uri, flags, m);
err->url = xstrdup(url);
if (request)
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
return err;
}
/*
- * $Id: client_side_request.cc,v 1.56 2006/01/11 21:05:50 wessels Exp $
+ * $Id: client_side_request.cc,v 1.57 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 85 Client-side Request Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
request->http_ver = http_ver;
- http->request = requestLink(request);
+ http->request = HTTPMSGLOCK(request);
/* optional - skip the access check ? */
http->calloutContext = new ClientRequestContext(http);
new_request->extacl_user = old_request->extacl_user;
new_request->extacl_passwd = old_request->extacl_passwd;
new_request->flags.proxy_keepalive = old_request->flags.proxy_keepalive;
- requestUnlink(old_request);
- http->request = requestLink(new_request);
+ HTTPMSGUNLOCK(old_request);
+ http->request = HTTPMSGLOCK(new_request);
}
/* FIXME PIPELINE: This is innacurate during pipelining */
*/
new_req->body_connection = request->body_connection;
request->body_connection = NULL;
- requestUnlink(request);
- request = requestLink(new_req);
+ HTTPMSGUNLOCK(request);
+ request = HTTPMSGLOCK(new_req);
/*
* Store the new URI for logging
*/
/*
- * $Id: errorpage.cc,v 1.206 2006/01/23 20:04:24 wessels Exp $
+ * $Id: errorpage.cc,v 1.207 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
void
errorStateFree(ErrorState * err)
{
- requestUnlink(err->request);
+ HTTPMSGUNLOCK(err->request);
safe_free(err->redirect_url);
safe_free(err->url);
safe_free(err->host);
/*
- * $Id: forward.cc,v 1.135 2006/01/09 20:44:36 wessels Exp $
+ * $Id: forward.cc,v 1.136 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 17 Request Forwarding
* AUTHOR: Duane Wessels
entry = e;
client_fd = fd;
server_fd = -1;
- request = requestLink(r);
+ request = HTTPMSGLOCK(r);
start_t = squid_curtime;
storeLockObject(e);
EBIT_SET(e->flags, ENTRY_FWD_HDR_WAIT);
serversFree(&servers);
- requestUnlink(request);
-
- request = NULL;
+ HTTPMSGUNLOCK(request);
if (err)
errorStateFree(err);
ch.src_addr = request->client_addr;
ch.my_addr = request->my_addr;
ch.my_port = request->my_port;
- ch.request = requestLink(request);
+ ch.request = HTTPMSGLOCK(request);
ch.accessList = cbdataReference(Config.accessList.miss);
/* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */
int answer = ch.fastCheck();
ErrorState *anErr = errorCon(page_id, HTTP_FORBIDDEN);
- anErr->request = requestLink(request);
+ anErr->request = HTTPMSGLOCK(request);
anErr->src_addr = request->client_addr;
* This seems like an odd place to bind mem_obj and request.
* Might want to assert that request is NULL at this point
*/
- entry->mem_obj->request = requestLink(request);
+ entry->mem_obj->request = HTTPMSGLOCK(request);
#if URL_CHECKSUM_DEBUG
entry->mem_obj->checkUrlChecksum();
if (shutting_down) {
/* more yuck */
ErrorState *anErr = errorCon(ERR_SHUTTING_DOWN, HTTP_SERVICE_UNAVAILABLE);
- anErr->request = requestLink(request);
+ anErr->request = HTTPMSGLOCK(request);
errorAppendEntry(entry, anErr); // frees anErr
return;
}
err = errorState;
if (!errorState->request)
- errorState->request = requestLink(request);
+ errorState->request = HTTPMSGLOCK(request);
}
/*
if (!err && shutting_down) {
ErrorState *anErr = errorCon(ERR_SHUTTING_DOWN, HTTP_SERVICE_UNAVAILABLE);
- anErr->request = requestLink(request);
+ anErr->request = HTTPMSGLOCK(request);
}
self = NULL; // refcounted
anErr->port = request->port;
}
- anErr->request = requestLink(request);
+ anErr->request = HTTPMSGLOCK(request);
fail(anErr);
if (fs->_peer) {
ERR_error_string(ERR_get_error(), NULL));
ErrorState *anErr = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
anErr->xerrno = errno;
- anErr->request = requestLink(request);
+ anErr->request = HTTPMSGLOCK(request);
fail(anErr);
self = NULL; // refcounted
return;
ch.src_addr = request->client_addr;
ch.my_addr = request->my_addr;
ch.my_port = request->my_port;
- ch.request = requestLink(request);
+ ch.request = HTTPMSGLOCK(request);
}
return aclMapAddr(Config.accessList.outgoing_address, &ch);
ch.src_addr = request->client_addr;
ch.my_addr = request->my_addr;
ch.my_port = request->my_port;
- ch.request = requestLink(request);
+ ch.request = HTTPMSGLOCK(request);
}
return aclMapTOS(Config.accessList.outgoing_tos, &ch);
/*
- * $Id: ftp.cc,v 1.383 2006/01/26 00:22:18 wessels Exp $
+ * $Id: ftp.cc,v 1.384 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
}
err = errorCon(err_code, http_code);
- err->request = requestLink(ftpState->request);
+ err->request = HTTPMSGLOCK(ftpState->request);
if (ftpState->old_request)
err->ftp.request = xstrdup(ftpState->old_request);
StoreEntry *e = entry;
HttpReply *newrep = new HttpReply;
- reply = newrep->lock()
-
- ;
+ reply = HTTPMSGLOCK(newrep);
if (flags.http_header_sent)
return;
FtpStateData::ftpAuthRequired(HttpRequest * request, const char *realm)
{
ErrorState *err = errorCon(ERR_CACHE_ACCESS_DENIED, HTTP_UNAUTHORIZED);
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
HttpReply *newrep = errorBuildReply(err);
errorStateFree(err);
/* add Authenticate header */
*/
ErrorState *err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
err->xerrno = errno;
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
errorAppendEntry(entry, err);
comm_close(ctrl.fd);
return;
assert (rep);
storeEntryReplaceObject(entry, rep);
- reply->unlock();
+ HTTPMSGUNLOCK(reply);
- reply = rep->lock()
-
- ;
+ reply = HTTPMSGLOCK(rep);
debug(11,5)("FtpStateData::takeAdaptedHeaders() finished\n");
}
if (entry->isEmpty()) {
ErrorState *err;
err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
- err->request = requestLink((HttpRequest *) request);
+ err->request = HTTPMSGLOCK((HttpRequest *) request);
err->xerrno = errno;
fwd->fail(err);
fwd->dontRetry(true);
/*
- * $Id: gopher.cc,v 1.192 2006/01/03 17:22:31 wessels Exp $
+ * $Id: gopher.cc,v 1.193 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
storeUnlockObject(gopherState->entry);
}
- if (gopherState->req) {
- requestUnlink(gopherState->req);
- }
+ HTTPMSGUNLOCK(gopherState->req);
gopherState->fwd = NULL; // refcounted
/*
- * $Id: http.cc,v 1.485 2006/02/08 00:16:23 wessels Exp $
+ * $Id: http.cc,v 1.486 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
fd = fwd->server_fd;
readBuf = new MemBuf;
readBuf->init(4096, SQUID_TCP_SO_RCVBUF);
- orig_request = requestLink(fwd->request);
+ orig_request = HTTPMSGLOCK(fwd->request);
if (fwd->servers)
_peer = fwd->servers->_peer; /* might be NULL */
proxy_req->flags.proxying = 1;
- requestUnlink(request);
+ HTTPMSGUNLOCK(request);
- request = requestLink(proxy_req);
+ request = HTTPMSGLOCK(proxy_req);
/*
* This NEIGHBOR_PROXY_ONLY check probably shouldn't be here.
delete readBuf;
- requestUnlink(orig_request);
-
- orig_request = NULL;
+ HTTPMSGUNLOCK(orig_request);
debugs(11,5,HERE << "HttpStateData " << this << " destroyed");
}
return;
}
- reply = newrep->lock()
-
- ;
+ reply = HTTPMSGLOCK(newrep);
debug(11, 9) ("GOT HTTP REPLY HDR:\n---------\n%s\n----------\n",
readBuf->content());
{
ACLChecklist ch;
debug(11, 5) ("httpSendRequestEntityDone: FD %d\n", fd);
- ch.request = requestLink(request);
+ ch.request = HTTPMSGLOCK(request);
if (Config.accessList.brokenPosts)
ch.accessList = cbdataReference(Config.accessList.brokenPosts);
*/
ErrorState *err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
err->xerrno = errno;
- err->request = requestLink(orig_request);
+ err->request = HTTPMSGLOCK(orig_request);
errorAppendEntry(entry, err);
comm_close(fd);
return;
assert (rep);
storeEntryReplaceObject(entry, rep);
- reply->unlock();
-
- reply = rep->lock()
+ HTTPMSGUNLOCK(reply);
- ;
+ reply = HTTPMSGLOCK(rep);
haveParsedReplyHeaders();
if (entry->isEmpty()) {
ErrorState *err;
err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
- err->request = requestLink((HttpRequest *) request);
+ err->request = HTTPMSGLOCK((HttpRequest *) request);
err->xerrno = errno;
fwd->fail( err);
fwd->dontRetry(true);
/*
- * $Id: icp_v2.cc,v 1.89 2006/01/19 18:40:28 wessels Exp $
+ * $Id: icp_v2.cc,v 1.90 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 12 Internet Cache Protocol
* AUTHOR: Duane Wessels
ACLChecklist checklist;
checklist.src_addr = from->sin_addr;
checklist.my_addr = no_addr;
- checklist.request = requestLink(icp_request);
+ checklist.request = HTTPMSGLOCK(icp_request);
checklist.accessList = cbdataReference(Config.accessList.icp);
/* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */
int result = checklist.fastCheck();
if (!icp_request)
return;
- requestLink(icp_request);
+ HTTPMSGLOCK(icp_request);
if (!icpAccessAllowed(&from, icp_request))
{
icpDenyAccess(&from, url, header.reqnum, fd);
- requestUnlink(icp_request);
+ HTTPMSGUNLOCK(icp_request);
return;
}
StoreEntry::getPublic (state, url, METHOD_GET);
- requestUnlink(icp_request);
+ HTTPMSGUNLOCK(icp_request);
}
void
/*
- * $Id: internal.cc,v 1.35 2006/01/23 20:04:24 wessels Exp $
+ * $Id: internal.cc,v 1.36 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 76 Internal Squid Object handling
* AUTHOR: Duane, Alex, Henrik
debugObj(76, 1, "internalStart: unknown request:\n",
request, (ObjPackMethod) & httpRequestPack);
err = errorCon(ERR_INVALID_REQ, HTTP_NOT_FOUND);
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
errorAppendEntry(entry, err);
}
}
/*
- * $Id: mime.cc,v 1.121 2006/01/23 20:04:24 wessels Exp $
+ * $Id: mime.cc,v 1.122 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 25 MIME Parsing
* AUTHOR: Harvest Derived
if (NULL == r)
fatal("mimeLoadIcon: cannot parse internal URL");
- e->mem_obj->request = requestLink(r);
+ e->mem_obj->request = HTTPMSGLOCK(r);
HttpReply *reply = new HttpReply;
/*
- * $Id: neighbors.cc,v 1.332 2005/12/08 20:08:47 wessels Exp $
+ * $Id: neighbors.cc,v 1.333 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
checklist.my_port = request->my_port;
- checklist.request = requestLink(request);
+ checklist.request = HTTPMSGLOCK(request);
checklist.accessList = cbdataReference(p->access);
p->mcast.flags.count_event_pending = 0;
snprintf(url, MAX_URL, "http://%s/", inet_ntoa(p->in_addr.sin_addr));
fake = storeCreateEntry(url, url, request_flags(), METHOD_GET);
+ HttpRequest *req = urlParse(METHOD_GET, url);
psstate = new ps_state;
- psstate->request = requestLink(urlParse(METHOD_GET, url));
+ psstate->request = HTTPMSGLOCK(req);
psstate->entry = fake;
psstate->callback = NULL;
psstate->callback_data = p;
psstate->ping.start = current_time;
mem = fake->mem_obj;
- mem->request = requestLink(psstate->request);
+ mem->request = HTTPMSGLOCK(psstate->request);
mem->start_ping = current_time;
mem->ping_reply_callback = peerCountHandleIcpReply;
mem->ircb_data = psstate;
p->stats.rtt);
p->mcast.n_replies_expected = (int) p->mcast.avg_n_members;
EBIT_SET(fake->flags, ENTRY_ABORTED);
- requestUnlink(fake->mem_obj->request);
- fake->mem_obj->request = NULL;
+ HTTPMSGUNLOCK(fake->mem_obj->request);
storeReleaseRequest(fake);
storeUnlockObject(fake);
- requestUnlink(psstate->request);
+ HTTPMSGUNLOCK(psstate->request);
cbdataFree(psstate);
}
/*
- * $Id: net_db.cc,v 1.181 2006/01/23 20:04:24 wessels Exp $
+ * $Id: net_db.cc,v 1.182 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
{
netdbExchangeState *ex = (netdbExchangeState *)data;
debug(38, 3) ("netdbExchangeDone: %s\n", storeUrl(ex->e));
- requestUnlink(ex->r);
+ HTTPMSGUNLOCK(ex->r);
storeUnregister(ex->sc, ex->e, ex);
storeUnlockObject(ex->e);
cbdataReferenceDone(ex->p);
return;
}
- requestLink(ex->r);
+ HTTPMSGLOCK(ex->r);
assert(NULL != ex->r);
ex->r->http_ver = HttpVersion(1,0);
ex->connstate = STATE_HEADER;
/*
- * $Id: peer_digest.cc,v 1.108 2006/01/19 22:10:55 wessels Exp $
+ * $Id: peer_digest.cc,v 1.109 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 72 Peer Digest Routines
* AUTHOR: Alex Rousskov
fetch = cbdataAlloc(DigestFetchState);
- fetch->request = requestLink(req);
+ fetch->request = HTTPMSGLOCK(req);
fetch->pd = cbdataReference(pd);
if (!fetch->old_entry->mem_obj->request)
fetch->old_entry->mem_obj->request = r =
- requestLink(fetch->entry->mem_obj->request);
+ HTTPMSGLOCK(fetch->entry->mem_obj->request);
assert(fetch->old_entry->mem_obj->request);
storeUnlockObject(fetch->entry);
- requestUnlink(fetch->request);
+ HTTPMSGUNLOCK(fetch->request);
fetch->entry = NULL;
- fetch->request = NULL;
-
assert(fetch->pd == NULL);
cbdataFree(fetch);
/*
- * $Id: peer_select.cc,v 1.137 2006/01/03 17:22:31 wessels Exp $
+ * $Id: peer_select.cc,v 1.138 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
delete (psstate->acl_checklist);
}
- requestUnlink(psstate->request);
- psstate->request = NULL;
+ HTTPMSGUNLOCK(psstate->request);
if (psstate->entry) {
assert(psstate->entry->ping_status != PING_WAITING);
psstate = new ps_state;
- psstate->request = requestLink(request);
+ psstate->request = HTTPMSGLOCK(request);
psstate->entry = entry;
/*
- * $Id: store_digest.cc,v 1.61 2006/01/23 20:04:24 wessels Exp $
+ * $Id: store_digest.cc,v 1.62 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 71 Store Digest Manager
* AUTHOR: Alex Rousskov
sd_state.rewrite_lock = cbdataAlloc(generic_cbdata);
sd_state.rewrite_lock->data = e;
debug(71, 3) ("storeDigestRewrite: url: %s key: %s\n", url, e->getMD5Text());
- e->mem_obj->request = requestLink(urlParse(METHOD_GET, url));
+ HttpRequest *req = urlParse(METHOD_GET, url);
+ e->mem_obj->request = HTTPMSGLOCK(req);
/* wait for rebuild (if any) to finish */
if (sd_state.rebuild_lock) {
/*
- * $Id: tunnel.cc,v 1.158 2006/01/03 23:26:20 wessels Exp $
+ * $Id: tunnel.cc,v 1.159 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
safe_free(sslState->url);
FwdState::serversFree(&sslState->servers);
sslState->host = NULL;
- requestUnlink(sslState->request);
- sslState->request = NULL;
+ HTTPMSGUNLOCK(sslState->request);
delete sslState;
}
err->port = sslState->port;
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
err->callback = sslErrorComplete;
debug(26, 4) ("sslConnect: Unknown host: %s\n", sslState->host);
err = errorCon(ERR_DNS_FAIL, HTTP_NOT_FOUND);
*sslState->status_ptr = HTTP_NOT_FOUND;
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
err->dnsserver_msg = xstrdup(dns_error_message);
err->callback = sslErrorComplete;
err->callback_data = sslState;
err->xerrno = xerrno;
err->host = xstrdup(sslState->host);
err->port = sslState->port;
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
err->callback = sslErrorComplete;
err->callback_data = sslState;
errorSend(sslState->client.fd(), err);
ch.src_addr = request->client_addr;
ch.my_addr = request->my_addr;
ch.my_port = request->my_port;
- ch.request = requestLink(request);
+ ch.request = HTTPMSGLOCK(request);
ch.accessList = cbdataReference(Config.accessList.miss);
/* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */
answer = ch.fastCheck();
if (answer == 0) {
err = errorCon(ERR_FORWARDING_DENIED, HTTP_FORBIDDEN);
*status_ptr = HTTP_FORBIDDEN;
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
err->src_addr = request->client_addr;
errorSend(fd, err);
return;
err = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
*status_ptr = HTTP_INTERNAL_SERVER_ERROR;
err->xerrno = errno;
- err->request = requestLink(request);
+ err->request = HTTPMSGLOCK(request);
errorSend(fd, err);
return;
}
#endif
sslState->url = xstrdup(url);
- sslState->request = requestLink(request);
+ sslState->request = HTTPMSGLOCK(request);
sslState->server.size_ptr = size_ptr;
sslState->status_ptr = status_ptr;
sslState->client.fd(fd);
ErrorState *err;
err = errorCon(ERR_CANNOT_FORWARD, HTTP_SERVICE_UNAVAILABLE);
*sslState->status_ptr = HTTP_SERVICE_UNAVAILABLE;
- err->request = requestLink(sslState->request);
+ err->request = HTTPMSGLOCK(sslState->request);
err->callback = sslErrorComplete;
err->callback_data = sslState;
errorSend(sslState->client.fd(), err);
/*
- * $Id: urn.cc,v 1.94 2006/01/23 20:04:24 wessels Exp $
+ * $Id: urn.cc,v 1.95 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 52 URN Parsing
* AUTHOR: Kostas Anagnostakis
debug(52, 3) ("urnStart: Bad uri-res URL %s\n", urlres);
ErrorState *err = errorCon(ERR_URN_RESOLVE, HTTP_NOT_FOUND);
err->url = urlres;
- err->request = requestLink(r);
+ err->request = HTTPMSGLOCK(r);
urlres = NULL;
errorAppendEntry(entry, err);
return;
}
- requestLink(urlres_r);
+ HTTPMSGLOCK(urlres_r);
httpHeaderPutStr(&urlres_r->header, HDR_ACCEPT, "text/plain");
}
{
debug(52, 3) ("urnStart: '%s'\n", storeUrl(e));
entry = e;
- request = requestLink(r);
+ request = HTTPMSGLOCK(r);
storeLockObject(entry);
setUriResFromRequest(r);
if (rep->sline.status != HTTP_OK) {
debug(52, 3) ("urnHandleReply: failed.\n");
err = errorCon(ERR_URN_RESOLVE, HTTP_NOT_FOUND);
- err->request = requestLink(urnState->request);
+ err->request = HTTPMSGLOCK(urnState->request);
err->url = xstrdup(storeUrl(e));
errorAppendEntry(e, err);
delete rep;
if (urls == NULL) { /* unkown URN error */
debug(52, 3) ("urnTranslateDone: unknown URN %s\n", storeUrl(e));
err = errorCon(ERR_URN_RESOLVE, HTTP_NOT_FOUND);
- err->request = requestLink(urnState->request);
+ err->request = HTTPMSGLOCK(urnState->request);
err->url = xstrdup(storeUrl(e));
errorAppendEntry(e, err);
goto error;
error:
storeUnlockObject(urlres_e);
storeUnlockObject(urnState->entry);
- requestUnlink(urnState->request);
- requestUnlink(urnState->urlres_r);
+ HTTPMSGUNLOCK(urnState->request);
+ HTTPMSGUNLOCK(urnState->urlres_r);
delete urnState;
}
/*
- * $Id: wais.cc,v 1.155 2006/01/03 17:22:31 wessels Exp $
+ * $Id: wais.cc,v 1.156 2006/02/17 18:10:59 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
storeUnlockObject(waisState->entry);
- requestUnlink(waisState->request);
+ HTTPMSGUNLOCK(waisState->request);
waisState->fwd = NULL; // refcounted
waisState->entry = entry;
waisState->dataWritten = 0;
xstrncpy(waisState->url, url, MAX_URL);
- waisState->request = requestLink(request);
+ waisState->request = HTTPMSGLOCK(request);
waisState->fwd = fwd;
comm_add_close_handler(waisState->fd, waisStateFree, waisState);
storeLockObject(entry);