aboutsummaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-15 08:29:22 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-15 08:29:22 +0000
commitc7bda1ce659294d6e22c06e087f6f265983c7578 (patch)
tree4c6d2217f4d8306c59cf1096f8664e1cfd167213 /networking/wget.c
parent8854004b41065b3d081af7f3df13a100b0c8bfbe (diff)
downloadbusybox-w32-c7bda1ce659294d6e22c06e087f6f265983c7578.tar.gz
busybox-w32-c7bda1ce659294d6e22c06e087f6f265983c7578.tar.bz2
busybox-w32-c7bda1ce659294d6e22c06e087f6f265983c7578.zip
Remove trailing whitespace. Update copyright to include 2004.
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/networking/wget.c b/networking/wget.c
index cb0790ea7..619c138ba 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -55,7 +55,7 @@ static volatile unsigned long statbytes = 0; /* Number of bytes transferred so f
55/* For progressmeter() -- number of seconds before xfer considered "stalled" */ 55/* For progressmeter() -- number of seconds before xfer considered "stalled" */
56static const int STALLTIME = 5; 56static const int STALLTIME = 5;
57#endif 57#endif
58 58
59static void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue) 59static void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue)
60{ 60{
61 if (output != stdout && do_continue==0) { 61 if (output != stdout && do_continue==0) {
@@ -236,18 +236,18 @@ int wget_main(int argc, char **argv)
236 use_proxy = 0; 236 use_proxy = 0;
237 } 237 }
238 } 238 }
239 239
240 /* Guess an output filename */ 240 /* Guess an output filename */
241 if (!fname_out) { 241 if (!fname_out) {
242 fname_out = 242 fname_out =
243#ifdef CONFIG_FEATURE_WGET_STATUSBAR 243#ifdef CONFIG_FEATURE_WGET_STATUSBAR
244 curfile = 244 curfile =
245#endif 245#endif
246 bb_get_last_path_component(target.path); 246 bb_get_last_path_component(target.path);
247 if (fname_out==NULL || strlen(fname_out)<1) { 247 if (fname_out==NULL || strlen(fname_out)<1) {
248 fname_out = 248 fname_out =
249#ifdef CONFIG_FEATURE_WGET_STATUSBAR 249#ifdef CONFIG_FEATURE_WGET_STATUSBAR
250 curfile = 250 curfile =
251#endif 251#endif
252 "index.html"; 252 "index.html";
253 } 253 }
@@ -309,7 +309,7 @@ int wget_main(int argc, char **argv)
309 */ 309 */
310 if (sfp) fclose(sfp); 310 if (sfp) fclose(sfp);
311 sfp = open_socket(&s_in); 311 sfp = open_socket(&s_in);
312 312
313 /* 313 /*
314 * Send HTTP request. 314 * Send HTTP request.
315 */ 315 */
@@ -351,7 +351,7 @@ int wget_main(int argc, char **argv)
351read_response: 351read_response:
352 if (fgets(buf, sizeof(buf), sfp) == NULL) 352 if (fgets(buf, sizeof(buf), sfp) == NULL)
353 close_delete_and_die("no response from server"); 353 close_delete_and_die("no response from server");
354 354
355 for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) 355 for (s = buf ; *s != '\0' && !isspace(*s) ; ++s)
356 ; 356 ;
357 for ( ; isspace(*s) ; ++s) 357 for ( ; isspace(*s) ; ++s)
@@ -379,7 +379,7 @@ read_response:
379 chomp(buf); 379 chomp(buf);
380 close_delete_and_die("server returned error %d: %s", atoi(s), buf); 380 close_delete_and_die("server returned error %d: %s", atoi(s), buf);
381 } 381 }
382 382
383 /* 383 /*
384 * Retrieve HTTP headers. 384 * Retrieve HTTP headers.
385 */ 385 */
@@ -416,7 +416,7 @@ read_response:
416 } 416 }
417 } 417 }
418 } while(status >= 300); 418 } while(status >= 300);
419 419
420 dfp = sfp; 420 dfp = sfp;
421 } 421 }
422 else 422 else
@@ -431,7 +431,7 @@ read_response:
431 if (ftpcmd(NULL, NULL, sfp, buf) != 220) 431 if (ftpcmd(NULL, NULL, sfp, buf) != 220)
432 close_delete_and_die("%s", buf+4); 432 close_delete_and_die("%s", buf+4);
433 433
434 /* 434 /*
435 * Splitting username:password pair, 435 * Splitting username:password pair,
436 * trying to log in 436 * trying to log in
437 */ 437 */
@@ -448,10 +448,10 @@ read_response:
448 default: 448 default:
449 close_delete_and_die("ftp login: %s", buf+4); 449 close_delete_and_die("ftp login: %s", buf+4);
450 } 450 }
451 451
452 ftpcmd("CDUP", NULL, sfp, buf); 452 ftpcmd("CDUP", NULL, sfp, buf);
453 ftpcmd("TYPE I", NULL, sfp, buf); 453 ftpcmd("TYPE I", NULL, sfp, buf);
454 454
455 /* 455 /*
456 * Querying file size 456 * Querying file size
457 */ 457 */
@@ -463,7 +463,7 @@ read_response:
463 filesize = value; 463 filesize = value;
464 got_clen = 1; 464 got_clen = 1;
465 } 465 }
466 466
467 /* 467 /*
468 * Entering passive mode 468 * Entering passive mode
469 */ 469 */
@@ -486,7 +486,7 @@ read_response:
486 } else 486 } else
487 filesize -= beg_range; 487 filesize -= beg_range;
488 } 488 }
489 489
490 if (ftpcmd("RETR /", target.path, sfp, buf) > 150) 490 if (ftpcmd("RETR /", target.path, sfp, buf) > 150)
491 close_delete_and_die("RETR: %s", buf+4); 491 close_delete_and_die("RETR: %s", buf+4);
492 492
@@ -661,27 +661,27 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
661static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf) 661static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf)
662{ 662{
663 char *p; 663 char *p;
664 664
665 if (s1) { 665 if (s1) {
666 if (!s2) s2=""; 666 if (!s2) s2="";
667 fprintf(fp, "%s%s\r\n", s1, s2); 667 fprintf(fp, "%s%s\r\n", s1, s2);
668 fflush(fp); 668 fflush(fp);
669 } 669 }
670 670
671 do { 671 do {
672 p = fgets(buf, 510, fp); 672 p = fgets(buf, 510, fp);
673 if (!p) 673 if (!p)
674 bb_perror_msg_and_die("fgets()"); 674 bb_perror_msg_and_die("fgets()");
675 } while (! isdigit(buf[0]) || buf[3] != ' '); 675 } while (! isdigit(buf[0]) || buf[3] != ' ');
676 676
677 return atoi(buf); 677 return atoi(buf);
678} 678}
679 679
680#ifdef CONFIG_FEATURE_WGET_STATUSBAR 680#ifdef CONFIG_FEATURE_WGET_STATUSBAR
681/* Stuff below is from BSD rcp util.c, as added to openshh. 681/* Stuff below is from BSD rcp util.c, as added to openshh.
682 * Original copyright notice is retained at the end of this file. 682 * Original copyright notice is retained at the end of this file.
683 * 683 *
684 */ 684 */
685 685
686 686
687static int 687static int
@@ -813,7 +813,7 @@ progressmeter(int flag)
813 813
814/* Original copyright notice which applies to the CONFIG_FEATURE_WGET_STATUSBAR stuff, 814/* Original copyright notice which applies to the CONFIG_FEATURE_WGET_STATUSBAR stuff,
815 * much of which was blatently stolen from openssh. */ 815 * much of which was blatently stolen from openssh. */
816 816
817/*- 817/*-
818 * Copyright (c) 1992, 1993 818 * Copyright (c) 1992, 1993
819 * The Regents of the University of California. All rights reserved. 819 * The Regents of the University of California. All rights reserved.
@@ -827,8 +827,8 @@ progressmeter(int flag)
827 * notice, this list of conditions and the following disclaimer in the 827 * notice, this list of conditions and the following disclaimer in the
828 * documentation and/or other materials provided with the distribution. 828 * documentation and/or other materials provided with the distribution.
829 * 829 *
830 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 830 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
831 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 831 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
832 * 832 *
833 * 4. Neither the name of the University nor the names of its contributors 833 * 4. Neither the name of the University nor the names of its contributors
834 * may be used to endorse or promote products derived from this software 834 * may be used to endorse or promote products derived from this software
@@ -846,7 +846,7 @@ progressmeter(int flag)
846 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 846 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
847 * SUCH DAMAGE. 847 * SUCH DAMAGE.
848 * 848 *
849 * $Id: wget.c,v 1.70 2004/03/06 22:11:44 andersen Exp $ 849 * $Id: wget.c,v 1.71 2004/03/15 08:28:53 andersen Exp $
850 */ 850 */
851 851
852 852