This patch extends errorCon() with a request_t argument, pulling some of the common
details of the request:
->request
->src_addr
Also cleaned all the duplicated related code.
Some of the 2.6 failing cases was already fixed in 3.0 using
clientBuildError(), but there are many other failing cases now fixed by this
patch.
/*
- * $Id: cache_manager.cc,v 1.44 2006/08/21 00:50:41 robertc Exp $
+ * $Id: cache_manager.cc,v 1.45 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 16 Cache Manager Objects
* AUTHOR: Duane Wessels
debug(16, 3) ("objectcacheStart: '%s'\n", storeUrl(entry));
if ((mgr = cachemgrParseUrl(storeUrl(entry))) == NULL) {
- err = errorCon(ERR_INVALID_URL, HTTP_NOT_FOUND);
+ err = errorCon(ERR_INVALID_URL, HTTP_NOT_FOUND, request);
err->url = xstrdup(storeUrl(entry));
- err->request = HTTPMSGLOCK(request);
errorAppendEntry(entry, err);
entry->expires = squid_curtime;
return;
/* build error message */
ErrorState *err;
HttpReply *rep;
- err = errorCon(ERR_CACHE_MGR_ACCESS_DENIED, HTTP_UNAUTHORIZED);
+ err = errorCon(ERR_CACHE_MGR_ACCESS_DENIED, HTTP_UNAUTHORIZED, request);
/* warn if user specified incorrect password */
if (mgr->passwd)
mgr->user_name ? mgr->user_name : "<unknown>",
fd_table[fd].ipaddr, mgr->action);
- err->request = HTTPMSGLOCK(request);
-
rep = errorBuildReply(err);
errorStateFree(err);
/*
- * $Id: client_side_reply.cc,v 1.111 2006/08/21 00:50:41 robertc Exp $
+ * $Id: client_side_reply.cc,v 1.112 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 88 Client-side Reply Routines
* AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
struct IN_ADDR * src_addr, HttpRequest * request)
{
- ErrorState *err = errorCon(page_id, status);
+ ErrorState *err = errorCon(page_id, status, request);
err->src_addr = *src_addr;
if (url)
err->url = xstrdup(url);
- if (request)
- err->request = HTTPMSGLOCK(request);
-
return err;
}
/*
- * $Id: errorpage.cc,v 1.216 2006/08/24 14:59:32 serassio Exp $
+ * $Id: errorpage.cc,v 1.217 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
* Abstract: This function creates a ErrorState object.
*/
ErrorState *
-errorCon(err_type type, http_status status)
+errorCon(err_type type, http_status status, HttpRequest * request)
{
ErrorState *err = new ErrorState;
err->page_id = type; /* has to be reset manually if needed */
err->type = type;
err->httpStatus = status;
+
+ if (request != NULL) {
+ err->request = HTTPMSGLOCK(request);
+ err->src_addr = request->client_addr;
+ }
+
return err;
}
/*
- * $Id: errorpage.h,v 1.1 2006/08/21 00:50:41 robertc Exp $
+ * $Id: errorpage.h,v 1.2 2006/08/25 15:22:34 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
class ErrorState
{
- public:
+
+public:
err_type type;
int page_id;
http_status httpStatus;
ftp;
char *request_hdrs;
char *err_msg; /* Preformatted error message from the cache */
- private:
+
+private:
CBDATA_CLASS2(ErrorState);
};
SQUIDCEXTERN void errorAppendEntry(StoreEntry *, ErrorState *);
SQUIDCEXTERN void errorStateFree(ErrorState * err);
SQUIDCEXTERN err_type errorReservePageId(const char *page_name);
-SQUIDCEXTERN ErrorState *errorCon(err_type type, http_status);
+SQUIDCEXTERN ErrorState *errorCon(err_type type, http_status, HttpRequest * request);
#endif /* SQUID_ERRORPAGE_H */
/*
- * $Id: forward.cc,v 1.148 2006/08/21 00:50:41 robertc Exp $
+ * $Id: forward.cc,v 1.149 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 17 Request Forwarding
* AUTHOR: Duane Wessels
if (page_id == ERR_NONE)
page_id = ERR_FORWARDING_DENIED;
- ErrorState *anErr = errorCon(page_id, HTTP_FORBIDDEN);
-
- anErr->request = HTTPMSGLOCK(request);
-
- anErr->src_addr = request->client_addr;
+ ErrorState *anErr = errorCon(page_id, HTTP_FORBIDDEN, request);
errorAppendEntry(entry, anErr); // frees anErr
if (shutting_down) {
/* more yuck */
- ErrorState *anErr = errorCon(ERR_SHUTTING_DOWN, HTTP_SERVICE_UNAVAILABLE);
- anErr->request = HTTPMSGLOCK(request);
+ ErrorState *anErr = errorCon(ERR_SHUTTING_DOWN, HTTP_SERVICE_UNAVAILABLE, request);
errorAppendEntry(entry, anErr); // frees anErr
return;
}
}
if (!err && shutting_down) {
- ErrorState *anErr = errorCon(ERR_SHUTTING_DOWN, HTTP_SERVICE_UNAVAILABLE);
- anErr->request = HTTPMSGLOCK(request);
+ errorCon(ERR_SHUTTING_DOWN, HTTP_SERVICE_UNAVAILABLE, request);
}
self = NULL; // refcounted
default:
debug(81, 1) ("fwdNegotiateSSL: Error negotiating SSL connection on FD %d: %s (%d/%d/%d)\n", fd, ERR_error_string(ERR_get_error(), NULL), ssl_error, ret, errno);
- ErrorState *anErr = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
+ ErrorState *anErr = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
#ifdef EPROTO
anErr->xerrno = EPROTO;
anErr->xerrno = EACCES;
#endif
- anErr->request = HTTPMSGLOCK(request);
fail(anErr);
if (fs->_peer) {
if ((ssl = SSL_new(sslContext)) == NULL) {
debug(83, 1) ("fwdInitiateSSL: Error allocating handle: %s\n",
ERR_error_string(ERR_get_error(), NULL));
- ErrorState *anErr = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
+ ErrorState *anErr = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR, request);
anErr->xerrno = errno;
- anErr->request = HTTPMSGLOCK(request);
fail(anErr);
self = NULL; // refcounted
return;
debug(17, 4) ("fwdConnectDone: Unknown host: %s\n",
request->host);
- ErrorState *anErr = errorCon(ERR_DNS_FAIL, HTTP_SERVICE_UNAVAILABLE);
+ ErrorState *anErr = errorCon(ERR_DNS_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
anErr->dnsserver_msg = xstrdup(dns_error_message);
comm_close(server_fd);
} else if (status != COMM_OK) {
assert(fs);
- ErrorState *anErr = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
+ ErrorState *anErr = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
anErr->xerrno = xerrno;
fail(anErr);
hierarchyNote(&request->hier, fs->code, fd_table[fd].ipaddr);
if (entry->isEmpty()) {
- ErrorState *anErr = errorCon(ERR_CONNECT_FAIL, HTTP_GATEWAY_TIMEOUT);
+ ErrorState *anErr = errorCon(ERR_CONNECT_FAIL, HTTP_GATEWAY_TIMEOUT, request);
anErr->xerrno = ETIMEDOUT;
fail(anErr);
/*
if (fd < 0) {
debug(50, 4) ("fwdConnectStart: %s\n", xstrerror());
- ErrorState *anErr = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
+ ErrorState *anErr = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR, request);
anErr->xerrno = errno;
fail(anErr);
self = NULL; // refcounted
FwdState::startFail()
{
debug(17, 3) ("fwdStartFail: %s\n", storeUrl(entry));
- ErrorState *anErr = errorCon(ERR_CANNOT_FORWARD, HTTP_SERVICE_UNAVAILABLE);
+ ErrorState *anErr = errorCon(ERR_CANNOT_FORWARD, HTTP_SERVICE_UNAVAILABLE, request);
anErr->xerrno = errno;
fail(anErr);
self = NULL; // refcounted
default:
debug(17, 1) ("fwdDispatch: Cannot retrieve '%s'\n",
storeUrl(entry));
- ErrorState *anErr = errorCon(ERR_UNSUP_REQ, HTTP_BAD_REQUEST);
+ ErrorState *anErr = errorCon(ERR_UNSUP_REQ, HTTP_BAD_REQUEST, request);
fail(anErr);
/*
* Force a persistent connection to be closed because
/*
- * $Id: ftp.cc,v 1.400 2006/08/21 00:50:41 robertc Exp $
+ * $Id: ftp.cc,v 1.401 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
if (ctrl.replycode > 500)
if (password_url)
- err = errorCon(ERR_FTP_FORBIDDEN, HTTP_FORBIDDEN);
+ err = errorCon(ERR_FTP_FORBIDDEN, HTTP_FORBIDDEN, fwd->request);
else
- err = errorCon(ERR_FTP_FORBIDDEN, HTTP_UNAUTHORIZED);
+ err = errorCon(ERR_FTP_FORBIDDEN, HTTP_UNAUTHORIZED, fwd->request);
else if (ctrl.replycode == 421)
- err = errorCon(ERR_FTP_UNAVAILABLE, HTTP_SERVICE_UNAVAILABLE);
+ err = errorCon(ERR_FTP_UNAVAILABLE, HTTP_SERVICE_UNAVAILABLE, fwd->request);
break;
case SENT_RETR:
if (ctrl.replycode == 550)
- err = errorCon(ERR_FTP_NOT_FOUND, HTTP_NOT_FOUND);
+ err = errorCon(ERR_FTP_NOT_FOUND, HTTP_NOT_FOUND, fwd->request);
break;
break;
case ERR_READ_TIMEOUT:
- err = errorCon(error, HTTP_GATEWAY_TIMEOUT);
+ err = errorCon(error, HTTP_GATEWAY_TIMEOUT, fwd->request);
break;
default:
- err = errorCon(error, HTTP_BAD_GATEWAY);
+ err = errorCon(error, HTTP_BAD_GATEWAY, fwd->request);
break;
}
if (err == NULL)
- err = errorCon(ERR_FTP_FAILURE, HTTP_BAD_GATEWAY);
+ err = errorCon(ERR_FTP_FAILURE, HTTP_BAD_GATEWAY, fwd->request);
err->xerrno = xerrno;
http_code = HTTP_INTERNAL_SERVER_ERROR;
}
- err = errorCon(err_code, http_code);
- err->request = HTTPMSGLOCK(ftpState->request);
+ err = errorCon(err_code, http_code, ftpState->request);
if (ftpState->old_request)
err->ftp.request = xstrdup(ftpState->old_request);
HttpReply *
FtpStateData::ftpAuthRequired(HttpRequest * request, const char *realm)
{
- ErrorState *err = errorCon(ERR_CACHE_ACCESS_DENIED, HTTP_UNAUTHORIZED);
- err->request = HTTPMSGLOCK(request);
+ ErrorState *err = errorCon(ERR_CACHE_ACCESS_DENIED, HTTP_UNAUTHORIZED, request);
HttpReply *newrep = errorBuildReply(err);
errorStateFree(err);
/* add Authenticate header */
* XXX Maybe instead of an error page we should
* handle the reply normally (without ICAP).
*/
- ErrorState *err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
+ ErrorState *err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR, request);
err->xerrno = errno;
- err->request = HTTPMSGLOCK(request);
errorAppendEntry(entry, err);
comm_close(ctrl.fd);
return;
if (entry->isEmpty()) {
ErrorState *err;
- err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
- err->request = HTTPMSGLOCK((HttpRequest *) request);
+ err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR, request);
err->xerrno = errno;
fwd->fail(err);
fwd->dontRetry(true);
/*
- * $Id: gopher.cc,v 1.198 2006/08/21 00:50:41 robertc Exp $
+ * $Id: gopher.cc,v 1.199 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
StoreEntry *entry = gopherState->entry;
debug(10, 4) ("gopherTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
- gopherState->fwd->fail(errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT));
+ gopherState->fwd->fail(errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT, gopherState->fwd->request));
comm_close(fd);
}
do_next_read = 1;
} else {
ErrorState *err;
- err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR);
+ err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR, gopherState->fwd->request);
err->xerrno = errno;
gopherState->fwd->fail(err);
comm_close(fd);
do_next_read = 0;
}
} else if (len == 0 && entry->isEmpty()) {
- gopherState->fwd->fail(errorCon(ERR_ZERO_SIZE_OBJECT, HTTP_SERVICE_UNAVAILABLE));
+ gopherState->fwd->fail(errorCon(ERR_ZERO_SIZE_OBJECT, HTTP_SERVICE_UNAVAILABLE, gopherState->fwd->request));
comm_close(fd);
do_next_read = 0;
} else if (len == 0) {
if (errflag) {
ErrorState *err;
- err = errorCon(ERR_WRITE_ERROR, HTTP_SERVICE_UNAVAILABLE);
+ err = errorCon(ERR_WRITE_ERROR, HTTP_SERVICE_UNAVAILABLE, gopherState->fwd->request);
err->xerrno = errno;
err->port = gopherState->req->port;
err->url = xstrdup(storeUrl(entry));
/*
- * $Id: http.cc,v 1.504 2006/08/21 00:50:41 robertc Exp $
+ * $Id: http.cc,v 1.505 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
debug(11, 4) ("httpTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
if (entry->store_status == STORE_PENDING) {
- httpState->fwd->fail(errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT));
+ httpState->fwd->fail(errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT, httpState->fwd->request));
}
comm_close(fd);
flags.do_next_read = 1;
} else {
ErrorState *err;
- err = errorCon(ERR_READ_ERROR, HTTP_BAD_GATEWAY);
+ err = errorCon(ERR_READ_ERROR, HTTP_BAD_GATEWAY, fwd->request);
err->xerrno = errno;
fwd->fail(err);
flags.do_next_read = 0;
comm_close(fd);
}
} else if (flag == COMM_OK && len == 0 && !flags.headers_parsed) {
- fwd->fail(errorCon(ERR_ZERO_SIZE_OBJECT, HTTP_BAD_GATEWAY));
+ fwd->fail(errorCon(ERR_ZERO_SIZE_OBJECT, HTTP_BAD_GATEWAY, fwd->request));
eof = 1;
flags.do_next_read = 0;
comm_close(fd);
*/
processReplyHeader();
else if (getReply()->sline.status == HTTP_INVALID_HEADER && HttpVersion(0,9) != getReply()->sline.version) {
- fwd->fail(errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY));
+ fwd->fail(errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY, fwd->request));
flags.do_next_read = 0;
} else {
if (entry->mem_obj->getReply()->sline.status == HTTP_HEADER_TOO_LARGE) {
storeEntryReset(entry);
- fwd->fail( errorCon(ERR_TOO_BIG, HTTP_BAD_GATEWAY));
+ fwd->fail( errorCon(ERR_TOO_BIG, HTTP_BAD_GATEWAY, fwd->request));
fwd->dontRetry(true);
flags.do_next_read = 0;
comm_close(fd);
if (fail) {
storeEntryReset(entry);
- fwd->fail( errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY));
+ fwd->fail( errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY, fwd->request));
comm_close(fd);
return;
}
if (errflag) {
ErrorState *err;
- err = errorCon(ERR_WRITE_ERROR, HTTP_BAD_GATEWAY);
+ err = errorCon(ERR_WRITE_ERROR, HTTP_BAD_GATEWAY, httpState->fwd->request);
err->xerrno = errno;
httpState->fwd->fail(err);
comm_close(fd);
if (errflag) {
ErrorState *err;
- err = errorCon(ERR_WRITE_ERROR, HTTP_BAD_GATEWAY);
+ err = errorCon(ERR_WRITE_ERROR, HTTP_BAD_GATEWAY, fwd->request);
err->xerrno = errno;
fwd->fail(err);
comm_close(fd);
* XXX Maybe instead of an error page we should
* handle the reply normally (without ICAP).
*/
- ErrorState *err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
+ ErrorState *err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR, orig_request);
err->xerrno = errno;
- err->request = HTTPMSGLOCK(orig_request);
errorAppendEntry(entry, err);
comm_close(fd);
return;
if (entry->isEmpty()) {
ErrorState *err;
- err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
- err->request = HTTPMSGLOCK((HttpRequest *) request);
+ err = errorCon(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR, request);
err->xerrno = errno;
fwd->fail( err);
fwd->dontRetry(true);
/*
- * $Id: internal.cc,v 1.42 2006/08/21 00:50:41 robertc Exp $
+ * $Id: internal.cc,v 1.43 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 76 Internal Squid Object handling
* AUTHOR: Duane, Alex, Henrik
} else {
debugObj(76, 1, "internalStart: unknown request:\n",
request, (ObjPackMethod) & httpRequestPack);
- err = errorCon(ERR_INVALID_REQ, HTTP_NOT_FOUND);
- err->request = HTTPMSGLOCK(request);
+ err = errorCon(ERR_INVALID_REQ, HTTP_NOT_FOUND, request);
errorAppendEntry(entry, err);
}
}
/*
- * $Id: tunnel.cc,v 1.163 2006/08/21 00:50:41 robertc Exp $
+ * $Id: tunnel.cc,v 1.164 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
comm_close(fd);
- err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
+ err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
*sslState->status_ptr = HTTP_SERVICE_UNAVAILABLE;
err->port = sslState->port;
- err->request = HTTPMSGLOCK(request);
-
err->callback = sslErrorComplete;
err->callback_data = sslState;
if (status == COMM_ERR_DNS) {
debug(26, 4) ("sslConnect: Unknown host: %s\n", sslState->host);
- err = errorCon(ERR_DNS_FAIL, HTTP_NOT_FOUND);
+ err = errorCon(ERR_DNS_FAIL, HTTP_NOT_FOUND, request);
*sslState->status_ptr = HTTP_NOT_FOUND;
- err->request = HTTPMSGLOCK(request);
err->dnsserver_msg = xstrdup(dns_error_message);
err->callback = sslErrorComplete;
err->callback_data = sslState;
errorSend(sslState->client.fd(), err);
} else if (status != COMM_OK) {
- err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
+ err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE, request);
*sslState->status_ptr = HTTP_SERVICE_UNAVAILABLE;
err->xerrno = xerrno;
err->port = sslState->port;
- err->request = HTTPMSGLOCK(request);
err->callback = sslErrorComplete;
err->callback_data = sslState;
errorSend(sslState->client.fd(), err);
answer = ch.fastCheck();
if (answer == 0) {
- err = errorCon(ERR_FORWARDING_DENIED, HTTP_FORBIDDEN);
+ err = errorCon(ERR_FORWARDING_DENIED, HTTP_FORBIDDEN, request);
*status_ptr = HTTP_FORBIDDEN;
- err->request = HTTPMSGLOCK(request);
- err->src_addr = request->client_addr;
errorSend(fd, err);
return;
}
if (sock == COMM_ERROR) {
debug(26, 4) ("sslStart: Failed because we're out of sockets.\n");
- err = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
+ err = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR, request);
*status_ptr = HTTP_INTERNAL_SERVER_ERROR;
err->xerrno = errno;
- err->request = HTTPMSGLOCK(request);
errorSend(fd, err);
return;
}
if (fs == NULL) {
ErrorState *err;
- err = errorCon(ERR_CANNOT_FORWARD, HTTP_SERVICE_UNAVAILABLE);
+ err = errorCon(ERR_CANNOT_FORWARD, HTTP_SERVICE_UNAVAILABLE, request);
*sslState->status_ptr = HTTP_SERVICE_UNAVAILABLE;
- err->request = HTTPMSGLOCK(sslState->request);
err->callback = sslErrorComplete;
err->callback_data = sslState;
errorSend(sslState->client.fd(), err);
/*
- * $Id: urn.cc,v 1.102 2006/08/21 00:50:42 robertc Exp $
+ * $Id: urn.cc,v 1.103 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 52 URN Parsing
* AUTHOR: Kostas Anagnostakis
if (urlres_r == NULL) {
debug(52, 3) ("urnStart: Bad uri-res URL %s\n", urlres);
- ErrorState *err = errorCon(ERR_URN_RESOLVE, HTTP_NOT_FOUND);
+ ErrorState *err = errorCon(ERR_URN_RESOLVE, HTTP_NOT_FOUND, r);
err->url = urlres;
- err->request = HTTPMSGLOCK(r);
urlres = NULL;
errorAppendEntry(entry, err);
return;
if (rep->sline.status != HTTP_OK) {
debug(52, 3) ("urnHandleReply: failed.\n");
- err = errorCon(ERR_URN_RESOLVE, HTTP_NOT_FOUND);
- err->request = HTTPMSGLOCK(urnState->request);
+ err = errorCon(ERR_URN_RESOLVE, HTTP_NOT_FOUND, 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 = HTTPMSGLOCK(urnState->request);
+ err = errorCon(ERR_URN_RESOLVE, HTTP_NOT_FOUND, urnState->request);
err->url = xstrdup(storeUrl(e));
errorAppendEntry(e, err);
goto error;
/*
- * $Id: wais.cc,v 1.161 2006/08/21 00:50:42 robertc Exp $
+ * $Id: wais.cc,v 1.162 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
debug(24, 4) ("waisTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
if (entry->store_status == STORE_PENDING) {
- waisState->fwd->fail(errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT));
+ waisState->fwd->fail(errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT, waisState->fwd->request));
}
comm_close(fd);
comm_read(fd, waisState->buf, read_sz, waisReadReply, waisState);
} else {
ErrorState *err;
- err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR);
+ err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR, waisState->fwd->request);
err->xerrno = errno;
waisState->fwd->fail(err);
comm_close(fd);
}
} else if (flag == COMM_OK && len == 0 && !waisState->dataWritten) {
- waisState->fwd->fail(errorCon(ERR_ZERO_SIZE_OBJECT, HTTP_SERVICE_UNAVAILABLE));
+ waisState->fwd->fail(errorCon(ERR_ZERO_SIZE_OBJECT, HTTP_SERVICE_UNAVAILABLE, waisState->fwd->request));
comm_close(fd);
} else if (flag == COMM_OK && len == 0) {
/* Connection closed; retrieval done. */
if (errflag) {
ErrorState *err;
- err = errorCon(ERR_WRITE_ERROR, HTTP_SERVICE_UNAVAILABLE);
+ err = errorCon(ERR_WRITE_ERROR, HTTP_SERVICE_UNAVAILABLE, waisState->fwd->request);
err->xerrno = errno;
waisState->fwd->fail(err);
comm_close(fd);
/*
- * $Id: whois.cc,v 1.36 2006/08/21 00:50:42 robertc Exp $
+ * $Id: whois.cc,v 1.37 2006/08/25 15:22:34 serassio Exp $
*
* DEBUG: section 75 WHOIS protocol
* AUTHOR: Duane Wessels, Kostas Anagnostakis
do_next_read = 1;
} else {
ErrorState *err;
- err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR);
+ err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR, fwd->request);
err->xerrno = errno;
fwd->fail(err);
comm_close(fd);