On Thu, Jan 31, 2008 at 08:55:11AM +0000, Charlie Allom wrote:
> thanks - this reconnects again like 3.5 but there is something more
> subtle going on.
Please try this additional patch.
--
Alexander.
Index: ftpclass.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ftpclass.cc,v
retrieving revision 1.437
diff -u -p -r1.437 ftpclass.cc
--- ftpclass.cc 31 Jan 2008 07:55:14 -0000 1.437
+++ ftpclass.cc 6 Feb 2008 06:38:22 -0000
@@ -328,9 +328,6 @@ bool Ftp::Transient5XX(int act)
// 226 Transfer complete.
void Ftp::TransferCheck(int act)
{
- if(state==WAITING_150_STATE)
- conn->received_150=true;
-
if(act==225 || act==226) // data connection is still open or ABOR worked.
{
copy_done=true;
@@ -2203,6 +2200,14 @@ int Ftp::Do()
{
LogError(0,"%s",conn->data_iobuf->ErrorText());
conn->CloseDataSocket();
+ // workaround for proftpd bug - it resets data connection when no
files found.
+ if(mode==LIST && expect->IsEmpty() && !conn->received_150 &&
conn->data_iobuf->GetPos()==0)
+ {
+ DataClose();
+ state=EOF_STATE;
+ eof=true;
+ m=MOVED;
+ }
}
// handle errors on data connection only when storing or got all replies
// and read all data.
@@ -2581,6 +2586,13 @@ int Ftp::ReceiveOneLine()
skip_len=nl-resp+1;
break;
}
+ if(nl==resp+resp_size-1 && now-conn->control_recv->EventTime()>5)
+ {
+ LogError(1,"server bug: single <NL>");
+ line_len=nl-resp;
+ skip_len=nl-resp+1;
+ break;
+ }
nl=find_char(nl+1,resp_size-(nl+1-resp),'\n');
}