diff options
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/networking/wget.c b/networking/wget.c index 1013f66cb..774accf7a 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -258,11 +258,17 @@ static int ftpcmd(const char *s1, const char *s2, FILE *fp) | |||
258 | fprintf(fp, "%s%s\r\n", s1, s2); | 258 | fprintf(fp, "%s%s\r\n", s1, s2); |
259 | fflush(fp); | 259 | fflush(fp); |
260 | log_io("> %s%s", s1, s2); | 260 | log_io("> %s%s", s1, s2); |
261 | #if ENABLE_PLATFORM_MINGW32 | ||
262 | fseek(fp, 0L, SEEK_CUR); | ||
263 | #endif | ||
261 | } | 264 | } |
262 | 265 | ||
263 | do { | 266 | do { |
264 | fgets_and_trim(fp); | 267 | fgets_and_trim(fp); |
265 | } while (!isdigit(G.wget_buf[0]) || G.wget_buf[3] != ' '); | 268 | } while (!isdigit(G.wget_buf[0]) || G.wget_buf[3] != ' '); |
269 | #if ENABLE_PLATFORM_MINGW32 | ||
270 | fseek(fp, 0L, SEEK_CUR); | ||
271 | #endif | ||
266 | 272 | ||
267 | G.wget_buf[3] = '\0'; | 273 | G.wget_buf[3] = '\0'; |
268 | result = xatoi_positive(G.wget_buf); | 274 | result = xatoi_positive(G.wget_buf); |
@@ -285,10 +291,12 @@ static void parse_url(const char *src_url, struct host_info *h) | |||
285 | if (strcmp(url, P_FTP) == 0) { | 291 | if (strcmp(url, P_FTP) == 0) { |
286 | h->port = bb_lookup_port(P_FTP, "tcp", 21); | 292 | h->port = bb_lookup_port(P_FTP, "tcp", 21); |
287 | } else | 293 | } else |
294 | #if !ENABLE_PLATFORM_MINGW32 | ||
288 | if (strcmp(url, P_HTTPS) == 0) { | 295 | if (strcmp(url, P_HTTPS) == 0) { |
289 | h->port = bb_lookup_port(P_HTTPS, "tcp", 443); | 296 | h->port = bb_lookup_port(P_HTTPS, "tcp", 443); |
290 | h->protocol = P_HTTPS; | 297 | h->protocol = P_HTTPS; |
291 | } else | 298 | } else |
299 | #endif | ||
292 | if (strcmp(url, P_HTTP) == 0) { | 300 | if (strcmp(url, P_HTTP) == 0) { |
293 | http: | 301 | http: |
294 | h->port = bb_lookup_port(P_HTTP, "tcp", 80); | 302 | h->port = bb_lookup_port(P_HTTP, "tcp", 80); |
@@ -483,6 +491,7 @@ static FILE* prepare_ftp_session(FILE **dfpp, struct host_info *target, len_and_ | |||
483 | return sfp; | 491 | return sfp; |
484 | } | 492 | } |
485 | 493 | ||
494 | #if !ENABLE_PLATFORM_MINGW32 | ||
486 | static int spawn_https_helper(const char *host, unsigned port) | 495 | static int spawn_https_helper(const char *host, unsigned port) |
487 | { | 496 | { |
488 | char *allocated = NULL; | 497 | char *allocated = NULL; |
@@ -532,6 +541,7 @@ static int spawn_https_helper(const char *host, unsigned port) | |||
532 | close(sp[1]); | 541 | close(sp[1]); |
533 | return sp[0]; | 542 | return sp[0]; |
534 | } | 543 | } |
544 | #endif | ||
535 | 545 | ||
536 | /* See networking/ssl_helper/README */ | 546 | /* See networking/ssl_helper/README */ |
537 | #define SSL_HELPER 0 | 547 | #define SSL_HELPER 0 |
@@ -814,6 +824,7 @@ static void download_one_url(const char *url) | |||
814 | int status; | 824 | int status; |
815 | 825 | ||
816 | /* Open socket to http(s) server */ | 826 | /* Open socket to http(s) server */ |
827 | #if !ENABLE_PLATFORM_MINGW32 | ||
817 | if (target.protocol == P_HTTPS) { | 828 | if (target.protocol == P_HTTPS) { |
818 | /* openssl-based helper | 829 | /* openssl-based helper |
819 | * Inconvenient API since we can't give it an open fd | 830 | * Inconvenient API since we can't give it an open fd |
@@ -823,6 +834,7 @@ static void download_one_url(const char *url) | |||
823 | if (!sfp) | 834 | if (!sfp) |
824 | bb_perror_msg_and_die(bb_msg_memory_exhausted); | 835 | bb_perror_msg_and_die(bb_msg_memory_exhausted); |
825 | } else | 836 | } else |
837 | #endif | ||
826 | sfp = open_socket(lsa); | 838 | sfp = open_socket(lsa); |
827 | #if SSL_HELPER | 839 | #if SSL_HELPER |
828 | if (target.protocol == P_HTTPS) | 840 | if (target.protocol == P_HTTPS) |