summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/ftpgetput.c6
-rw-r--r--networking/wget.c12
2 files changed, 18 insertions, 0 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 8283366cc..0670b2141 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -100,6 +100,9 @@ static int ftpcmd(const char *s1, const char *s2)
100 fprintf(control_stream, (s2 ? "%s %s\r\n" : "%s %s\r\n"+3), 100 fprintf(control_stream, (s2 ? "%s %s\r\n" : "%s %s\r\n"+3),
101 s1, s2); 101 s1, s2);
102 fflush(control_stream); 102 fflush(control_stream);
103#if ENABLE_PLATFORM_MINGW32
104 fseek(control_stream, 0L, SEEK_CUR);
105#endif
103 } 106 }
104 107
105 do { 108 do {
@@ -108,6 +111,9 @@ static int ftpcmd(const char *s1, const char *s2)
108 ftp_die(NULL); 111 ftp_die(NULL);
109 } 112 }
110 } while (!isdigit(buf[0]) || buf[3] != ' '); 113 } while (!isdigit(buf[0]) || buf[3] != ' ');
114#if ENABLE_PLATFORM_MINGW32
115 fseek(control_stream, 0L, SEEK_CUR);
116#endif
111 117
112 buf[3] = '\0'; 118 buf[3] = '\0';
113 n = xatou(buf); 119 n = xatou(buf);
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
486static int spawn_https_helper(const char *host, unsigned port) 495static 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)