On Sat, Feb 08, 2003 at 02:19:00AM +0100, Hans Christian Saustrup wrote:
> ---> PASV
> <--- 227 Entering Passive Mode (66,230,140,25,131,38).
> ---- Connecting data socket to (xxx.xxx.xxx.xxx) port 33574
> ---> NLST
> **** Connection reset by peer
> Server is ProFTPD Version 1.2.8rc2
Does attached patch fix it?
> Another thing; when using filename completion with TAB after this
> command: "mirror -R -c ", it completes remote files instead of local.
> Perhaps the completion code could check if the command matched
> /mirror.*-R/ or something like that?
It is a known misfeature. It is not quite easy to find -R option correctly
in completion routine. Patches are welcome.
--
Alexander. | http://www.yars.free.net/~lav/
Index: FileAccess.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/FileAccess.cc,v
retrieving revision 1.104
diff -u -p -r1.104 FileAccess.cc
--- FileAccess.cc 26 Sep 2002 10:45:34 -0000 1.104
+++ FileAccess.cc 6 Feb 2003 15:34:01 -0000
@@ -859,6 +859,7 @@ bool FileAccess::NotSerious(int e)
{
switch(e)
{
+ case(EPIPE):
case(ETIMEDOUT):
#ifdef ECONNRESET
case(ECONNRESET):
Index: ftpclass.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ftpclass.cc,v
retrieving revision 1.253
diff -u -p -r1.253 ftpclass.cc
--- ftpclass.cc 25 Dec 2002 13:44:31 -0000 1.253
+++ ftpclass.cc 6 Feb 2003 13:17:34 -0000
@@ -1473,7 +1473,7 @@ int Ftp::Do()
if(bind(data_sock,&data_sa.sa,addr_len)<0)
{
sprintf(str,"bind(data_sock): %s",strerror(errno));
- DebugPrint("**** ",str,0);
+ DebugPrint("**** ",str,10);
}
}
}
@@ -2444,7 +2444,7 @@ void Ftp::SendUrgentCmd(const char *cmd)
void Ftp::DataAbort()
{
- if(control_sock==-1 || state==CONNECTING_STATE)
+ if(control_sock==-1 || state==CONNECTING_STATE || quit_sent)
return;
if(data_sock==-1 && copy_mode==COPY_NONE)
@@ -3069,6 +3069,12 @@ read_again:
return DO_AGAIN;
if(NotSerious(errno))
{
+ if(errno==ECONNRESET && mode==LIST && real_pos==0)
+ {
+ // workaround for some proftpd servers.
+ DebugPrint("**** ",strerror(errno),0);
+ goto we_have_eof;
+ }
DebugPrint("**** ",strerror(errno),0);
quit_sent=true;
Disconnect();