Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/ftp Add -x xferbufsize to set xferbuf size.



details:   https://anonhg.NetBSD.org/src/rev/30467a43c56b
branches:  trunk
changeset: 337695:30467a43c56b
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Apr 23 23:31:23 2015 +0000

description:
Add  -x xferbufsize  to set xferbuf size.

Implement  -x xferbufsize  set the socket send and receive buffer size,
as per 'xferbuf' in interactive mode.

Patch from Nicholas Mills (via private mail), with minor adjustment by me.

diffstat:

 usr.bin/ftp/ftp.1     |  13 ++++++++++---
 usr.bin/ftp/main.c    |  19 +++++++++++++------
 usr.bin/ftp/version.h |   6 +++---
 3 files changed, 26 insertions(+), 12 deletions(-)

diffs (124 lines):

diff -r 0f5fe88e4aec -r 30467a43c56b usr.bin/ftp/ftp.1
--- a/usr.bin/ftp/ftp.1 Thu Apr 23 23:23:28 2015 +0000
+++ b/usr.bin/ftp/ftp.1 Thu Apr 23 23:31:23 2015 +0000
@@ -1,6 +1,6 @@
-.\"    $NetBSD: ftp.1,v 1.134 2012/12/22 16:57:10 christos Exp $
+.\"    $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
@@ -57,7 +57,7 @@
 .\"
 .\"    @(#)ftp.1       8.3 (Berkeley) 10/9/94
 .\"
-.Dd December 22, 2012
+.Dd April 24, 2015
 .Dt FTP 1
 .Os
 .Sh NAME
@@ -84,6 +84,7 @@
 .Xc
 .Oc
 .Ek
+.Op Fl x Ar xferbufsize
 .Bk -words
 .\" [[user@]host [port]]
 .Oo
@@ -311,6 +312,12 @@
 .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 -r 0f5fe88e4aec -r 30467a43c56b usr.bin/ftp/main.c
--- a/usr.bin/ftp/main.c        Thu Apr 23 23:23:28 2015 +0000
+++ b/usr.bin/ftp/main.c        Thu Apr 23 23:31:23 2015 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: main.c,v 1.122 2012/12/22 16:57:10 christos Exp $      */
+/*     $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
@@ -91,14 +91,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 */
 
@@ -266,7 +266,7 @@
                }
        }
 
-       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;
@@ -408,6 +408,13 @@
                        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();
                }
@@ -1045,7 +1052,7 @@
 
        (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 -r 0f5fe88e4aec -r 30467a43c56b usr.bin/ftp/version.h
--- a/usr.bin/ftp/version.h     Thu Apr 23 23:23:28 2015 +0000
+++ b/usr.bin/ftp/version.h     Thu Apr 23 23:31:23 2015 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: version.h,v 1.85 2014/10/31 03:27:18 lukem Exp $       */
+/*     $NetBSD: version.h,v 1.86 2015/04/23 23:31:23 lukem 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
@@ -34,5 +34,5 @@
 #endif
 
 #ifndef FTP_VERSION
-#define        FTP_VERSION     "20141026"
+#define        FTP_VERSION     "20150424"
 #endif



Home | Main Index | Thread Index | Old Index