debugs(11, 4, HERE << serverConnection << ": '" << entry->url() << "'" );
if (entry->store_status == STORE_PENDING) {
- fwd->fail(new ErrorState(ERR_READ_TIMEOUT, Http::scGateway_Timeout, fwd->request));
+ fwd->fail(new ErrorState(ERR_READ_TIMEOUT, Http::scGatewayTimeout, fwd->request));
}
serverConnection->close();
case Http::scMovedPermanently:
- case Http::scMovedTemporarily:
+ case Http::scFound:
case Http::scGone:
/* Responses that only are cacheable if the server says so */
- case Http::scMovedTemporarily:
+ case Http::scFound:
case Http::scTemporaryRedirect:
if (rep->date <= 0) {
debugs(22, 3, HERE << "NO because HTTP status " << rep->sline.status() << " and Date missing/invalid");
case Http::scMethodNotAllowed:
- case Http::scRequestUriTooLarge:
+ case Http::scUriTooLong:
case Http::scInternalServerError:
case Http::scServiceUnavailable:
- case Http::scGateway_Timeout:
- debugs(22, 3, HERE << "MAYBE because HTTP status " << rep->sline.status());
+ case Http::scGatewayTimeout:
+ debugs(22, 3, "MAYBE because HTTP status " << rep->sline.status());
return -1;
/* NOTREACHED */
case Http::scConflict:
case Http::scLengthRequired:
case Http::scPreconditionFailed:
- case Http::scRequestEntityTooLarge:
+ case Http::scPayloadTooLarge:
case Http::scUnsupportedMediaType:
case Http::scUnprocessableEntity:
case Http::scLocked:
* connection.
*/
if (!flags.request_sent) {
- debugs(11, 2, "statusIfComplete: Request not yet fully sent \"" << RequestMethodStr(request->method) << " " << entry->url() << "\"" );
+ debugs(11, 2, "Request not yet fully sent " << request->method << ' ' << entry->url());
return COMPLETE_NONPERSISTENT_MSG;
}
*/
/*
void
-HttpStateData::ReadReplyWrapper(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void *data)
+HttpStateData::ReadReplyWrapper(int fd, char *buf, size_t len, Comm::Flag flag, int xerrno, void *data)
{
HttpStateData *httpState = static_cast<HttpStateData *>(data);
assert (fd == httpState->serverConnection->fd);
debugs(11, 5, HERE << io.conn << ": len " << len << ".");
- // Bail out early on COMM_ERR_CLOSING - close handlers will tidy up for us
- if (io.flag == COMM_ERR_CLOSING) {
+ // Bail out early on Comm::ERR_CLOSING - close handlers will tidy up for us
+ if (io.flag == Comm::ERR_CLOSING) {
debugs(11, 3, "http socket closing");
return;
}
}
// handle I/O errors
- if (io.flag != COMM_OK || len < 0) {
+ if (io.flag != Comm::OK || len < 0) {
debugs(11, 2, HERE << io.conn << ": read failure: " << xstrerror() << ".");
if (ignoreErrno(io.xerrno)) {
kb_incr(&(statCounter.server.http.kbytes_out), io.size);
}
- if (io.flag == COMM_ERR_CLOSING)
+ if (io.flag == Comm::ERR_CLOSING)
return;
if (io.flag) {
/* don't cache the result */
request->flags.cachable = false;
/* pretend it's not a range request */
- delete request->range;
- request->range = NULL;
+ request->ignoreRange("want to request the whole object");
request->flags.isRanged = false;
}
if (!hdr_out->has(HDR_HOST)) {
if (request->peer_domain) {
hdr_out->putStr(HDR_HOST, request->peer_domain);
- } else if (request->port == urlDefaultPort(request->protocol)) {
+ } else if (request->port == urlDefaultPort(request->url.getScheme())) {
/* use port# only if not default */
hdr_out->putStr(HDR_HOST, request->GetHost());
} else {
/* append Front-End-Https */
if (flags.front_end_https) {
- if (flags.front_end_https == 1 || request->protocol == AnyP::PROTO_HTTPS)
+ if (flags.front_end_https == 1 || request->url.getScheme() == AnyP::PROTO_HTTPS)
hdr_out->putStr(HDR_FRONT_END_HTTPS, "On");
}
else {
/* use port# only if not default */
- if (request->port == urlDefaultPort(request->protocol)) {
+ if (request->port == urlDefaultPort(request->url.getScheme())) {
hdr_out->putStr(HDR_HOST, request->GetHost());
} else {
httpHeaderPutStrf(hdr_out, HDR_HOST, "%s:%d",
Http::ProtocolVersion httpver(1,1);
const char * url;
if (_peer && !_peer->options.originserver)
- url = entry->url();
+ url = urlCanonical(request);
else
url = request->urlpath.termedBuf();
- mb->Printf("%s %s %s/%d.%d\r\n",
- RequestMethodStr(request->method),
+ mb->Printf(SQUIDSBUFPH " %s %s/%d.%d\r\n",
+ SQUIDSBUFPRINT(request->method.image()),
url && *url ? url : "/",
AnyP::ProtocolType_str[httpver.protocol],
httpver.major,httpver.minor);
void
httpStart(FwdState *fwd)
{
- debugs(11, 3, "httpStart: \"" << RequestMethodStr(fwd->request->method) << " " << fwd->entry->url() << "\"" );
+ debugs(11, 3, fwd->request->method << ' ' << fwd->entry->url());
AsyncJob::Start(new HttpStateData(fwd));
}