cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] ftp: prevent server from hanging on closed data connection

From: Number Cruncher <number.cruncher_at_ntlworld.com>
Date: Thu, 04 Nov 2010 17:57:01 +0000

  On 04/11/10 17:22, Kamil Dudka wrote:
> On Thursday 04 November 2010 18:08:27 Number Cruncher wrote:
>> On 04/11/10 16:32, Kamil Dudka wrote:
>>> It sounds like a good idea. But how would we recognize the case we
>>> need to
>>> wait for some additional response?
>>>
>>> I am considering the following scenarios:
>>>
>>> 1)> ABOR
>>> < 225 ABOR command successful.
>>>
>>> 2)> ABOR
>>> < 226 Since you see this ABOR must've succeeded
>>>
>>> 3)> ABOR
>>> < 226 File send OK.
>>> < 225 No transfer to ABOR.
>>>
>>> 4)> ABOR
>>> < 426 Failure writing network stream.
>>> < 225 No transfer to ABOR.
>> This would certainly work for the case that I was observing and I can't
>> think of any other response code combinations that make sense.
> I don't think I understand. How are we supposed to distinguish among 2)
> and 3). Consider the point we got 226. We need somehow to decide if
> the next response will come eventually or not. Is it really possible to
> do so while operating with the integral status codes only?
>
> Kamil

Good point. I don't think you can tell the difference. I suppose you
could keep receiving data *until* you received a 225 or 226 and then
check if you've actually received the whole file. If so, expect a 225
(No transfer to ABOR).

Alternatively, just drop the whole session and reconnect later....

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