cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl_read_plain and test 160

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 25 Sep 2008 09:33:00 +0200 (CEST)

On Wed, 24 Sep 2008, Tor Arntsen wrote:

>> CURLcode ret = Curl_read_plain(sockfd, buffertofill, bytesfromsocket,
>> &nread);
>> - if(ret)
>> + if(ret < 0)

> A negative value isn't even a valid Curlcode.. Curl_read_plain() can return
> -1 now, but it's supposed to return only Curlcode values so we currently get
> these kind of build warnings:
> http://curl.haxx.se/auto/log.cgi?id=20080924053141-11635#prob1

Right, the function should be fixed to instead return an int. We use such a
negative value at some other places in the code to indicate a "would-block"
situation and I just wanted to do the same in this new function. I'll fix
soonish.

Thanks for pointing this out.

-- 
  / daniel.haxx.se
Received on 2008-09-25