Bug 3149: not caching ecap adapted body
eCAP adapters may remove or edit the Content-Length header, and to allow
caching of the adapted body squid must reflect that new (or unspecified)
content length when deciding whether or not the adapted body can be cached.
// this code can run only once
libecap::headerReferer.assignHostId(HDR_REFERER);
+ libecap::headerContentLength.assignHostId(HDR_CONTENT_LENGTH);
libecap::protocolHttp.assignHostId(PROTO_HTTP);
libecap::protocolHttps.assignHostId(PROTO_HTTPS);
HttpHeaderEntry *e = new HttpHeaderEntry(squidId, name.image().c_str(),
value.toString().c_str());
theHeader.addEntry(e);
+
+ if (squidId == HDR_CONTENT_LENGTH)
+ theMessage.content_length = theHeader.getInt64(HDR_CONTENT_LENGTH);
}
void
theHeader.delByName(name.image().c_str());
else
theHeader.delById(squidId);
+
+ if (squidId == HDR_CONTENT_LENGTH)
+ theMessage.content_length = theHeader.getInt64(HDR_CONTENT_LENGTH);
}
libecap::Area