diff options
author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1995-04-25 15:05:11 +0000 |
---|---|---|
committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1995-04-25 15:05:11 +0000 |
commit | 6f52f41fb2b710f9af14cc0267f4d0bb22253c5d (patch) | |
tree | 88cfa9d7eaa46d2f2d75ccd97c6e76dd615873a2 /lib/libftp/FtpAbort.c | |
parent | 6ec8ee4578b437c8a5473e3d8b706cb73c9e3e1d (diff) | |
download | src-6f52f41fb2b710f9af14cc0267f4d0bb22253c5d.tar.gz src-6f52f41fb2b710f9af14cc0267f4d0bb22253c5d.zip |
A programmatic interface to ftp. I need this for several other
components of the system.
The license is poorly worded, though I have an (email only) release
from the author for unlimited FreeBSD use. I will try to get something
more concrete, though the author's remote location makes this difficult.
Submitted by: Oleg Orel <orel@oea.ihep.su>
Notes
Notes:
svn path=/cvs2svn/branches/libftp/; revision=8064
Diffstat (limited to 'lib/libftp/FtpAbort.c')
-rw-r--r-- | lib/libftp/FtpAbort.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/libftp/FtpAbort.c b/lib/libftp/FtpAbort.c new file mode 100644 index 000000000000..50b32e6d89fc --- /dev/null +++ b/lib/libftp/FtpAbort.c @@ -0,0 +1,47 @@ +/* + 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 +any advises, new components and patches of the existing programs. +Commercial usage is also possible with participation of it's author. + + + +*/ + +#include "FtpLibrary.h" + + +FtpAbort(FTP *ftp) +{ + fd_set fds; + char msgc=IAC; + String msg; + + FD_ZERO(&fds); + FD_SET(fileno(FTPCMD(ftp)),&fds); + + FtpPutc(ftp, FTPCMD(ftp), IAC); + FtpPutc(ftp, FTPCMD(ftp), IP); + + if ( send ( fileno(FTPCMD(ftp)), &msgc , 1 ,MSG_OOB) != 1 ) + return EXIT(ftp,QUIT); + + FtpPutc(ftp, FTPCMD(ftp), DM); + + FtpSendMessage(ftp,"ABOR"); + + while (select ( getdtablesize(), &fds, 0,0, &(ftp->timeout) )>0) + { + register int i; + + FtpGetMessage(ftp,msg); + if (FtpGood(FtpNumber(msg),225,226,EOF)) break; + } +} + + + |