From cbf58d88d0a84042d9dd8a7a6b1644f15242cf02 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 18 Feb 2007 23:02:42 +0000 Subject: - Jeff Pohlmeyer identified two problems: first a rather obscure problem with the multi interface and connection re-use that could make a curl_multi_remove_handle() ruin a pointer in another handle. The second problem was less of an actual problem but more of minor quirk: the re-using of connections wasn't properly checking if the connection was marked for closure. --- lib/url.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 148d7b2bb..6d1fa0459 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2030,7 +2030,8 @@ ConnectionExists(struct SessionHandle *data, from the multi */ } - infof(data, "Examining connection #%ld for reuse\n", check->connectindex); + DEBUGF(infof(data, "Examining connection #%ld for reuse\n", + check->connectindex)); if(check->inuse && !canPipeline) { /* can only happen within multi handles, and means that another easy @@ -2056,11 +2057,11 @@ ConnectionExists(struct SessionHandle *data, continue; } - if (data->state.is_in_pipeline && check->bits.close) { - /* Don't pick a connection that is going to be closed */ - infof(data, "Connection #%ld has been marked for close, can't reuse\n", - check->connectindex); - continue; + if (check->bits.close) { + /* Don't pick a connection that is going to be closed. */ + infof(data, "Connection #%ld has been marked for close, can't reuse\n", + check->connectindex); + continue; } if((needle->protocol&PROT_SSL) != (check->protocol&PROT_SSL)) @@ -4136,8 +4137,9 @@ CURLcode Curl_async_resolved(struct connectdata *conn, CURLcode Curl_done(struct connectdata **connp, - CURLcode status, bool premature) /* an error if this is called after an - error was detected */ + CURLcode status, /* an error if this is called after an + error was detected */ + bool premature) { CURLcode result; struct connectdata *conn = *connp; -- cgit v1.2.3