FreeBSD Bugzilla – Attachment 10744 Details for
Bug 21449
[PATCH] Sysinstall, installing via HTTP proxy: Fix locating the release directory; fix server name resolving
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.70 KB, created by
Philipp Mergenthaler
on 2000-09-21 14:50:03 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Philipp Mergenthaler
Created:
2000-09-21 14:50:03 UTC
Size:
3.70 KB
patch
obsolete
>diff -ru -2 sysinstall/http.c sysinstall.new/http.c >--- sysinstall/http.c Fri Jul 14 10:33:08 2000 >+++ sysinstall.new/http.c Thu Sep 21 14:39:00 2000 >@@ -19,6 +19,6 @@ > > int rv, s, af; >- bool el; /* end of header line */ >- char *cp, buf[PATH_MAX], req[BUFSIZ]; >+ bool el, found=FALSE; /* end of header line */ >+ char *cp, *rel, buf[PATH_MAX], req[BUFSIZ]; > struct addrinfo hints, *res, *res0; > >@@ -49,6 +49,21 @@ > return FALSE; > } >+ /* If the release is specified as "__RELEASE" or "none", then just >+ * assume that the path the user gave is ok. >+ */ >+ rel = variable_get(VAR_RELNAME); >+ /* >+ msgConfirm("rel: -%s-", rel); >+ */ >+ if (strcmp(rel, "__RELEASE") && strcmp(rel, "none")) { >+ sprintf(req, "%s/pub/FreeBSD/releases/"MACHINE"/%s", >+ variable_get(VAR_FTP_PATH), rel); >+ variable_set2(VAR_HTTP_PATH, req, 0); >+ } else { >+ variable_set2(VAR_HTTP_PATH, variable_get(VAR_FTP_PATH), 0); >+ } > >- sprintf(req,"GET / HTTP/1.0\r\n\r\n"); >+ msgNotify("Checking access to\n %s", variable_get(VAR_HTTP_PATH)); >+ sprintf(req,"HEAD %s/ HTTP/1.0\r\n\r\n", variable_get(VAR_HTTP_PATH)); > write(s,req,strlen(req)); > /* >@@ -64,4 +79,10 @@ > if ((*cp == '\012') && el) { > /* reached end of a header line */ >+ if (!strncmp(buf,"HTTP",4)) { >+ if (strtol((char *)(buf+9),0,0) == 200) { >+ found = TRUE; >+ } >+ } >+ > if (!strncmp(buf,"Server: ",8)) { > if (!strncmp(buf,"Server: Squid",13)) { >@@ -86,5 +107,8 @@ > } > close(s); >- return TRUE; >+ if (!found) >+ msgConfirm("No such directory: %s\n" >+ "please check the URL and try again.", variable_get(VAR_HTTP_PATH)); >+ return found; > } > >@@ -126,7 +150,6 @@ > } > >- sprintf(req,"GET %s/%s/%s%s HTTP/1.0\r\n\r\n", >- variable_get(VAR_FTP_PATH), variable_get(VAR_RELNAME), >- file, variable_get(VAR_HTTP_FTP_MODE)); >+ sprintf(req,"GET %s/%s%s HTTP/1.0\r\n\r\n", >+ variable_get(VAR_HTTP_PATH), file, variable_get(VAR_HTTP_FTP_MODE)); > > if (isDebug()) { >diff -ru -2 sysinstall/media.c sysinstall.new/media.c >--- sysinstall/media.c Thu Sep 21 13:54:07 2000 >+++ sysinstall.new/media.c Thu Sep 21 15:32:42 2000 >@@ -51,4 +51,5 @@ > > static Boolean got_intr = FALSE; >+static Boolean ftp_skip_resolve = FALSE; > > /* timeout handler */ >@@ -393,5 +394,5 @@ > msgDebug("port # = `%d'\n", FtpPort); > } >- if (variable_get(VAR_NAMESERVER)) { >+ if (!ftp_skip_resolve && variable_get(VAR_NAMESERVER)) { > msgNotify("Looking up host %s.", hostname); > if (isDebug()) >@@ -453,20 +454,20 @@ > int mediaSetHTTP(dialogMenuItem *self) > { >+ Boolean tmp; > int result; >- char *cp, *idx, hbuf[MAXHOSTNAMELEN], *hostname, *var_hostname; >+ char *cp, *idx, hbuf[MAXHOSTNAMELEN], *hostname; > int HttpPort; > int what = DITEM_RESTORE; > > >- var_hostname = variable_get(VAR_NAMESERVER); >- variable_unset(VAR_NAMESERVER); >+ tmp = ftp_skip_resolve; >+ ftp_skip_resolve = TRUE; > result = mediaSetFTP(self); >- if (var_hostname) >- variable_set2(VAR_NAMESERVER, var_hostname, 0); >+ ftp_skip_resolve = tmp; > > if (DITEM_STATUS(result) != DITEM_SUCCESS) > return result; > >- cp = variable_get_value(VAR_HTTP_PATH, >+ cp = variable_get_value(VAR_HTTP_PROXY, > "Please enter the address of the HTTP proxy in this format:\n" > " hostname:port (the ':port' is optional, default is 3128)",0); >diff -ru -2 sysinstall/sysinstall.h sysinstall.new/sysinstall.h >--- sysinstall/sysinstall.h Thu Jul 27 10:38:54 2000 >+++ sysinstall.new/sysinstall.h Thu Sep 21 14:39:00 2000 >@@ -113,4 +113,5 @@ > #define VAR_FTP_HOST "ftpHost" > #define VAR_HTTP_PATH "_httpPath" >+#define VAR_HTTP_PROXY "httpProxy" > #define VAR_HTTP_PORT "httpPort" > #define VAR_HTTP_HOST "httpHost"
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 21449
: 10744