cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Active FTP failures while lacking available file handles

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 29 Nov 2011 19:53:01 +0100 (CET)

On Tue, 29 Nov 2011, Gokhan Sengun wrote:

> Regarding bug #3429299, I noticed another problem.

It's not really "another", it is related.

> when server replies with
>
> 150 Opening data channel for file transfer.
> 425 Can't open data connection.
>
> Most of the time, curl is disposing message 425. I have not debug it yet so
> do not have an idea who eats the message.

It happens because libcurl will read whatever the server sends, and that may
very well be more than just "a line". libcurl itself doesn't even have a
concept of lines until it parses what it has received over the network.

So libcurl probably read both lines at once, and then it parsed just the 150
line before it went waiting for the server to connect. If it had just "peaked"
beyond the 150 line in the buffer it already has, it would've found the 425
status.

> Any idea to help me debug this one?

The ftp_state_get_resp() function should check if there is more data in the
line buffer to read than the 150/125 code it got, and in that case it needs to
keep reading the entire coming response before it goes on.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-29