Curl wrapper round two

jdrewsen jdrewsen at nospam.com
Sun Jun 19 11:37:47 PDT 2011


Den 19-06-2011 14:00, Jacob Carlborg skrev:
> On 2011-06-18 22:36, jdrewsen wrote:
>> Hi,
>>
>> I've finally got through all the very constructive comments from the
>> last review of the curl wrapper and performed the needed changes.
>>
>> Here is the github branch:
>> https://github.com/jcd/phobos/tree/curl-wrapper
>>
>> And the generated docs:
>> http://freeze.steamwinter.com/D/web/phobos/etc_curl.html
>>
>> I do have some problems getting ddoc to show the documentation of
>> mixins. So in order to view the doc for byLine/byChunk methods you have
>> to look at the source.
>>
>> Anyway...this is what I've been up to:
>>
>> New features:
>>
>> * Full support for async/sync by line/chunk
>> * FTP support extended from only allowing download of a file sync into
>> full async/sync by line/chunk support
>> * Allow providing parameters such as credentials/timeouts when using the
>> convenience statis methods.
>>
>> Changes caused by last review:
>>
>> * rethink byLine/... to not return string in order to prevent
>> allocations. they should return char[]/ubyte[]
>> * 80 chars
>> * Http.Result not HttpResult
>> * gramma for http.postData
>> * len -> length
>> * perform http request -> perform a http ...
>> * authMethod to property
>> * curltimecond alias into module
>> * followlocation -> maxredirs
>> * http not class anymore but struct
>> * timecondition use std.datetime
>> * timeouts use core.duration
>> * Spelling "callbacks is not supported"
>> * refer to HTTP RFC describing the methods
>> * login/password example
>> * chuncked -> chunked
>> * max redirs; use uint.max and not -1
>> * isRunning returining short
>> * 4 chars tabs in examples.
>> * no space in examples.
>> * Send/recv use special structs in order not to mess with other
>> communications
>>
>> Comments are welcome.
>>
>> /Jonas
>
> Is the wrapper really supposed to be in the etc package? I thought that
> was just for the bindings?

I don't know where best place to put it is. In some way I think modules 
that introduces dependencies (libcurl in this case) is best handled by 
the hopefully upcoming dget/build2/??? functionality and thereby keeping 
phobos free of licensing issues.

Then there could be some official wrappers that are "blessed" meaning 
that the phobos community ensures that the quality is as good as phobos 
itself. I think the curl wrapper would fit in there nicely.

If this can be agreed upon then the module should probably be moved out 
of the etc package and become a root module. The etc.c.curl should 
probably be moved out of phobos at the same time.

/Jonas



More information about the Digitalmars-d mailing list