summaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-21 19:10:26 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-21 19:10:26 +0000
commitf8c8bb116007ef1d3856a4e302229f0c47bc1499 (patch)
tree4ba3180e9ec8c6cc6322412f5c1b9f4e9cd67fe4 /networking/wget.c
parent921f5df25fdb9d89bd02ac0030ebb6ca7e003f0d (diff)
downloadbusybox-w32-f8c8bb116007ef1d3856a4e302229f0c47bc1499.tar.gz
busybox-w32-f8c8bb116007ef1d3856a4e302229f0c47bc1499.tar.bz2
busybox-w32-f8c8bb116007ef1d3856a4e302229f0c47bc1499.zip
wget: yet another contortion for proftpd's PASV response.
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 abc011c7d..0c547c651 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -414,18 +414,18 @@ int wget_main(int argc, char **argv)
414 pasv_error: 414 pasv_error:
415 bb_error_msg_and_die("bad response to %s: %s", "PASV", buf); 415 bb_error_msg_and_die("bad response to %s: %s", "PASV", buf);
416 } 416 }
417 // Response is "227 garbageN1,N2,N3,N4,P1,P2[)] 417 // Response is "227 garbageN1,N2,N3,N4,P1,P2[)garbage]
418 // Server's IP is N1.N2.N3.N4 (we ignore it) 418 // Server's IP is N1.N2.N3.N4 (we ignore it)
419 // Server's port for data connection is P1*256+P2 419 // Server's port for data connection is P1*256+P2
420 s = strrchr(buf, ')'); 420 s = strrchr(buf, ')');
421 if (s && !s[1]) s[0] = '\0'; 421 if (s) s[0] = '\0';
422 s = strrchr(buf, ','); 422 s = strrchr(buf, ',');
423 if (!s) goto pasv_error; 423 if (!s) goto pasv_error;
424 port = xatol_range(s+1, 0, 255); 424 port = xatou_range(s+1, 0, 255);
425 *s = '\0'; 425 *s = '\0';
426 s = strrchr(buf, ','); 426 s = strrchr(buf, ',');
427 if (!s) goto pasv_error; 427 if (!s) goto pasv_error;
428 port += xatol_range(s+1, 0, 255) * 256; 428 port += xatou_range(s+1, 0, 255) * 256;
429 s_in.sin_port = htons(port); 429 s_in.sin_port = htons(port);
430 dfp = open_socket(&s_in); 430 dfp = open_socket(&s_in);
431 431