diff options
| author | 2002-06-05 16:43:56 +0000 | |
|---|---|---|
| committer | 2002-06-05 16:43:56 +0000 | |
| commit | 04c2e3d6e882fa8e4f31cf4e85f3b31fa58782ab (patch) | |
| tree | 253a37193861bff2a771cfff3fde15e1cd9e6fc3 /gnu/usr.bin/lynx/WWW/Library/Implementation/HTFile.c | |
| parent | mention $SSH_AUTH_SOCK; dave@ugc.org.uk (diff) | |
| download | wireguard-openbsd-04c2e3d6e882fa8e4f31cf4e85f3b31fa58782ab.tar.xz wireguard-openbsd-04c2e3d6e882fa8e4f31cf4e85f3b31fa58782ab.zip | |
default to passive, upgrade to active as needed; Andrew Basterfield
list@lostgeneration.freeserve.co.uk
Diffstat (limited to 'gnu/usr.bin/lynx/WWW/Library/Implementation/HTFile.c')
| -rw-r--r-- | gnu/usr.bin/lynx/WWW/Library/Implementation/HTFile.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gnu/usr.bin/lynx/WWW/Library/Implementation/HTFile.c b/gnu/usr.bin/lynx/WWW/Library/Implementation/HTFile.c index f0b294e7952..35d77ea679a 100644 --- a/gnu/usr.bin/lynx/WWW/Library/Implementation/HTFile.c +++ b/gnu/usr.bin/lynx/WWW/Library/Implementation/HTFile.c @@ -1848,6 +1848,7 @@ PUBLIC int HTLoadFile ARGS4( { char * filename = NULL; char * acc_method = NULL; + char * ftp_newhost; HTFormat format; char * nodename = NULL; char * newname = NULL; /* Simplified name of file */ @@ -1886,7 +1887,21 @@ PUBLIC int HTLoadFile ARGS4( FREE(nodename); FREE(acc_method); #ifndef DISABLE_FTP - return HTFTPLoad(addr, anchor, format_out, sink); + ftp_newhost = HTParse(addr, "", PARSE_HOST); /* HTParse mallocs */ + if (strcmp(ftp_lasthost, ftp_newhost)) + ftp_local_passive = ftp_passive; /* set to default */ + + status = HTFTPLoad(addr, anchor, format_out, sink); + + if ( ftp_passive == ftp_local_passive ) { + if (( status <= -4 ) || ( status == -1 )) { + ftp_local_passive = !ftp_passive; + status = HTFTPLoad(addr, anchor, format_out, sink); + } + } + free(ftp_lasthost); + ftp_lasthost = ftp_newhost; + return status; #else return -1; #endif /* DISABLE_FTP */ |
