diff options
author | jkh <jkh@FreeBSD.org> | 1996-08-03 11:58:54 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-08-03 11:58:54 +0000 |
commit | a4480ef9cabae82a7887b55c4bc691c3d4434780 (patch) | |
tree | 46e32e7fb5ec72b94790443de1dc7372d1a9ed47 /lib/libftpio/ftpio.c | |
parent | ff8fc6b6643b6d7414e787636faa158fbc5916d5 (diff) | |
download | FreeBSD-src-a4480ef9cabae82a7887b55c4bc691c3d4434780.zip FreeBSD-src-a4480ef9cabae82a7887b55c4bc691c3d4434780.tar.gz |
1. Add verbose flag to ftp_login()
2. Remove pkg_* support - tcl7.5's channel interface has rendered this
almost entirely unsupportable (at least in the way it currently stands).
Submitted-By: jmz & jkh
Diffstat (limited to 'lib/libftpio/ftpio.c')
-rw-r--r-- | lib/libftpio/ftpio.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c index 533c565..c9b18ca 100644 --- a/lib/libftpio/ftpio.c +++ b/lib/libftpio/ftpio.c @@ -14,7 +14,7 @@ * Turned inside out. Now returns xfers as new file ids, not as a special * `state' of FTP_t * - * $Id: ftpio.c,v 1.7 1996/06/22 21:43:54 jkh Exp $ + * $Id: ftpio.c,v 1.8 1996/07/04 00:55:20 jkh Exp $ * */ @@ -57,7 +57,7 @@ static __inline char *get_a_line(FTP_t ftp); static int get_a_number(FTP_t ftp, char **q); static int botch(char *func, char *botch_state); static int cmd(FTP_t ftp, const char *fmt, ...); -static int ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port); +static int ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port, int verbose); static int ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, int *seekto); static int ftp_close(FTP_t ftp); static int get_url_info(char *url_in, char *host_ret, int *port_ret, char *name_ret); @@ -231,7 +231,7 @@ ftpGet(FILE *fp, char *file, int *seekto) /* Returns a standard FILE pointer type representing an open control connection */ FILE * -ftpLogin(char *host, char *user, char *passwd, int port) +ftpLogin(char *host, char *user, char *passwd, int port, int verbose) { FTP_t n; FILE *fp; @@ -241,7 +241,7 @@ ftpLogin(char *host, char *user, char *passwd, int port) n = ftp_new(); fp = NULL; - if (n && ftp_login_session(n, host, user, passwd, port) == SUCCESS) { + if (n && ftp_login_session(n, host, user, passwd, port, verbose) == SUCCESS) { fp = funopen(n, ftp_read_method, ftp_write_method, NULL, ftp_close_method); /* BSD 4.4 function! */ fp->_file = n->fd_ctrl; } @@ -289,7 +289,7 @@ ftpGetURL(char *url, char *user, char *passwd) fp = NULL; } if (get_url_info(url, host, &port, name) == SUCCESS) { - fp = ftpLogin(host, user, passwd, port); + fp = ftpLogin(host, user, passwd, port, 0); if (fp) { fp2 = ftpGet(fp, name, NULL); return fp2; @@ -311,7 +311,7 @@ ftpPutURL(char *url, char *user, char *passwd) fp = NULL; } if (get_url_info(url, host, &port, name) == SUCCESS) { - fp = ftpLogin(host, user, passwd, port); + fp = ftpLogin(host, user, passwd, port, 0); if (fp) { fp2 = ftpPut(fp, name); return fp2; @@ -550,7 +550,7 @@ cmd(FTP_t ftp, const char *fmt, ...) } static int -ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port) +ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port, int verbose) { struct hostent *he = NULL; struct sockaddr_in sin; @@ -600,6 +600,7 @@ ftp_login_session(FTP_t ftp, char *host, char *user, char *passwd, int port) ftp->fd_ctrl = s; ftp->con_state = isopen; + ftp->is_verbose = verbose; i = cmd(ftp, "USER %s", user); if (i >= 300 && i < 400) |