cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Working with curl connections as with sockets.

From: Yang Tse <yangsita_at_gmail.com>
Date: Tue, 29 Apr 2008 17:08:00 +0200

2008/4/29, Michal Marek wrote:
> tetetest tetetest wrote:
> >> The second argument to curl_easy_send() should be a const char *.
> >
> > Hmmm... Curl_write() uses "void*" for this parameter, so there will be a
> > cast... Or am I thinking C++?
>
> We can fix Curl_write() to take a const pointer, AFAICS there buffer is
> really left intact by all the *_send functions.

Even better just use "void *mem" for the second argument. The benefits
for this are:

No const poisoning all over the place, and respective compiler warnings.
Not introduction of signed vs unsigned char issues, and respective
compiler warnings.
Not force the user buffer to be sent to be of any particular type, its
just a chunk of memory and it can very well be dereferenced with a
void pointer.
No need to 'fix' what is not broken.

-- 
-=[Yang]=-
Received on 2008-04-29