diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-05-20 10:32:23 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-05-22 00:34:10 +0200 |
commit | df13f8e8c2199b572f19d295e5c59e7502204b3a (patch) | |
tree | b664dc79f3de9d810f13dd01decbd0b03fcb06b5 /lib/multi.c | |
parent | 491767418bd3e69867d48c2f9b4ea58f7112a879 (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/multi.c')
-rw-r--r-- | lib/multi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/multi.c b/lib/multi.c index 72fde7439..1fb341ca6 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -515,7 +515,7 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle, /* If the handle is in a pipeline and has started sending off its request but not received its response yet, we need to close connection. */ - data->easy_conn->bits.close = TRUE; + connclose(data->easy_conn, "Removed with partial response"); /* Set connection owner so that Curl_done() closes it. We can sefely do this here since connection is killed. */ data->easy_conn->data = easy; @@ -1011,7 +1011,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, /* Force the connection closed because the server could continue to send us stuff at any time. (The disconnect_conn logic used below doesn't work at this point). */ - data->easy_conn->bits.close = TRUE; + connclose(data->easy_conn, "Disconnected with pending data"); data->result = CURLE_OPERATION_TIMEDOUT; multistate(data, CURLM_STATE_COMPLETED); break; @@ -1239,7 +1239,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, case CURLM_STATE_DO: if(data->set.connect_only) { /* keep connection open for application to use the socket */ - data->easy_conn->bits.close = FALSE; + connkeep(data->easy_conn, "CONNECT_ONLY"); multistate(data, CURLM_STATE_DONE); data->result = CURLE_OK; result = CURLM_CALL_MULTI_PERFORM; @@ -1525,7 +1525,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, */ if(!(data->easy_conn->handler->flags & PROTOPT_DUAL)) - data->easy_conn->bits.close = TRUE; + connclose(data->easy_conn, "Transfer returned error"); Curl_posttransfer(data); Curl_done(&data->easy_conn, data->result, FALSE); @@ -1705,7 +1705,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, /* aborted due to progress callback return code must close the connection */ data->result = CURLE_ABORTED_BY_CALLBACK; - data->easy_conn->bits.close = TRUE; + connclose(data->easy_conn, "Aborted by callback"); /* if not yet in DONE state, go there, otherwise COMPLETED */ multistate(data, (data->mstate < CURLM_STATE_DONE)? |