On Tue, Jun 10, 2014 at 10:58:12AM +0200, Mattias Bergvall wrote:
> I have an issue with LFTP (Version 4.4.15) when it comes to “misbehaving”
> mainframe remote sites.
> The problem occurs when the FTP server/proxy (IBM FTP CS V1R13) fails to
> get exclusive permissions to the target dataset (file).
> The server then issues a 125 message and terminates the connection. (Which
> I think is incorrect behavior, but that's not the point).
>
> What happens next is that lftp reconnects again (I have net:max-retries =
> 1. I don’t want it to retry!) and does NOT issue the SITE commands that
The problem with retries should be fixed in 4.5.2.
You can also try this patch for 4.5.2 which adds "ftp:site" setting for
tuning the connection after login. For your case it would be
set ftp:site "SBD=(IBM-278,ISO8859-1) LRECL=240 RECFM=FB"
(note the double spaces).
--
Alexander.
diff --git a/src/ftpclass.cc b/src/ftpclass.cc
index aa4cf6a..44be63d 100644
--- a/src/ftpclass.cc
+++ b/src/ftpclass.cc
@@ -1559,6 +1559,7 @@ int Ftp::Do()
TuneConnectionAfterFEAT();
SendSiteGroup();
SendSiteIdle();
+ SendSiteCommands();
if(!home_auto)
{
@@ -2648,6 +2649,23 @@ void Ftp::SendSiteGroup()
conn->SendCmd2("SITE GROUP",group);
expect->Push(Expect::IGNORE);
}
+void Ftp::SendSiteCommands()
+{
+ const char *site_commands=QueryStringWithUserAtHost("site");
+ if(!site_commands)
+ return;
+ char *cmd=alloca_strdup(site_commands);
+ for(;;) {
+ char *sep=strstr(cmd," ");
+ if(sep)
+*sep=0;
+ conn->SendCmd2("SITE",cmd);
+ expect->Push(Expect::IGNORE);
+ if(!sep)
+break;
+ cmd=sep+2;
+ }
+}
void Ftp::SendArrayInfoRequests()
{
diff --git a/src/ftpclass.h b/src/ftpclass.h
index c83c208..d762086 100644
--- a/src/ftpclass.h
+++ b/src/ftpclass.h
@@ -327,6 +327,7 @@ private:
voidSendSiteIdle();
voidSendAcct();
voidSendSiteGroup();
+ voidSendSiteCommands();
voidSendUTimeRequest();
void SendAuth(const char *auth);
void TuneConnectionAfterFEAT();
diff --git a/src/resource.cc b/src/resource.cc
index 6f63ed7..4aa071a 100644
--- a/src/resource.cc
+++ b/src/resource.cc
@@ -181,6 +181,7 @@ static ResType lftp_vars[] = {
{"ftp:fxp-passive-source", "no",
ResMgr::BoolValidate,ResMgr::NoClosure},
{"ftp:fxp-passive-sscn", "yes",
ResMgr::BoolValidate,ResMgr::NoClosure},
{"ftp:home", "", 0,0},
+ {"ftp:site" "", 0,0},
{"ftp:site-group", "", 0,0},
{"ftp:lang", "", 0,0},
{"ftp:list-empty-ok","no",0,0},
___
lftp mailing list
lftp@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp