diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-10-24 05:00:29 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-10-24 05:00:29 +0000 |
commit | bdfd0d78bc44e73d693510e70087857785b3b521 (patch) | |
tree | 153a573095afac8d8d0ea857759ecabd77fb28b7 /networking/wget.c | |
parent | 9260fc5552a3ee52eb95823aa6689d52a1ffd33c (diff) | |
download | busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.gz busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.bz2 busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.zip |
Major rework of the directory structure and the entire build system.
-Erik
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/networking/wget.c b/networking/wget.c index 59373d1d9..41b4e30af 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -60,7 +60,7 @@ static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf); | |||
60 | /* Globals (can be accessed from signal handlers */ | 60 | /* Globals (can be accessed from signal handlers */ |
61 | static off_t filesize = 0; /* content-length of the file */ | 61 | static off_t filesize = 0; /* content-length of the file */ |
62 | static int chunked = 0; /* chunked transfer encoding */ | 62 | static int chunked = 0; /* chunked transfer encoding */ |
63 | #ifdef BB_FEATURE_WGET_STATUSBAR | 63 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
64 | static void progressmeter(int flag); | 64 | static void progressmeter(int flag); |
65 | static char *curfile; /* Name of current file being transferred. */ | 65 | static char *curfile; /* Name of current file being transferred. */ |
66 | static struct timeval start; /* Time a transfer started. */ | 66 | static struct timeval start; /* Time a transfer started. */ |
@@ -126,7 +126,7 @@ static char *safe_fgets(char *s, int size, FILE *stream) | |||
126 | error_msg_and_die(s); } | 126 | error_msg_and_die(s); } |
127 | 127 | ||
128 | 128 | ||
129 | #ifdef BB_FEATURE_WGET_AUTHENTICATION | 129 | #ifdef CONFIG_FEATURE_WGET_AUTHENTICATION |
130 | /* | 130 | /* |
131 | * Base64-encode character string | 131 | * Base64-encode character string |
132 | * oops... isn't something similar in uuencode.c? | 132 | * oops... isn't something similar in uuencode.c? |
@@ -245,20 +245,20 @@ int wget_main(int argc, char **argv) | |||
245 | /* Guess an output filename */ | 245 | /* Guess an output filename */ |
246 | if (!fname_out) { | 246 | if (!fname_out) { |
247 | fname_out = | 247 | fname_out = |
248 | #ifdef BB_FEATURE_WGET_STATUSBAR | 248 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
249 | curfile = | 249 | curfile = |
250 | #endif | 250 | #endif |
251 | get_last_path_component(target.path); | 251 | get_last_path_component(target.path); |
252 | if (fname_out==NULL || strlen(fname_out)<1) { | 252 | if (fname_out==NULL || strlen(fname_out)<1) { |
253 | fname_out = | 253 | fname_out = |
254 | #ifdef BB_FEATURE_WGET_STATUSBAR | 254 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
255 | curfile = | 255 | curfile = |
256 | #endif | 256 | #endif |
257 | "index.html"; | 257 | "index.html"; |
258 | } | 258 | } |
259 | if (dir_prefix != NULL) | 259 | if (dir_prefix != NULL) |
260 | fname_out = concat_path_file(dir_prefix, fname_out); | 260 | fname_out = concat_path_file(dir_prefix, fname_out); |
261 | #ifdef BB_FEATURE_WGET_STATUSBAR | 261 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
262 | } else { | 262 | } else { |
263 | curfile = get_last_path_component(fname_out); | 263 | curfile = get_last_path_component(fname_out); |
264 | #endif | 264 | #endif |
@@ -316,7 +316,7 @@ int wget_main(int argc, char **argv) | |||
316 | 316 | ||
317 | fprintf(sfp, "Host: %s\r\nUser-Agent: Wget\r\n", target.host); | 317 | fprintf(sfp, "Host: %s\r\nUser-Agent: Wget\r\n", target.host); |
318 | 318 | ||
319 | #ifdef BB_FEATURE_WGET_AUTHENTICATION | 319 | #ifdef CONFIG_FEATURE_WGET_AUTHENTICATION |
320 | if (target.user) { | 320 | if (target.user) { |
321 | fprintf(sfp, "Authorization: Basic %s\r\n", | 321 | fprintf(sfp, "Authorization: Basic %s\r\n", |
322 | base64enc(target.user, buf, sizeof(buf))); | 322 | base64enc(target.user, buf, sizeof(buf))); |
@@ -475,14 +475,14 @@ read_response: if (fgets(buf, sizeof(buf), sfp) == NULL) | |||
475 | fgets(buf, sizeof(buf), dfp); | 475 | fgets(buf, sizeof(buf), dfp); |
476 | filesize = strtol(buf, (char **) NULL, 16); | 476 | filesize = strtol(buf, (char **) NULL, 16); |
477 | } | 477 | } |
478 | #ifdef BB_FEATURE_WGET_STATUSBAR | 478 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
479 | if (quiet_flag==FALSE) | 479 | if (quiet_flag==FALSE) |
480 | progressmeter(-1); | 480 | progressmeter(-1); |
481 | #endif | 481 | #endif |
482 | do { | 482 | do { |
483 | while ((filesize > 0 || !got_clen) && (n = safe_fread(buf, 1, chunked ? (filesize > sizeof(buf) ? sizeof(buf) : filesize) : sizeof(buf), dfp)) > 0) { | 483 | while ((filesize > 0 || !got_clen) && (n = safe_fread(buf, 1, chunked ? (filesize > sizeof(buf) ? sizeof(buf) : filesize) : sizeof(buf), dfp)) > 0) { |
484 | safe_fwrite(buf, 1, n, output); | 484 | safe_fwrite(buf, 1, n, output); |
485 | #ifdef BB_FEATURE_WGET_STATUSBAR | 485 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
486 | statbytes+=n; | 486 | statbytes+=n; |
487 | #endif | 487 | #endif |
488 | if (got_clen) | 488 | if (got_clen) |
@@ -499,7 +499,7 @@ read_response: if (fgets(buf, sizeof(buf), sfp) == NULL) | |||
499 | if (n == 0 && ferror(dfp)) | 499 | if (n == 0 && ferror(dfp)) |
500 | perror_msg_and_die("network read error"); | 500 | perror_msg_and_die("network read error"); |
501 | } while (chunked); | 501 | } while (chunked); |
502 | #ifdef BB_FEATURE_WGET_STATUSBAR | 502 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
503 | if (quiet_flag==FALSE) | 503 | if (quiet_flag==FALSE) |
504 | progressmeter(1); | 504 | progressmeter(1); |
505 | #endif | 505 | #endif |
@@ -645,7 +645,7 @@ static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf) | |||
645 | return atoi(buf); | 645 | return atoi(buf); |
646 | } | 646 | } |
647 | 647 | ||
648 | #ifdef BB_FEATURE_WGET_STATUSBAR | 648 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
649 | /* Stuff below is from BSD rcp util.c, as added to openshh. | 649 | /* Stuff below is from BSD rcp util.c, as added to openshh. |
650 | * Original copyright notice is retained at the end of this file. | 650 | * Original copyright notice is retained at the end of this file. |
651 | * | 651 | * |
@@ -782,7 +782,7 @@ progressmeter(int flag) | |||
782 | } | 782 | } |
783 | #endif | 783 | #endif |
784 | 784 | ||
785 | /* Original copyright notice which applies to the BB_FEATURE_WGET_STATUSBAR stuff, | 785 | /* Original copyright notice which applies to the CONFIG_FEATURE_WGET_STATUSBAR stuff, |
786 | * much of which was blatently stolen from openssh. */ | 786 | * much of which was blatently stolen from openssh. */ |
787 | 787 | ||
788 | /*- | 788 | /*- |
@@ -817,7 +817,7 @@ progressmeter(int flag) | |||
817 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 817 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
818 | * SUCH DAMAGE. | 818 | * SUCH DAMAGE. |
819 | * | 819 | * |
820 | * $Id: wget.c,v 1.45 2001/07/19 22:28:01 andersen Exp $ | 820 | * $Id: wget.c,v 1.46 2001/10/24 04:59:56 andersen Exp $ |
821 | */ | 821 | */ |
822 | 822 | ||
823 | 823 | ||