aboutsummaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/wget.c b/networking/wget.c
index b9225fac0..150bc8e12 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -1017,7 +1017,6 @@ static void download_one_url(const char *url)
1017 len_and_sockaddr *lsa; 1017 len_and_sockaddr *lsa;
1018 FILE *sfp; /* socket to web/ftp server */ 1018 FILE *sfp; /* socket to web/ftp server */
1019 FILE *dfp; /* socket to ftp server (data) */ 1019 FILE *dfp; /* socket to ftp server (data) */
1020 char *proxy = NULL;
1021 char *fname_out_alloc; 1020 char *fname_out_alloc;
1022 char *redirected_path = NULL; 1021 char *redirected_path = NULL;
1023 struct host_info server; 1022 struct host_info server;
@@ -1033,13 +1032,14 @@ static void download_one_url(const char *url)
1033 /* Use the proxy if necessary */ 1032 /* Use the proxy if necessary */
1034 use_proxy = (strcmp(G.proxy_flag, "off") != 0); 1033 use_proxy = (strcmp(G.proxy_flag, "off") != 0);
1035 if (use_proxy) { 1034 if (use_proxy) {
1036 proxy = getenv(target.protocol[0] == 'f' ? "ftp_proxy" : "http_proxy"); 1035 char *proxy = getenv(target.protocol[0] == 'f' ? "ftp_proxy" : "http_proxy");
1037//FIXME: what if protocol is https? Ok to use http_proxy? 1036//FIXME: what if protocol is https? Ok to use http_proxy?
1038 use_proxy = (proxy && proxy[0]); 1037 use_proxy = (proxy && proxy[0]);
1039 if (use_proxy) 1038 if (use_proxy)
1040 parse_url(proxy, &server); 1039 parse_url(proxy, &server);
1041 } 1040 }
1042 if (!use_proxy) { 1041 if (!use_proxy) {
1042 server.protocol = target.protocol;
1043 server.port = target.port; 1043 server.port = target.port;
1044 if (ENABLE_FEATURE_IPV6) { 1044 if (ENABLE_FEATURE_IPV6) {
1045 //free(server.allocated); - can't be non-NULL 1045 //free(server.allocated); - can't be non-NULL
@@ -1104,7 +1104,7 @@ static void download_one_url(const char *url)
1104 /* Open socket to http(s) server */ 1104 /* Open socket to http(s) server */
1105#if ENABLE_FEATURE_WGET_OPENSSL 1105#if ENABLE_FEATURE_WGET_OPENSSL
1106 /* openssl (and maybe internal TLS) support is configured */ 1106 /* openssl (and maybe internal TLS) support is configured */
1107 if (target.protocol == P_HTTPS) { 1107 if (server.protocol == P_HTTPS) {
1108 /* openssl-based helper 1108 /* openssl-based helper
1109 * Inconvenient API since we can't give it an open fd 1109 * Inconvenient API since we can't give it an open fd
1110 */ 1110 */
@@ -1128,7 +1128,7 @@ static void download_one_url(const char *url)
1128#elif ENABLE_FEATURE_WGET_HTTPS 1128#elif ENABLE_FEATURE_WGET_HTTPS
1129 /* Only internal TLS support is configured */ 1129 /* Only internal TLS support is configured */
1130 sfp = open_socket(lsa); 1130 sfp = open_socket(lsa);
1131 if (target.protocol == P_HTTPS) 1131 if (server.protocol == P_HTTPS)
1132 spawn_ssl_client(server.host, fileno(sfp), /*flags*/ 0); 1132 spawn_ssl_client(server.host, fileno(sfp), /*flags*/ 0);
1133#else 1133#else
1134 /* ssl (https) support is not configured */ 1134 /* ssl (https) support is not configured */