cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Implications?

From: Ravi Pratap <Ravi.Pratap_at_hillcrestlabs.com>
Date: Mon, 18 Sep 2006 16:07:38 -0400

> > What you mentioned is indeed correct. The problem is really that
we're
> > not clearing a connection's send and recv pipe correctly in the case
> > that a pipe breaks. The code at the top of multi_runsingle should
really
> > read like this:
> >
> > RCS file: /cvsroot/curl/curl/lib/multi.c,v
> > retrieving revision 1.105
> > diff -u -r1.105 multi.c
> > --- multi.c 16 Sep 2006 21:50:29 -0000 1.105
> > +++ multi.c 18 Sep 2006 18:09:59 -0000
> > @@ -732,6 +732,11 @@
> > multistate(easy, CURLM_STATE_COMPLETED);
> > }
> >
> > + Curl_removeHandleFromPipeline(easy->easy_handle,
> > + easy->easy_conn->send_pipe);
> > + Curl_removeHandleFromPipeline(easy->easy_handle,
> > + easy->easy_conn->recv_pipe);
> > +
> > easy->easy_handle->state.pipe_broke = FALSE;
> > easy->easy_conn = NULL;
> > break;
> >
>
> Hm... this segfaults:
> (gdb) p *easy
> $2 = {next = 0x8677600, prev = 0x86f9d60, easy_handle = 0x8734850,
easy_conn = 0x0,
> state = CURLM_STATE_COMPLETED, result = CURLE_COULDNT_CONNECT, msg =
0x0, msg_num =
> 0,
> sockets = {0, 0, 0, 0, 0}, numsocks = 0}

Oops, you're right. easy_conn is already NULL at that point.

I need to talk to Daniel about the right way to fix this. The easy
handle really shouldn't be in the recv_pipe of the connection in the
first place.

Ravi.
Received on 2006-09-18