Second Round CURL Wrapper Review

jdrewsen jdrewsen at nospam.com
Fri Dec 30 11:19:26 PST 2011


On Monday, 19 December 2011 at 18:14:29 UTC, Somedude wrote:
> Le 19/12/2011 19:05, Somedude a écrit :
>> Le 03/12/2011 05:26, dsimcha a écrit :
>>> I volunteered ages ago to manage the review for the second 
>>> round of
>>> Jonas Drewsen's CURL wrapper.  After the first round it was 
>>> decided
>>> that, after a large number of minor issues were fixed, a 
>>> second round
>>> would be necessary.
>>>
>>> Significant open issues:
>>>
>>> 1.  Should libcurl be bundled with DMD on Windows?
>>>
>>> 2.  etc.curl, std.curl, or std.net.curl?  (We had a vote a 
>>> while back
>>> but it was buried deep in a thread and a lot of people may 
>>> have missed
>>> it:  
>>> http://www.easypolls.net/poll.html?p=4ebd3219011eb0e4518d35ab 
>>> )
>>>
>>> Code: 
>>> https://github.com/jcd/phobos/blob/curl-wrapper/etc/curl.d
>>> Docs: http://freeze.steamwinter.com/D/web/phobos/etc_curl.html
>>>
>>> For those of you on Windows, a libcurl binary built by DMC is 
>>> available
>>> at http://gool.googlecode.com/files/libcurl_7.21.7.zip.
>>>
>>> Review starts now and ends on December 16, followed by one 
>>> week of voting.
>> 
>> A bit late, but following Andrei's important remark that some 
>> operations
>> are blocking, I also noticed that curl-multi API is not 
>> covered.
>> 
>> http://curl.haxx.se/libcurl/c/libcurl-multi.html
>> 
>> Is there a reason why ? Would it break the current API to add 
>> it later ?
>> 
>
> It looks like curl_multi_perform's behavior is more interesting 
> than
> curl_easy_perform. *
> From the tutorial:
>
> http://curl.haxx.se/libcurl/c/libcurl-tutorial.html
>
> "curl_multi_perform(3) is asynchronous. It will only execute as 
> little
> as possible and then return back control to your program. It is 
> designed
> to never block. If it returns CURLM_CALL_MULTI_PERFORM you 
> better call
> it again soon, as that is a signal that it still has local data 
> to send
> or remote data to receive. "

I am aware of the multi_perform API. The multi API actually uses 
easy handles and therefore it would be natural to extend the 
wrapper with multi support later on.

It will allow for read() and write() methods on the HTTP/FTP 
structs as well.

For now I want to limit the scope and stick to the easy handles.

/Jonas


More information about the Digitalmars-d mailing list