cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Working with curl connections as with sockets.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 12 May 2008 00:02:24 +0200 (CEST)

On Fri, 9 May 2008, Dan Fandrich wrote:

> Wouldn't these error codes be more descriptive as
> CURLE_BAD_FUNCTION_ARGUMENT and CURLE_UNSUPPORTED_PROTOCOL?

Thanks for your comments. I fixed some of them and then I realized I wasn't
too thrilled to see code copied from one place to appear on two more places so
I went over the code and made a helper function that's now used from getinfo.c
and easy.c to get the latest connection/socket, and then I made both
curl_easy_send() and curl_easy_recv() also use the same "setup" function
instead of duplicating code in both of those functions.

I think Curl_getconnectinfo() would benefit from being done slightly different
in the send/recv case than in the getinfo case, like how it verifies the
connection and does recv() on it. It is doomed to cause failures when used in
real life.

The resulting updated patch is attached. I think further tweaking can very
well be done after my initial commit.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Received on 2008-05-12