aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-05-20 10:32:23 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-05-22 00:34:10 +0200
commitdf13f8e8c2199b572f19d295e5c59e7502204b3a (patch)
treeb664dc79f3de9d810f13dd01decbd0b03fcb06b5 /lib/transfer.c
parent491767418bd3e69867d48c2f9b4ea58f7112a879 (diff)
bits.close: introduce connection close tracking
Make all code use connclose() and connkeep() when changing the "close state" for a connection. These two macros take a string argument with an explanation, and debug builds of curl will include that in the debug output. Helps tracking connection re-use/close issues.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index c1cdde60b..e0f613bd0 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -569,7 +569,7 @@ static CURLcode readwrite_data(struct SessionHandle *data,
infof(data, "Simulate a HTTP 304 response!\n");
/* we abort the transfer before it is completed == we ruin the
re-use ability. Close the connection */
- conn->bits.close = TRUE;
+ connclose(conn, "Simulated 304 handling");
return CURLE_OK;
}
} /* we have a time condition */
@@ -1818,7 +1818,7 @@ Curl_reconnect_request(struct connectdata **connp)
infof(data, "Re-used connection seems dead, get a new one\n");
- conn->bits.close = TRUE; /* enforce close of this connection */
+ connclose(conn, "Reconnect dead connection"); /* enforce close */
result = Curl_done(&conn, result, FALSE); /* we are so done with this */
/* conn may no longer be a good pointer, clear it to avoid mistakes by
@@ -1891,7 +1891,7 @@ CURLcode Curl_retry_request(struct connectdata *conn,
if(!*url)
return CURLE_OUT_OF_MEMORY;
- conn->bits.close = TRUE; /* close this connection */
+ connclose(conn, "retry"); /* close this connection */
conn->bits.retry = TRUE; /* mark this as a connection we're about
to retry. Marking it this way should
prevent i.e HTTP transfers to return