cURL / Mailing Lists / curl-library / Single Mail

curl-library

Input streams

From: Patrick Monnerat <Patrick.Monnerat_at_datasphere.ch>
Date: Fri, 19 Feb 2010 15:38:09 +0100

 
In libcurl, we may have 3 different kinds of input data sources:
 
1) File, via CURLOPT_READFUNCTION/CURLOPT_READDATA = NULL/(FILE *)
2) Callback, via CURLOPT_READFUNCTION = some user defined function
3) Memory, using CURLOPT_POSTFIELDS.
 
However, the 3rd case only works for HTTP(S) (and maybe RTSP: I did not
try).
 
For the other protocols, input data from memory must be provided to
libcurl via a callback. This callback is very simple, but is a very
heavy way to transmit a simple string. Particularly when you know the
memory string transfer support already exists via one or two calls to
curl_easy_setopt() for some other protocols.
 
Could we imagine to generalize postfields-like handling to all (sending)
protocols ? I think it could be a great improvement for the callers.
 
Patrick

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-02-19