cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] segfault when cancelling pipelined requests

From: Dmitry Kurochkin <dmitry.kurochkin_at_gmail.com>
Date: Tue, 22 Jan 2008 17:45:42 +0300

2008/1/22, Daniel Stenberg <daniel_at_haxx.se>:
> On Tue, 22 Jan 2008, Dmitry Kurochkin wrote:
>
> > I am not sure this is correct solution. Counting on you here, Daniel.
>
> First a disclaimer: I didn't write the pipelining code myself, so I don't have
> all the details exactly.
>
> I don't think this "forced assign" is the correct way. I'll explain why I
> think so:
>
> When doing pipelining, there will be multiple easy handles that all use the
> same connection. The connection is represented by a single struct that points
> to the easy handle that currently "owns" it. So, by forcefully assigning that
> pointer it seems like you may cause problems if another easy handle is
> actually the "true owner" at that time.

Yes. I thought about this too. But in this case I think it is safe
overwrite owner since we kill connection. And all handles in pipeline
have easy_conn == NULL after that.

>
> It strikes me that a single easy handle as an owner it not strictly correct
> (and I didn't check the code now to verify this) since there will be one easy
> handle that controls what's going out while (potentially) another one is
> getting the received data.
>
> So, I thought the lists for the pipe (recv, send, etc) are there to help
> dealing with this ownership-passing...

I agree that when pipelining there is no single owner of connection.
But as I mention above in this case it should not make any difference
since connection is closed.

Regards,
  Dmitry

>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2008-01-22