cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: multi_runsingle referencing freed connection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 19 Feb 2007 13:04:16 +0100 (CET)

On Sat, 17 Feb 2007, Jeff Pohlmeyer wrote:

> And then on line 2059 of url.c
> ====
> 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;
> }
> ====
>
> I don't don't understand the "is_in_pipeline" check here, if multi.c flagged
> the connection as bad, then it shouldn't get re-used, regardless if it is
> pipelined or not?

Correct. It turned out this probably was written this way just because the
HTTP connections wasn't flagged re-usable until the HTTP request was sent and
thus for the pipelining case it couldn't add a new request to the pipe until
the first request had been sent.

This is now changed so that the re-use bit (conn->bits.close) is set to its
default value already in the HTTP-connect function and then I could fix that
conditional up there you found.

Thanks for your keen eyes and reports. I committed both these changes
yesterday.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-02-19