#
-# $Id: cf.data.pre,v 1.214 2001/02/10 16:40:40 hno Exp $
+# $Id: cf.data.pre,v 1.215 2001/02/20 22:49:23 hno Exp $
#
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
disable persistent connections with clients and/or servers.
DOC_END
+NAME: pipeline_prefetch
+TYPE: onoff
+LOC: Config.onoff.pipeline_prefetch
+DEFAULT: on
+DOC_START
+ To boost the performance of pipelined requests to closer
+ match that of a non-proxied environment Squid tries to fetch
+ up to two requests in parallell from a pipeline.
+DOC_END
+
NAME: extension_methods
TYPE: wordlist
LOC: Config.ext_methods
/*
- * $Id: client_side.cc,v 1.527 2001/02/13 21:45:48 hno Exp $
+ * $Id: client_side.cc,v 1.528 2001/02/20 22:49:23 hno Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
* mysterious breakages.
*/
static int
-clientAlwaysAllowResponse(http_status sline) {
+clientAlwaysAllowResponse(http_status sline)
+{
switch (sline) {
- case HTTP_CONTINUE:
- case HTTP_SWITCHING_PROTOCOLS:
- case HTTP_PROCESSING:
- case HTTP_NO_CONTENT:
- case HTTP_NOT_MODIFIED:
- return 1;
- /* unreached */
- break;
- default:
- return 0;
+ case HTTP_CONTINUE:
+ case HTTP_SWITCHING_PROTOCOLS:
+ case HTTP_PROCESSING:
+ case HTTP_NO_CONTENT:
+ case HTTP_NOT_MODIFIED:
+ return 1;
+ /* unreached */
+ break;
+ default:
+ return 0;
}
}
} else if (rep) {
aclCheck_t *ch;
int rv;
- body_size = size - rep->hdr_sz;
+ body_size = size - rep->hdr_sz;
assert(body_size >= 0);
body_buf = buf + rep->hdr_sz;
http->range_iter.prefix_size = rep->hdr_sz;
RequestMethodStr[http->request->method], http->uri,
rv ? "ALLOWED" : "DENIED",
AclMatchedName ? AclMatchedName : "NO ACL's");
- if (!rv && rep->sline.status != HTTP_FORBIDDEN
+ if (!rv && rep->sline.status != HTTP_FORBIDDEN
&& !clientAlwaysAllowResponse(rep->sline.status)) {
/* the if above is slightly broken, but there is no way
* to tell if this is a squid generated error page, or one from
snprintf(http->uri, url_sz, "http://%s:%d%s",
inet_ntoa(http->conn->me.sin_addr),
vport, url);
- } else
- if (vport_mode)
- vport = natLookup.nl_realport;
- snprintf(http->uri, url_sz, "http://%s:%d%s",
- inet_ntoa(natLookup.nl_realip),
- vport, url);
+ } else if (vport_mode)
+ vport = natLookup.nl_realport;
+ snprintf(http->uri, url_sz, "http://%s:%d%s",
+ inet_ntoa(natLookup.nl_realip),
+ vport, url);
#else
#if LINUX_NETFILTER
/* If the call fails the address structure will be unchanged */
break;
/* Limit the number of concurrent requests to 2 */
for (H = &conn->chr, nrequests = 0; *H; H = &(*H)->next, nrequests++);
- if (nrequests >= 2) {
+ if (nrequests >= (Config.onoff.pipeline_prefetch ? 2 : 1)) {
debug(33, 3) ("clientReadRequest: FD %d max concurrent requests reached\n", fd);
debug(33, 5) ("clientReadRequest: FD %d defering new request until one is done\n", fd);
conn->defer.until = squid_curtime + 100; /* Reset when a request is complete */