aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-03-09 16:02:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-03-09 16:02:59 +0000
commit67d5c0a9700d67ecb4ceee137aeeb27b683121a2 (patch)
treed14f48a96eacff29d36d8eba45bfbe52985efd64 /lib
parent580896d6158e9b88257a08a7f7852ceb40d7b362 (diff)
for HTTP/1.0 we default to non keep-alive connections, but when we get a
1.0-reply from a proxy we use and the Proxy-Connection: keep-alive header is used, we switch it on and live happily ever after
Diffstat (limited to 'lib')
-rw-r--r--lib/transfer.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 4bc619994..028192166 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -367,6 +367,12 @@ Transfer(struct connectdata *c_conn)
return CURLE_HTTP_NOT_FOUND;
}
data->progress.httpcode = code;
+ data->progress.httpversion = httpversion;
+ if(httpversion == 0)
+ /* Default action for HTTP/1.0 must be to close, unless
+ we get one of those fancy headers that tell us the
+ server keeps it open for us! */
+ conn->bits.close = TRUE;
}
else {
header = FALSE; /* this is not a header line */
@@ -379,6 +385,18 @@ Transfer(struct connectdata *c_conn)
conn->size = contentlength;
Curl_pgrsSetDownloadSize(data, contentlength);
}
+ else if((httpversion == 0) &&
+ conn->bits.httpproxy &&
+ strnequal("Proxy-Connection: keep-alive", p,
+ strlen("Proxy-Connection: keep-alive"))) {
+ /*
+ * When a HTTP/1.0 reply comes when using a proxy, the
+ * 'Proxy-Connection: keep-alive' line tells us the
+ * connection will be kept alive for our pleasure.
+ * Default action for 1.0 is to close.
+ */
+ conn->bits.close = FALSE; /* don't close when done */
+ }
else if (strnequal("Connection: close", p,
strlen("Connection: close"))) {
/*