Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/ftp - Only send port number in HTTP/1.1 Host: reques...
details: https://anonhg.NetBSD.org/src/rev/e0535d882021
branches: trunk
changeset: 526576:e0535d882021
user: lukem <lukem%NetBSD.org@localhost>
date: Mon May 06 14:36:41 2002 +0000
description:
- Only send port number in HTTP/1.1 Host: request if port != 80.
Fixes [bin/15415] from Takahiro Kambe <taca%sky.yamashina.kyoto.jp@localhost>
- Fix bad mode passed by mls() to recvrequest().
Fixes [bin/16642] from <steve.mcclellan%radisys.com@localhost>
diffstat:
usr.bin/ftp/cmds.c | 8 ++++----
usr.bin/ftp/fetch.c | 11 +++++++----
usr.bin/ftp/version.h | 4 ++--
3 files changed, 13 insertions(+), 10 deletions(-)
diffs (86 lines):
diff -r a1fdf06e0c8d -r e0535d882021 usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c Mon May 06 13:43:57 2002 +0000
+++ b/usr.bin/ftp/cmds.c Mon May 06 14:36:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cmds.c,v 1.95 2001/12/26 09:40:15 lukem Exp $ */
+/* $NetBSD: cmds.c,v 1.96 2002/05/06 14:36:41 lukem Exp $ */
/*-
* Copyright (c) 1996-2001 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: cmds.c,v 1.95 2001/12/26 09:40:15 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.96 2002/05/06 14:36:41 lukem Exp $");
#endif
#endif /* not lint */
@@ -1346,7 +1346,7 @@
sigfunc oldintr;
int ointer, i;
int dolist;
- char mode[1], *dest, *odest;
+ char *mode, *dest, *odest;
if (argc == 0)
goto usage;
@@ -1373,7 +1373,7 @@
if (sigsetjmp(jabort, 1))
mabort();
for (i = 1; mflag && i < argc-1 && connected; i++) {
- *mode = (i == 1) ? 'w' : 'a';
+ mode = (i == 1) ? "w" : "a";
recvrequest(dolist ? "LIST" : "NLST", dest, argv[i], mode,
0, 0);
if (!mflag && fromatty) {
diff -r a1fdf06e0c8d -r e0535d882021 usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c Mon May 06 13:43:57 2002 +0000
+++ b/usr.bin/ftp/fetch.c Mon May 06 14:36:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fetch.c,v 1.133 2002/02/01 10:07:54 itojun Exp $ */
+/* $NetBSD: fetch.c,v 1.134 2002/05/06 14:36:41 lukem Exp $ */
/*-
* Copyright (c) 1997-2001 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.133 2002/02/01 10:07:54 itojun Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.134 2002/05/06 14:36:41 lukem Exp $");
#endif /* not lint */
/*
@@ -730,10 +730,13 @@
(p = strchr(h, '%')) != NULL) {
*p = '\0';
}
- fprintf(fin, "Host: [%s]:%u\r\n", h, portnum);
+ fprintf(fin, "Host: [%s]", h);
free(h);
} else
- fprintf(fin, "Host: %s:%u\r\n", host, portnum);
+ fprintf(fin, "Host: %s", host);
+ if (portnum != HTTP_PORT)
+ fprintf(fin, ":%u", portnum);
+ fprintf(fin, "\r\n");
fprintf(fin, "Accept: */*\r\n");
fprintf(fin, "Connection: close\r\n");
if (restart_point) {
diff -r a1fdf06e0c8d -r e0535d882021 usr.bin/ftp/version.h
--- a/usr.bin/ftp/version.h Mon May 06 13:43:57 2002 +0000
+++ b/usr.bin/ftp/version.h Mon May 06 14:36:41 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: version.h,v 1.27 2001/12/26 09:40:16 lukem Exp $ */
+/* $NetBSD: version.h,v 1.28 2002/05/06 14:36:41 lukem Exp $ */
/*-
* Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -40,5 +40,5 @@
#endif
#ifndef FTP_VERSION
-#define FTP_VERSION "20011223"
+#define FTP_VERSION "20020507"
#endif
Home |
Main Index |
Thread Index |
Old Index