cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] segfault when cancelling pipelined requests

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 22 Jan 2008 15:08:17 +0100 (CET)

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.

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...

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