FreeBSD Bugzilla – Attachment 5491 Details for
Bug 13092
Fetch doesn't default to the correct http-port when no port is specifie d in the environment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.33 KB, created by
Paul.Hernaus
on 1999-08-12 13:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Paul.Hernaus
Created:
1999-08-12 13:40:01 UTC
Size:
2.33 KB
patch
obsolete
>diff -u /usr/src/usr.bin/fetch/Makefile /tmp/fetch/Makefile >--- /usr/src/usr.bin/fetch/Makefile Thu Jan 30 22:43:35 1997 >+++ /tmp/fetch/Makefile Thu Aug 12 14:15:51 1999 >@@ -1,5 +1,5 @@ > PROG = fetch >-SRCS = file.c ftp.c http.c main.c util.c uri.c >+SRCS = fetch.h file.c ftp.c http.c main.c util.c uri.c > > CFLAGS+= -Wall -Wwrite-strings -Wmissing-prototypes > >diff -u /usr/src/usr.bin/fetch/fetch.h /tmp/fetch/fetch.h >--- /usr/src/usr.bin/fetch/fetch.h Tue Dec 8 14:00:49 1998 >+++ /tmp/fetch/fetch.h Thu Aug 12 14:16:05 1999 >@@ -37,6 +37,9 @@ > #define FETCH_VERSION "fetch/1.0" > #define PATH_CP "/bin/cp" > >+#define DEFAULT_FTP_PORT 21 >+#define DEFAULT_HTTP_PORT 80 >+ > struct fetch_state { > const char *fs_status; > const char *fs_outputfile; >diff -u /usr/src/usr.bin/fetch/ftp.c /tmp/fetch/ftp.c >--- /usr/src/usr.bin/fetch/ftp.c Fri Jun 25 04:57:24 1999 >+++ /tmp/fetch/ftp.c Thu Aug 12 14:13:21 1999 >@@ -117,7 +117,7 @@ > > port = ul; > } else { >- port = 21; >+ port = DEFAULT_FTP_PORT; > } > > p = slash + 1; >@@ -253,7 +253,7 @@ > hostname = getenv("FTP_PROXY"); > port = strchr(hostname, ':'); > if (port == 0) { >- portno = 21; >+ portno = DEFAULT_FTP_PORT; > } else { > unsigned long ul; > char *ep; >@@ -289,12 +289,13 @@ > user = ftps->ftp_user ? ftps->ftp_user : "anonymous"; > /* user @ hostname [ @port ] \0 */ > newuser = safe_malloc(strlen(user) + 1 + strlen(ftps->ftp_hostname) >- + ((ftps->ftp_port != 21) ? 6 : 0) + 1); >+ + ((ftps->ftp_port != DEFAULT_FTP_PORT) ? 6 : 0) >+ + 1); > > strcpy(newuser, user); > strcat(newuser, "@"); > strcat(newuser, ftps->ftp_hostname); >- if (ftps->ftp_port != 21) { >+ if (ftps->ftp_port != DEFAULT_FTP_PORT) { > char numbuf[6]; > > snprintf(numbuf, sizeof(numbuf), "%d", ftps->ftp_port); >diff -u /usr/src/usr.bin/fetch/http.c /tmp/fetch/http.c >--- /usr/src/usr.bin/fetch/http.c Fri Jun 25 04:57:26 1999 >+++ /tmp/fetch/http.c Thu Aug 12 14:12:19 1999 >@@ -179,7 +179,7 @@ > > port = ul; > } else { >- port = 80; >+ port = DEFAULT_HTTP_PORT; > } > > p = slash; >@@ -476,7 +476,9 @@ > memset(&sin, 0, sizeof sin); > sin.sin_family = AF_INET; > sin.sin_len = sizeof sin; >- sin.sin_port = htons(https->http_port); >+ sin.sin_port = htons(https->http_port != 0 >+ ? https->http_port >+ : DEFAULT_HTTP_PORT); > > fs->fs_status = "looking up hostname"; > if (inet_aton(https->http_hostname, &sin.sin_addr) == 0) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 13092
: 5491