aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-02-20 17:35:51 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-02-20 17:35:51 +0000
commita1d6ad26100bc493c7b04f1301b1634b7f5aa8b4 (patch)
treea65ec14897e79381082a0b32b4c0bd8809a308b7 /lib/transfer.c
parent5f3d63ed5b17ce1803b5e2b61b53d27ec732f302 (diff)
multiple connection support initial commit
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 81bcfca2b..5eaeddb6b 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -366,6 +366,16 @@ _Transfer(struct connectdata *c_conn)
if (strnequal("Content-Length", p, 14) &&
sscanf (p+14, ": %ld", &contentlength))
conn->size = contentlength;
+ else if (strnequal("Connection: close", p,
+ strlen("Connection: close"))) {
+ /*
+ * [RFC 2616, section 8.1.2.1]
+ * "Connection: close" is HTTP/1.1 language and means that
+ * the connection will close when this request has been
+ * served.
+ */
+ conn->bits.close = TRUE; /* close when done */
+ }
else if (strnequal("Content-Range", p, 13)) {
if (sscanf (p+13, ": bytes %d-", &offset) ||
sscanf (p+13, ": bytes: %d-", &offset)) {
@@ -635,7 +645,9 @@ CURLcode curl_transfer(CURL *curl)
if (data->maxredirs && (data->followlocation >= data->maxredirs)) {
failf(data,"Maximum (%d) redirects followed", data->maxredirs);
+#ifdef USE_OLD_DISCONNECT
curl_disconnect(c_connect);
+#endif
res=CURLE_TOO_MANY_REDIRECTS;
break;
}
@@ -772,11 +784,15 @@ CURLcode curl_transfer(CURL *curl)
*/
break;
}
+#ifdef USE_OLD_DISCONNECT
curl_disconnect(c_connect);
+#endif
continue;
}
+#ifdef USE_OLD_DISCONNECT
curl_disconnect(c_connect);
+#endif
}
break; /* it only reaches here when this shouldn't loop */