CURL review request

Martin Nowak dawg at dawgfoto.de
Tue Aug 16 09:55:02 PDT 2011


On Tue, 16 Aug 2011 15:13:40 +0200, dsimcha <dsimcha at yahoo.com> wrote:

> On 8/16/2011 7:48 AM, Jonas Drewsen wrote:
>> Hi all,
>>
>> This is a review request for the curl wrapper. Please read the "known
>> issues" in the top of the source file and if possible suggest a  
>> solution.
>>
>> We also need somebody for running the review process. Anyone?
>>
>> Code:
>> https://github.com/jcd/phobos/blob/curl-wrapper/etc/curl.d
>> Docs:
>> http://freeze.steamwinter.com/D/web/phobos/etc_curl.html
>>
>> Demolish!
>>
>> /Jonas
>
>  From a quick look, this looks very well thought out.  I'll review it  
> more thoroughly when I have more time.  A few questions/comments from a  
> quick look at the docs:
>
> Does the async stuff use D threads, or does Curl have its own async API?
>
> In your examples for postData, you have onReceive a ubyte[] and write it  
> out to console.  Did you mean to cast this to some kind of string?
>
> For onReceive, what's the purpose of the return value?
>
> If/when this module makes it into Phobos, are we going to start  
> including a libcurl binary with DMD distributions so that std.curl feels  
> truly **standard** and requires zero extra configuration?

I was also wondering about the async handling. In the long-term I'd like  
to see a bigger picture for async handling in phobos (offering some kind  
of futures, maybe event-loops etc.).
Though this is not a requirement for the curl wrapper now. std.parallelism  
also has some kind of this stuff and file reading would benefit from it  
too.

One thing I spotted at a quick glance, sending to be filled buffers to  
another thread should not be done by casting to shared not immutable.

martin


More information about the Digitalmars-d mailing list