On Thu, Apr 18, 2002 at 02:44:31PM +0200, [EMAIL PROTECTED] wrote:
> Is there a method to force fxp transfers, I don't want the traffic over my
>connection.
> manpage says that it uses normal copy if fxp initialisation fails.
Please test this patch. It adds ftp:fxp-force setting.
--
Alexander.
Index: FileCopyFtp.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/FileCopyFtp.cc,v
retrieving revision 1.14
diff -u -p -r1.14 FileCopyFtp.cc
--- FileCopyFtp.cc 2001/10/25 10:46:33 1.14
+++ FileCopyFtp.cc 2002/04/23 10:46:49
@@ -89,6 +89,14 @@ int FileCopyFtp::Do()
disable_fxp=true;
((FileCopyPeerFA*)get)->SetFXP(false);
((FileCopyPeerFA*)put)->SetFXP(false);
+
+ if(ResMgr::QueryBool("ftp:fxp-force",ftp_src->GetHostName())
+ || ResMgr::QueryBool("ftp:fxp-force",ftp_dst->GetHostName()))
+ {
+ SetError(_("ftp:fxp-force is set but FXP is not available"));
+ return MOVED;
+ }
+
off_t pos=put->GetRealPos();
if(!get->CanSeek(pos) || !put->CanSeek(pos))
pos=0;
Index: ftpclass.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/ftpclass.cc,v
retrieving revision 1.242
diff -u -p -r1.242 ftpclass.cc
--- ftpclass.cc 2002/04/18 10:37:23 1.242
+++ ftpclass.cc 2002/04/23 10:51:03
@@ -3644,7 +3644,9 @@ const char *Ftp::CurrentStatus()
return(_("Waiting for response..."));
return(_("Making data connection..."));
case(CWD_CWD_WAITING_STATE):
- return(_("Changing remote directory..."));
+ if(FindLastCWD())
+ return(_("Changing remote directory..."));
+ /*fallthrough*/
case(WAITING_STATE):
if(copy_mode==COPY_SOURCE)
return "";
Index: resource.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/resource.cc,v
retrieving revision 1.73
diff -u -p -r1.73 resource.cc
--- resource.cc 2002/02/07 12:26:45 1.73
+++ resource.cc 2002/04/23 10:45:05
@@ -167,6 +167,7 @@ static ResDecl
ResDecl01a("ftp:auto-sync-mode", "", ResMgr::ERegExpValidate,0),
ResDecl01b("ftp:bind-data-socket", "yes", ResMgr::BoolValidate,0),
ResDecl01c("ftp:fix-pasv-address", "yes", ResMgr::BoolValidate,0),
+ ResDecl01d("ftp:fxp-force", "no", ResMgr::BoolValidate,0),
ResDecl02 ("ftp:fxp-passive-source", "no",
ResMgr::BoolValidate,ResMgr::NoClosure),
ResDecl02b("ftp:home", "", 0,0),
ResDecl02a("ftp:site-group", "", 0,0),