From 38d4e6e59c9ce5ae46fcef57560141ee1015363e Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 4 Jul 2011 10:07:08 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : Tentativo di miglioramento del procotollo FTP: nel caso non funzioni il trasferimento in passive mode, ritenti con l'active. git-svn-id: svn://10.65.10.50/branches/R_10_00@22363 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/xvaga.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index 6b0be5467..e289a3a19 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -1905,9 +1905,19 @@ BOOLEAN xvt_fsys_set_dir(const DIRECTORY *dirp) BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest) { wxURL orig_url(orig); - wxURL dest_url(dest); wxInputStream * input = orig_url.GetInputStream(); - wxOutputStream * output = NULL; + + if (input == NULL && orig_url.GetScheme() == "ftp") + { + wxFTP& ftp = (wxFTP&)orig_url.GetProtocol(); + ftp.SetPassive(false); + input = orig_url.GetInputStream(); + if (input == NULL) + return FALSE; + } + + wxURL dest_url(dest); + wxOutputStream* output = NULL; wxString scheme = dest_url.GetScheme(); if (input == NULL) @@ -1922,7 +1932,6 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest) const wxString fnDir = fnPath.GetPath(wxPATH_GET_VOLUME, wxPATH_UNIX); const wxString fnName = fnPath.GetFullName(); - if (!strUser.IsEmpty()) { ftp.SetUser(strUser); @@ -1967,7 +1976,7 @@ BOOLEAN xvt_fsys_fcopy(const char* orig, const char* dest) else output = new wxFileOutputStream(dest); - bool ok = false; + BOOLEAN ok = FALSE; if (input != NULL && output != NULL) { input->Read(*output);