/*
- * $Id: errorpage.cc,v 1.109 1997/12/03 08:26:34 wessels Exp $
+ * $Id: errorpage.cc,v 1.110 1997/12/03 09:00:16 wessels Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
MemObject *mem = entry->mem_obj;
int len;
assert(entry->store_status == STORE_PENDING);
-#if WE_SHOULD_PROBABLY_REQUIRE_THIS
+ assert(mem != NULL);
assert(mem->inmem_hi == 0);
-#endif
buf = errorBuildBuf(err, &len);
storeAppend(entry, buf, len);
- if (mem)
- mem->reply->code = err->http_status;
+ mem->reply->code = err->http_status;
storeComplete(entry);
+ storeNegativeCache(entry);
+ storeReleaseRequest(entry);
errorStateFree(err);
}
/*
- * $Id: ftp.cc,v 1.176 1997/12/02 00:17:35 wessels Exp $
+ * $Id: ftp.cc,v 1.177 1997/12/03 09:00:17 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT);
err->request = requestLink(ftpState->request);
errorAppendEntry(entry, err);
+ } else {
+ storeAbort(entry, 0);
}
- storeAbort(entry, 0);
}
if (ftpState->data.fd >= 0) {
comm_close(ftpState->data.fd);
err->xerrno = errno;
err->request = requestLink(ftpState->request);
errorAppendEntry(entry, err);
+ } else {
+ storeAbort(entry, 0);
}
- storeAbort(entry, 0);
ftpDataTransferDone(ftpState);
}
} else if (len == 0 && mem->inmem_hi == 0) {
err->xerrno = errno;
err->request = requestLink(ftpState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
ftpDataTransferDone(ftpState);
} else if (len == 0) {
ftpReadComplete(ftpState);
err->xerrno = errno;
err->request = requestLink(ftpState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
return;
}
ftpState->ctrl.fd = fd;
err->dnsserver_msg = xstrdup(dns_error_message);
err->request = requestLink(request);
errorAppendEntry(ftpState->entry, err);
- storeAbort(ftpState->entry, 0);
comm_close(fd);
} else if (status != COMM_OK) {
err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
err->port = request->port;
err->request = requestLink(request);
errorAppendEntry(ftpState->entry, err);
- storeAbort(ftpState->entry, 0);
comm_close(fd);
} else {
ftpState->state = BEGIN;
err->port = ftpState->data.port;
err->request = requestLink(request);
errorAppendEntry(ftpState->entry, err);
- storeAbort(ftpState->entry, 0);
comm_close(fd);
return;
}
else
err->ftp.reply = ftpState->ctrl.last_reply;
errorAppendEntry(ftpState->entry, err);
- storeAbort(ftpState->entry, 0);
comm_close(ftpState->ctrl.fd);
}
/*
- * $Id: gopher.cc,v 1.114 1997/11/18 01:02:38 wessels Exp $
+ * $Id: gopher.cc,v 1.115 1997/12/03 09:00:18 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT);
err->url = xstrdup(gopherState->request);
errorAppendEntry(entry, err);
+ } else {
+ storeAbort(entry, 0);
}
- storeAbort(entry, 0);
comm_close(fd);
}
err->xerrno = errno;
err->url = xstrdup(storeUrl(entry));
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
}
} else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
err->xerrno = errno;
err->url = xstrdup(gopherState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
} else if (len == 0) {
/* Connection closed; retrieval done. */
err->port = gopherState->port;
err->url = xstrdup(storeUrl(entry));
errorAppendEntry(entry, err);
-
- storeAbort(entry, 0);
comm_close(fd);
if (buf)
put_free_4k_page(buf); /* Allocated by gopherSendRequest. */
err = errorCon(ERR_INVALID_URL, HTTP_BAD_REQUEST);
err->url = xstrdup(storeUrl(entry));
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
gopherStateFree(-1, gopherState);
return;
}
err->xerrno = errno;
err->url = xstrdup(storeUrl(entry));
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
gopherStateFree(-1, gopherState);
return;
}
err->dnsserver_msg = xstrdup(dns_error_message);
err->url = xstrdup(storeUrl(entry));
errorAppendEntry(entry, err);
- storeAbort(gopherState->entry, 0);
comm_close(fd);
} else if (status != COMM_OK) {
ErrorState *err;
err->port = gopherState->port;
err->url = xstrdup(storeUrl(entry));
errorAppendEntry(entry, err);
- storeAbort(gopherState->entry, 0);
comm_close(fd);
} else {
commSetSelect(fd, COMM_SELECT_WRITE, gopherSendRequest, gopherState, 0);
/*
- * $Id: http.cc,v 1.226 1997/12/02 00:17:37 wessels Exp $
+ * $Id: http.cc,v 1.227 1997/12/03 09:00:18 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT);
err->request = requestLink(httpState->orig_request);
errorAppendEntry(entry, err);
+ } else {
+ storeAbort(entry, 0);
}
- storeAbort(entry, 0);
comm_close(fd);
}
err->xerrno = errno;
err->request = requestLink(httpState->orig_request);
errorAppendEntry(entry, err);
+ } else {
+ storeAbort(entry, 0);
}
- storeAbort(entry, 0);
comm_close(fd);
}
debug(50, 2) ("httpReadReply: FD %d: read failure: %s.\n",
err->xerrno = errno;
err->request = requestLink(httpState->orig_request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
}
} else if (len == 0) {
err->xerrno = errno;
err->request = requestLink(httpState->orig_request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
return;
} else {
err->xerrno = errno;
err->request = requestLink(request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
}
return fd;
}
err->dnsserver_msg = xstrdup(dns_error_message);
err->request = requestLink(httpState->orig_request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
} else if (status != COMM_OK) {
err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
err->port = request->port;
err->request = requestLink(httpState->orig_request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
if (httpState->peer)
peerCheckConnectStart(httpState->peer);
comm_close(fd);
/*
- * $Id: wais.cc,v 1.98 1997/11/14 17:21:24 wessels Exp $
+ * $Id: wais.cc,v 1.99 1997/12/03 09:00:20 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
err = errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT);
err->request = urlParse(METHOD_CONNECT, waisState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
}
err = errorCon(ERR_CLIENT_ABORT, HTTP_INTERNAL_SERVER_ERROR);
err->request = urlParse(METHOD_CONNECT, waisState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
return;
}
err->xerrno = errno;
err->request = urlParse(METHOD_CONNECT, waisState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
}
} else if (len == 0 && entry->mem_obj->inmem_hi == 0) {
err->xerrno = errno;
err->request = urlParse(METHOD_CONNECT, waisState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
} else if (len == 0) {
/* Connection closed; retrieval done. */
err->port = waisState->relayport;
err->request = urlParse(METHOD_CONNECT, waisState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
comm_close(fd);
} else {
/* Schedule read reply. */
err = errorCon(ERR_NO_RELAY, HTTP_INTERNAL_SERVER_ERROR);
err->request = urlParse(METHOD_CONNECT, waisState->request);
errorAppendEntry(entry, err);
-
- storeAbort(entry, 0);
return;
}
fd = comm_open(SOCK_STREAM,
err = errorCon(ERR_SOCKET_FAILURE, HTTP_INTERNAL_SERVER_ERROR);
err->request = urlParse(METHOD_CONNECT, waisState->request);
errorAppendEntry(entry, err);
- storeAbort(entry, 0);
return;
}
waisState = xcalloc(1, sizeof(WaisStateData));
err->dnsserver_msg = xstrdup(dns_error_message);
err->request = urlParse(METHOD_CONNECT, request);
errorAppendEntry(waisState->entry, err);
- storeAbort(waisState->entry, 0);
comm_close(fd);
} else if (status != COMM_OK) {
err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
err->port = waisState->relayport;
err->request = urlParse(METHOD_CONNECT, request);
errorAppendEntry(waisState->entry, err);
- storeAbort(waisState->entry, 0);
comm_close(fd);
} else {
commSetSelect(fd, COMM_SELECT_WRITE, waisSendRequest, waisState, 0);