cURL / Mailing Lists / curl-library / Single Mail

curl-library

Read Callbacks?

From: Dave Halbakken <YetAnotherDev_at_netscape.net>
Date: Thu, 30 Jan 2003 17:15:54 -0800

Hi,

I'm using curl version 7.10.3 release with MSVC6 on Win32.

I'm attempting to change libcurl's read-callback function and read-data
pointer on an open connection. I'm able to make this work for
write-callbacks and write-data pointers, but not for reads.

There appear to be two copies of the read pointers:

conn->data.set.fread and conn->fread
conn->data.set.fread_in and conn->fread_in

The conn->data.set read pointers get copied to conn in the
CreateConnection method of url.c, and the transfer code subsequently
ignores the conn->data.set pointers. Unfortunately the conn->data.set
pointers are the ones that curl_easy_setopt sets.

The behavior for writes appears to be different. It looks as if there is
no duplication of the write pointers

conn->data.set.fwrite
conn->data.set.out

Libcurl appears to use the values directly from conn->data.set during
all operations, so when you call curl_easy_setopt on an open connection,
they get used immediately/

I'm not sure what to do about this. I can code around the problem
outside libcurl, but it would break the encapsulation I've setup. I'd
rather see if this can be fixed in libcurl so that the behavior is the
same for both reads and writes.

Is there a good reason for duplicating the read pointers and
subsequently ignoring the ones that get set by curl_easy_setopt after
the connection is created?

Dave Halbakken

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-01-31