cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl_read_plain and test 160

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 24 Sep 2008 13:01:23 -0700

On Tue, Sep 23, 2008 at 10:47:58PM +0200, Daniel Stenberg wrote:
> I had to disable test 160 since it now fails on me because now we detect
> the error properly much earlier and thus the late detection an error that
> test 160 is about no longer happens. Possibly some or all of the failures
> you see are similar? I'll have to check autobuild logs to figure these
> out!

I looked at all the test failures that I'm seeing and they all involve
tests that have multiple passes and the server closes the connection after
the first pass. The problem appears to be due to a race condition: the
server closes the connection but just after curl sends the next request.
When curl tries to read the response it sees that the connection is dead
so then returns with an error.

It seems that something very similar happened before this patch, but
for one critical read the error was supressed. In that case, curl did
detect the situation immediately afterward and retry the request, saying
"Connection died, trying a fresh connect".

> I did read over the Curl_sec_read() code before I did the change, and I
> got the impression that the errno stuff that followed basically was
> intended for the plain socket case so I thought the removal of the code
> for the krb4 case would be safe... I guess I could've screwed up and thus
> the EAGAIN things are needed for the krb4 case of nread == -1 as well!

In at least one code path in Curl_sec_read(), it returns the value from
read() directly.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-09-24