diff options
Diffstat (limited to 'lib/libftp/FtpPasv.c')
-rw-r--r-- | lib/libftp/FtpPasv.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/libftp/FtpPasv.c b/lib/libftp/FtpPasv.c index 3db132a..3dd52fe 100644 --- a/lib/libftp/FtpPasv.c +++ b/lib/libftp/FtpPasv.c @@ -1,9 +1,9 @@ /* Library for ftpd clients.(libftp) Copyright by Oleg Orel All rights reserved. - -This library is desined for free, non-commercial software creation. -It is changeable and can be improved. The author would greatly appreciate + +This library is desined for free, non-commercial software creation. +It is changeable and can be improved. The author would greatly appreciate any advises, new components and patches of the exist ing programs. Commercial usage is also possible with participation of it's author. @@ -21,27 +21,27 @@ char * FtpPasv (FTP *ftp) char *msg; static String PORT; char *p=PORT; - - if FtpError(FtpCommand(ftp,"PASV","",227,EOF)) + + if FtpError(FtpCommand(ftp,"PASV","",227,EOF)) return ""; - + msg = FtpMessage (227); msg+=3; - - while (!isdigit(*msg++)); + + while (!isdigit(*msg++)); msg--; while (isdigit(*msg)||*msg==',') *p++=*msg++; *p=0; - + return PORT; } STATUS FtpLink(FTP *ftp1, FTP *ftp2) { - + String PORT; strcpy(PORT,FtpPasv(ftp1)); @@ -62,12 +62,12 @@ STATUS FtpPassiveTransfer(FTP *ftp1, FTP *ftp2, char *f1, char *f2) FtpAssert(ftp2,FtpCommand(ftp2,"STOR %s",f2, 200, 120 , 150 , 125 , 250 , EOF )); FtpAssert(ftp1,FtpCommand(ftp1,"RETR %s",f1, 200, 120 , 150 , 125 , 250 , EOF )); - + FD_ZERO(&fds); - + FD_SET(fileno(FTPCMD(ftp1)),&fds); FD_SET(fileno(FTPCMD(ftp2)),&fds); - + if (select(getdtablesize(),&fds,0,0,0)<0) { if (ftp1->error!=NULL) @@ -76,7 +76,7 @@ STATUS FtpPassiveTransfer(FTP *ftp1, FTP *ftp2, char *f1, char *f2) return (*(ftp2->error))(ftp1,QUIT,sys_errlist[errno]); return QUIT; } - + if (FD_ISSET(fileno(FTPCMD(ftp1)),&fds)) { FtpGetMessage(ftp1,tmp); |