Module Name:    src
Committed By:   lukem
Date:           Thu Apr 23 23:31:23 UTC 2015

Modified Files:
        src/usr.bin/ftp: ftp.1 main.c version.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/usr.bin/ftp/ftp.1
cvs rdiff -u -r1.122 -r1.123 src/usr.bin/ftp/main.c
cvs rdiff -u -r1.85 -r1.86 src/usr.bin/ftp/version.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ftp/ftp.1
diff -u src/usr.bin/ftp/ftp.1:1.134 src/usr.bin/ftp/ftp.1:1.135
--- src/usr.bin/ftp/ftp.1:1.134	Sat Dec 22 16:57:10 2012
+++ src/usr.bin/ftp/ftp.1	Thu Apr 23 23:31:23 2015
@@ -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 @@ 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

Index: src/usr.bin/ftp/main.c
diff -u src/usr.bin/ftp/main.c:1.122 src/usr.bin/ftp/main.c:1.123
--- src/usr.bin/ftp/main.c:1.122	Sat Dec 22 16:57:10 2012
+++ src/usr.bin/ftp/main.c	Thu Apr 23 23:31:23 2015
@@ -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 @@ main(int volatile argc, char **volatile 
 		}
 	}
 
-	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 @@ main(int volatile argc, char **volatile 
 			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 @@ 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"

Index: src/usr.bin/ftp/version.h
diff -u src/usr.bin/ftp/version.h:1.85 src/usr.bin/ftp/version.h:1.86
--- src/usr.bin/ftp/version.h:1.85	Fri Oct 31 03:27:18 2014
+++ src/usr.bin/ftp/version.h	Thu Apr 23 23:31:23 2015
@@ -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

Reply via email to