cURL / Mailing Lists / curl-library / Single Mail


Re: Working with curl connections as with sockets.

From: Michal Marek <>
Date: Tue, 29 Apr 2008 11:46:54 +0200

tetetest tetetest wrote:
> I have attached the patch that adds curl_easy_send() and
> curl_easy_recv() functions to easy interface.

Some random comments, don't take me serious (I haven't tried it yet):

In the header file, calling the first argument 'data' is a bit
misleading, all other easy functions use 'curl'.

Could the reqlen and n arguments be merged into one in/out argument? Like
  size_t size = sizeof(buf)
  CURLcode ret = curl_easy_send(curl, buf, &size);

It would be nice if curl_easy_recv() returned a CURLcode, handling the
possible -1 from Curl_read().

The second argument to curl_easy_send() should be a const char *.

Curl_read() and Curl_write() expect a ssize_t pointer as last argument,
not size_t. Also if the public function are going to use size_t, you
need to handle negative values set by Curl_{read,write}.

You check for c == NULL a few lines after you set it, it would be more
readable if you checked right after setting it.

Why the "extra block for temporary ret1" in curl_easy_recv()?

Received on 2008-04-29