On Thu, Jan 31, 2008 at 05:27:49AM +0000, Charlie Allom wrote:
> Hi. ProFTPd seems to be kicking me off when I create directories with a
> mirror -R. in 3.5.x this was fine - lftp reconnected.
>
> With 3.6.x - lftp just hangs.

Please test attached patch.

--
   Alexander.
Index: ftpclass.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ftpclass.cc,v
retrieving revision 1.436
diff -u -p -r1.436 ftpclass.cc
--- ftpclass.cc 23 Jan 2008 13:16:53 -0000      1.436
+++ ftpclass.cc 31 Jan 2008 07:39:21 -0000
@@ -328,6 +328,9 @@ 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;
@@ -2111,13 +2114,14 @@ int   Ftp::Do()
 
    pre_waiting_150:
       state=WAITING_150_STATE;
+      waiting_150_timer.Reset();
       m=MOVED;
    case WAITING_150_STATE:
       m|=FlushSendQueue();
       m|=ReceiveResp();
       if(state!=WAITING_150_STATE || Error())
          return MOVED;
-      if(!conn->received_150)
+      if(!conn->received_150 && !expect->IsEmpty() && 
!waiting_150_timer.Stopped())
         goto usual_return;
 
       // now init data connection properly and start data exchange
@@ -4245,6 +4249,7 @@ void Ftp::ResetLocationData()
    Reconfig();
    state=INITIAL_STATE;
    stat_timer.SetResource("ftp:stat-interval",hostname);
+   waiting_150_timer.SetResource("ftp:waiting-150-timeout",hostname);
 }
 
 bool Ftp::AnonymousQuietMode()
Index: ftpclass.h
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ftpclass.h,v
retrieving revision 1.152
diff -u -p -r1.152 ftpclass.h
--- ftpclass.h  18 Oct 2007 13:27:16 -0000      1.152
+++ ftpclass.h  31 Jan 2008 07:21:25 -0000
@@ -295,6 +295,7 @@ private:
 
    Timer retry_timer;
    Timer stat_timer;      // timer for sending periodic STAT commands.
+   Timer waiting_150_timer;   // limit time to wait for 150 reply.
 
    void         DataAbort();
    void  DataClose();
Index: resource.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/resource.cc,v
retrieving revision 1.148
diff -u -p -r1.148 resource.cc
--- resource.cc 21 Jan 2008 14:07:02 -0000      1.148
+++ resource.cc 31 Jan 2008 07:24:51 -0000
@@ -223,6 +223,7 @@ static ResType lftp_vars[] = {
    {"ftp:verify-address",       "no",    ResMgr::BoolValidate,0},
    {"ftp:verify-port",          "no",    ResMgr::BoolValidate,0},
    {"ftp:web-mode",             "off",   ResMgr::BoolValidate,0},
+   {"ftp:waiting-150-timeout",  "5",     ResMgr::TimeIntervalValidate,0},
 #define RETRY_530 \
    "too many|overloaded|try (again |back )?later|is restricted to|"\
    "maximum number|number of connect|only.*session.*allowed|more 
connection|already connected"

Reply via email to