- Only send port number in HTTP/1.1 Host: request if port != 80.

Fixes [bin/15415] from Takahiro Kambe <taca@sky.yamashina.kyoto.jp>
- Fix bad mode passed by mls() to recvrequest().
  Fixes [bin/16642] from <steve.mcclellan@radisys.com>
This commit is contained in:
lukem 2002-05-06 14:36:41 +00:00
parent f23186dae7
commit f801eb939e
3 changed files with 13 additions and 10 deletions

View File

@ -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 @@ mls(int argc, char *argv[])
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 @@ mls(int argc, char *argv[])
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) {

View File

@ -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 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
(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) {

View File

@ -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