cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: mmap & file uploads

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 1 Jun 2001 08:45:22 +0200 (MET DST)

On Wed, 30 May 2001, Sterling Hughes wrote:

> > It could possibly look like this:
> >
> > size_t read_file(void *clientp, size_t size, unsigned char **bufptr);
>
> Looks good. Is there any reason to have 'unsigned char *' instead of
> 'void *' or 'char *' here?

No. :-)

I figure we should use the same as read()/write() does, and they definitely
use 'void *' and so should probably we do too.

Anyone with a good idea of for decent name for this new option? The current
one is named CURLOPT_READFUNCTION and all other callback options also have
names ending with 'FUNCTION'. READ_NO_COPY_FUNCTION ? READ_FAST_FUNCTION ?

Speaking of decreasing the amount copies when doing upload, we could very
well have a stab at downloads at the same time, right? When downloading to a
file, I don't think we can gain much as then the callback would only write
the data to a file, but when the callback wants to append the data to have
the result in a large chunk of memory, we could save a copy if the
application tells the library where to store data and how much data it can
fit there. The application would then of course want to change the store
pointer and size after each write callback to refer to the new place to store
the stuff...

-- 
     Daniel Stenberg -- curl dude -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-06-01