diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fetch.c | 13 | ||||
-rw-r--r-- | src/ftp.1 | 15 | ||||
-rw-r--r-- | src/ftp_var.h | 6 | ||||
-rw-r--r-- | src/main.c | 21 | ||||
-rw-r--r-- | src/ssl.c | 14 | ||||
-rw-r--r-- | src/ssl.h | 6 | ||||
-rw-r--r-- | src/version.h | 8 |
7 files changed, 53 insertions, 30 deletions
diff --git a/src/fetch.c b/src/fetch.c index 6981f77fff86..d0f40d3f99f3 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -1,8 +1,8 @@ -/* $NetBSD: fetch.c,v 1.20 2014/10/31 03:37:59 lukem Exp $ */ -/* from NetBSD: fetch.c,v 1.206 2014/10/26 16:21:59 christos Exp */ +/* $NetBSD: fetch.c,v 1.21 2015/10/04 04:53:26 lukem Exp $ */ +/* from NetBSD: fetch.c,v 1.207 2015/09/12 19:38:42 wiz Exp */ /*- - * Copyright (c) 1997-2009 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2015 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -11,6 +11,9 @@ * This code is derived from software contributed to The NetBSD Foundation * by Scott Aaron Bamford. * + * This code is derived from software contributed to The NetBSD Foundation + * by Thomas Klausner. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -39,7 +42,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID(" NetBSD: fetch.c,v 1.206 2014/10/26 16:21:59 christos Exp "); +__RCSID(" NetBSD: fetch.c,v 1.207 2015/09/12 19:38:42 wiz Exp "); #endif /* not lint */ /* @@ -789,7 +792,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) #ifdef WITH_SSL if (urltype == HTTPS_URL_T) { - if ((ssl = fetch_start_ssl(s)) == NULL) { + if ((ssl = fetch_start_ssl(s, host)) == NULL) { close(s); s = -1; continue; diff --git a/src/ftp.1 b/src/ftp.1 index f6a3516d8b39..3180f005ca5f 100644 --- a/src/ftp.1 +++ b/src/ftp.1 @@ -1,7 +1,7 @@ -.\" $NetBSD: ftp.1,v 1.14 2013/05/05 11:17:30 lukem Exp $ -.\" from NetBSD: ftp.1,v 1.134 2012/12/22 16:57:10 christos Exp +.\" $NetBSD: ftp.1,v 1.15 2015/10/04 04:53:26 lukem Exp $ +.\" from NetBSD: ftp.1,v 1.135 2015/04/23 23:31:23 lukem Exp .\" -.\" Copyright (c) 1996-2010 The NetBSD Foundation, Inc. +.\" Copyright (c) 1996-2015 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation @@ -58,7 +58,7 @@ .\" .\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 .\" -.Dd December 22, 2012 +.Dd April 24, 2015 .Dt FTP 1 .Os .Sh NAME @@ -85,6 +85,7 @@ .Xc .Oc .Ek +.Op Fl x Ar xferbufsize .Bk -words .\" [[user@]host [port]] .Oo @@ -312,6 +313,12 @@ Forces .Nm to show all responses from the remote server, as well as report on data transfer statistics. +.It Fl x Ar xferbufsize +Set the size of the socket send and receive buffers to +.Ar xferbufsize . +Refer to +.Ic xferbuf +for more information. .El .Pp The client host with which diff --git a/src/ftp_var.h b/src/ftp_var.h index 79ac75decc61..50f9c9a25b69 100644 --- a/src/ftp_var.h +++ b/src/ftp_var.h @@ -1,5 +1,5 @@ -/* $NetBSD: ftp_var.h,v 1.11 2013/05/05 11:17:31 lukem Exp $ */ -/* from NetBSD: ftp_var.h,v 1.82 2012/12/21 18:07:36 christos Exp */ +/* $NetBSD: ftp_var.h,v 1.12 2015/10/04 04:53:26 lukem Exp $ */ +/* from NetBSD: ftp_var.h,v 1.83 2015/01/12 14:17:08 christos Exp */ /*- * Copyright (c) 1996-2009 The NetBSD Foundation, Inc. @@ -174,7 +174,7 @@ enum { /* * Global defines */ -#define FTPBUFLEN MAXPATHLEN + 200 +#define FTPBUFLEN (4 * MAXPATHLEN) #define MAX_IN_PORT_T 0xffffU #define HASHBYTES 1024 /* default mark for `hash' command */ diff --git a/src/main.c b/src/main.c index 73390671ff37..8237d4dfb483 100644 --- a/src/main.c +++ b/src/main.c @@ -1,8 +1,8 @@ -/* $NetBSD: main.c,v 1.19 2013/05/05 11:48:16 lukem Exp $ */ -/* from NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp */ +/* $NetBSD: main.c,v 1.20 2015/10/04 04:53:26 lukem Exp $ */ +/* from NetBSD: main.c,v 1.123 2015/04/23 23:31:23 lukem Exp */ /*- - * Copyright (c) 1996-2009 The NetBSD Foundation, Inc. + * Copyright (c) 1996-2015 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -96,14 +96,14 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\ The Regents of the University of California. All rights reserved.\ - Copyright 1996-2008 The NetBSD Foundation, Inc. All rights reserved"); + Copyright 1996-2015 The NetBSD Foundation, Inc. All rights reserved"); #endif /* not lint */ #ifndef lint #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94"; #else -__RCSID(" NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp "); +__RCSID(" NetBSD: main.c,v 1.123 2015/04/23 23:31:23 lukem Exp "); #endif #endif /* not lint */ @@ -275,7 +275,7 @@ main(int volatile argc, char **volatile argv) } } - while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:Rs:tT:u:vV")) != -1) { + while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:Rs:tT:u:vVx:")) != -1) { switch (ch) { case '4': family = AF_INET; @@ -417,6 +417,13 @@ main(int volatile argc, char **volatile argv) progress = verbose = 0; break; + case 'x': + sndbuf_size = strsuftoi(optarg); + if (sndbuf_size < 1) + errx(1, "Bad xferbuf value: %s", optarg); + rcvbuf_size = sndbuf_size; + break; + default: usage(); } @@ -1054,7 +1061,7 @@ usage(void) (void)fprintf(stderr, "usage: %s [-46AadefginpRtVv] [-N netrc] [-o outfile] [-P port] [-q quittime]\n" -" [-r retry] [-s srcaddr] [-T dir,max[,inc]]\n" +" [-r retry] [-s srcaddr] [-T dir,max[,inc]] [-x xferbufsize]\n" " [[user@]host [port]] [host:path[/]] [file:///file]\n" " [ftp://[user[:pass]@]host[:port]/path[/]]\n" " [http://[user[:pass]@]host[:port]/path] [...]\n" diff --git a/src/ssl.c b/src/ssl.c index 173db08ebbd2..8587526b9dca 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1,9 +1,10 @@ -/* $NetBSD: ssl.c,v 1.2 2013/05/05 13:17:06 lukem Exp $ */ -/* from NetBSD: ssl.c,v 1.2 2012/12/24 22:12:28 christos Exp */ +/* $NetBSD: ssl.c,v 1.3 2015/10/04 04:53:26 lukem Exp $ */ +/* from NetBSD: ssl.c,v 1.5 2015/09/16 15:32:53 joerg Exp */ /*- * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav * Copyright (c) 2008, 2010 Joerg Sonnenberger <joerg@NetBSD.org> + * Copyright (c) 2015 Thomas Klausner <wiz@NetBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,7 +39,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID(" NetBSD: ssl.c,v 1.2 2012/12/24 22:12:28 christos Exp "); +__RCSID(" NetBSD: ssl.c,v 1.5 2015/09/16 15:32:53 joerg Exp "); #endif #include <time.h> @@ -552,7 +553,7 @@ fetch_getline(struct fetch_connect *conn, char *buf, size_t buflen, } void * -fetch_start_ssl(int sock) +fetch_start_ssl(int sock, const char *servername) { SSL *ssl; SSL_CTX *ctx; @@ -576,6 +577,11 @@ fetch_start_ssl(int sock) return NULL; } SSL_set_fd(ssl, sock); + if (!SSL_set_tlsext_host_name(ssl, __UNCONST(servername))) { + fprintf(ttyout, "SSL hostname setting failed\n"); + SSL_CTX_free(ctx); + return NULL; + } while ((ret = SSL_connect(ssl)) == -1) { ssl_err = SSL_get_error(ssl, ret); if (ssl_err != SSL_ERROR_WANT_READ && diff --git a/src/ssl.h b/src/ssl.h index 217fcdf512c1..56be916e07b6 100644 --- a/src/ssl.h +++ b/src/ssl.h @@ -1,5 +1,5 @@ -/* $NetBSD: ssl.h,v 1.2 2014/10/31 03:57:14 lukem Exp $ */ -/* from NetBSD: ssl.h,v 1.2 2014/01/07 02:07:08 joerg Exp */ +/* $NetBSD: ssl.h,v 1.3 2015/10/04 04:53:26 lukem Exp $ */ +/* from NetBSD: ssl.h,v 1.3 2015/09/12 19:38:42 wiz Exp */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ ssize_t fetch_read(void *, size_t, size_t, struct fetch_connect *); char *fetch_getln(char *, int, struct fetch_connect *); int fetch_getline(struct fetch_connect *, char *, size_t, const char **); void fetch_set_ssl(struct fetch_connect *, void *); -void *fetch_start_ssl(int); +void *fetch_start_ssl(int, const char *); #else /* !WITH_SSL */ diff --git a/src/version.h b/src/version.h index f5ad9721c387..80c54553bf23 100644 --- a/src/version.h +++ b/src/version.h @@ -1,8 +1,8 @@ -/* $NetBSD: version.h,v 1.6 2014/10/31 03:37:59 lukem Exp $ */ -/* from NetBSD: version.h,v 1.85 2014/10/31 03:27:18 lukem Exp */ +/* $NetBSD: version.h,v 1.7 2015/10/04 04:53:26 lukem Exp $ */ +/* from NetBSD: version.h,v 1.87 2015/09/12 20:18:52 wiz Exp */ /*- - * Copyright (c) 1999-2009 The NetBSD Foundation, Inc. + * Copyright (c) 1999-2015 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -35,5 +35,5 @@ #endif #ifndef FTP_VERSION -#define FTP_VERSION "20141026" +#define FTP_VERSION "20150912" #endif |