Curl wrapper round two

Jose Armando Garcia jsancio at gmail.com
Tue Jun 21 21:11:37 PDT 2011


>> Hi Jonas,
>>
>> Was reading your implementation but I had to context switch. Only go
>> to line 145 :(. I see that you are refcounting by sharing a uint* but
>> what about all the other private fields? What happens if you pass the
>> Curl object around functions and those values are modified?
>>
>> Thanks,
>> -Jose
>
> The refcounting is actually just needed to keep the "handle" alive under
> construction of the Curl object using "Curl()". I'm using "Curl()" by
> defining opCall on Curl in order not to have a struct constructor with a
> dummy parameter (structs cannot have a default constructor defined).
>
> After that the Curl instance will always be assigned to a member variable of
> Http/Ftp classes. Instances of Http/Ftp are not to be copied because they
> are used for RAII.
>
Http/Ftp are structs not classes. Let me try to understand this. You
mean to say that the Http and Ftp struct are not to be passed to other
functions? Are you expecting the user to do all their IO in one scope?
This is unnecessarily limiting.

-Jose


More information about the Digitalmars-d mailing list