The port number might have changed in the proxy case. Re-evaluate it.
This commit is contained in:
parent
0f5eb412c3
commit
915a67c083
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fetch.c,v 1.67 1999/08/31 21:30:25 christos Exp $ */
|
||||
/* $NetBSD: fetch.c,v 1.68 1999/08/31 22:05:22 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: fetch.c,v 1.67 1999/08/31 21:30:25 christos Exp $");
|
||||
__RCSID("$NetBSD: fetch.c,v 1.68 1999/08/31 22:05:22 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
@ -652,6 +652,12 @@ fetch_url(url, proxyenv, proxyauth, wwwauth)
|
|||
warnx("Unknown port for URL `%s'", url);
|
||||
goto cleanup_fetch_url;
|
||||
}
|
||||
portnum = strtol(port, &ep, 10);
|
||||
if (*ep || port == ep) {
|
||||
struct servent *svp = getservbyname(port, "tcp");
|
||||
if (svp != NULL)
|
||||
portnum = ntohs(svp->s_port);
|
||||
}
|
||||
sin.sin_port = portnum;
|
||||
|
||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
Loading…
Reference in New Issue