aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-02-17 13:43:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-02-17 13:43:32 +0000
commit240bae4eb2c10d3fb3b31ff78b8ec6e1b5899166 (patch)
tree45a641198911e1be15f0c5c053050a0c2cba54bd
parent4180ca7638889eebad02d0201062b5f8fc8e3350 (diff)
In Curl_done() if premature is TRUE, it means this connection was said to be
DONE before the entire request operation is complete and thus we can't know in what state it is for re-using, so we're forced to close it. In a perfect world we can add code that keep track of if we really must close it here or not, but currently we have no such detail knowledge. Jerome Muffat-Meridol helped us work this out.
-rw-r--r--lib/url.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index cecb8b6f4..7b06604d8 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -4445,8 +4445,15 @@ CURLcode Curl_done(struct connectdata **connp,
if conn->bits.close is TRUE, it means that the connection should be
closed in spite of all our efforts to be nice, due to protocol
- restrictions in our or the server's end */
- if(data->set.reuse_forbid || conn->bits.close) {
+ restrictions in our or the server's end
+
+ if premature is TRUE, it means this connection was said to be DONE before
+ the entire request operation is complete and thus we can't know in what
+ state it is for re-using, so we're forced to close it. In a perfect world
+ we can add code that keep track of if we really must close it here or not,
+ but currently we have no such detail knowledge.
+ */
+ if(data->set.reuse_forbid || conn->bits.close || premature) {
CURLcode res2 = Curl_disconnect(conn); /* close the connection */
/* If we had an error already, make sure we return that one. But