diff options
author | des <des@FreeBSD.org> | 1998-12-16 10:24:55 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 1998-12-16 10:24:55 +0000 |
commit | 37f6ae6efa76ffd76030b285155c142929e27e71 (patch) | |
tree | 46bd30e5ec6a8aa52bcbef848e3726d299305880 /lib/libfetch/ftp.c | |
parent | 0dfe97f554b9685389c9e58615db7e9453368503 (diff) | |
download | FreeBSD-src-37f6ae6efa76ffd76030b285155c142929e27e71.zip FreeBSD-src-37f6ae6efa76ffd76030b285155c142929e27e71.tar.gz |
Add verbose flag, and support functions.
Brucify the Makefile.
Differentiate atime and mtime in fetch*Stat().
Fix a few pointer bugs.
Tweak some error messages.
Don't #include sys/param.h and stdio.h in fetch.h.
Document that sys/param.h and stdio.h must be #included before fetch.h.
Diffstat (limited to 'lib/libfetch/ftp.c')
-rw-r--r-- | lib/libfetch/ftp.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 81da7f8..2e2e8a2 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ftp.c,v 1.6 1998/11/05 19:48:17 des Exp $ + * $Id: ftp.c,v 1.7 1998/11/06 22:14:08 des Exp $ */ /* @@ -55,7 +55,7 @@ * */ -#include <sys/types.h> +#include <sys/param.h> #include <sys/socket.h> #include <netinet/in.h> #include <sys/errno.h> @@ -71,7 +71,7 @@ #include "fetch.h" #include "common.h" -#include "ftperr.inc" +#include "ftperr.h" #define FTP_DEFAULT_TO_ANONYMOUS #define FTP_ANONYMOUS_USER "ftp" @@ -275,7 +275,7 @@ ouch: * Log on to FTP server */ static FILE * -_ftp_connect(char *host, int port, char *user, char *pwd) +_ftp_connect(char *host, int port, char *user, char *pwd, int verbose) { int sd, e, pp = FTP_DEFAULT_PORT; char *p, *q; @@ -289,12 +289,12 @@ _ftp_connect(char *host, int port, char *user, char *pwd) } if (q) *q = 0; - sd = fetchConnect(p, pp); + sd = fetchConnect(p, pp, verbose); if (q) *q = ':'; } else { /* no proxy, go straight to target */ - sd = fetchConnect(host, port); + sd = fetchConnect(host, port, verbose); } /* check connection */ @@ -398,7 +398,8 @@ fetchXxxFTP(struct url *url, char *oper, char *mode, char *flags) /* connect to server */ if (!cf) { - cf = _ftp_connect(url->host, url->port, url->user, url->pwd); + cf = _ftp_connect(url->host, url->port, url->user, url->pwd, + (strchr(flags, 'v') != NULL)); if (!cf) return NULL; if (cached_socket) |