curl-library
Re: Probable bug in ftp_readresp()
Date: Fri, 21 Aug 2009 15:42:39 +0200 (CEST)
On Thu, 20 Aug 2009, Patrick Monnerat wrote:
> Then libcurl sends "QUIT" and expects the server response, but meanwhile the
> server has closed the control connection (I don't know why... Server
> crash?). Call to read() in the loop expecting the QUIT response always
> returns -1 (with err = ECONNRESET: Connection reset by peer). Thus in
> ftp_readresp(), res = CURLE_RECV_ERROR (line 430), keepon = FALSE (448),
> code = 0 (570) because result is still CURLE_OK, *ftpcode = 0 (591) and
> returns CURL_OK (598) --> loops forever.
>
> I've tried to look at the ftp_readresp() procedure and it seems there is
> some confusion between the "result" procedure variable (that stays set to
> CURLE_OK) and the "res" block variable (defined line 423), that is set to
> CURLE_RECV_ERROR. However, I don't feel comfortable enough with this code to
> provide a patch.
Okey, great research! Based on this input I'll give it a closer look within a
couple of days. Can you repeat this with any certainty? I mean if I produce a
patch for this, could you run it and see if it fixes anything?
-- / daniel.haxx.seReceived on 2009-08-21