summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch/fetch.c
Commit message (Collapse)AuthorAgeFilesLines
* Use floating point arithmetic to compute the ETA to avoid integer overflowdes2003-03-111-1/+1
| | | | during slow transfers of large files.
* Clean up the ETA logic a bit and make sure it works for restarted transfers.des2003-03-111-7/+8
|
* Slight cleanup of the ETA / BPS code. Avoid a division by zero.des2003-01-231-14/+12
|
* Add -N option to specify a netrc file.des2003-01-221-29/+66
| | | | | | | Fix handling of -v option. Don't treat negative offsets as valid positive ones. Clean up the ETA and transfer rate code. Show transfer rate along with ETA if the verbose level is higher than 1.
* Use the URL instead of the output file name when reporting errors relatingdes2002-11-271-6/+6
| | | | | | | | to the remote document. PR: 33856 MFC after: 1 week Approved by: re
* Don't set atime / mtime if we don't have an output file, which can happendes2002-11-131-2/+2
| | | | in certain failure scenarii (mostly DNS trouble).
* Don't divide by zero to calculate the ETA, even if we haven't gottenfenner2002-11-121-1/+1
| | | | any data in 30 seconds.
* Don't exit with success after timeout during authentication.fenner2002-11-071-0/+4
|
* Don't complain about not knowing the remote file size when working indes2002-10-271-1/+1
| | | | | | | quiet mode. PR: bin/37079 Submitted by: Nicolas Rachinsky <list@rachinsky.de>
* Whitespace and indentation cleanup.des2002-10-271-12/+12
|
* Forgot to disable alarms after fetchXGet() in previous commit.des2002-10-271-0/+2
|
* Add an ETA timer that kicks in after 30 seconds.des2002-10-271-16/+45
| | | | | | | | | | | | | | | | Re-add alarm(2) calls around the calls to fetchStat(3) and fetchXGet(3), since these calls can still time out on DNS lookups or TCP connect(2). Remove the alarm(2) calls in the main loop, since all methods properly handle transfer timeouts (as opposed to connection timeouts). Set the sigalrm flag if a timeout occurs in the main loop. Move the signal: label up a little so we still set the atime and mtime when the transfer times out or is interrupted, so that restarted transfers will work as expected (as long as the file still exists). MFC after: 2 weeks
* s/optarg/s/ (cut'n'paste braino)des2002-08-271-6/+4
| | | | Spotted by: kris
* Use strtol(3) instead of a home-grown version, and fix a "possiblydes2002-07-281-36/+24
| | | | unitialized variable" warning.
* Usage style sweep: spell "usage" with a small 'u'.des2002-04-221-1/+1
| | | | | Also change one case of blatant __progname abuse (several more remain) This commit does not touch anything in src/{contrib,crypto,gnu}/.
* Restored the part of 1.45 that was clobbered in rev.1.46:bde2002-03-271-0/+1
| | | | | #include <sys/time.h> instead of depending on namespace pollution in <sys/stat.h> for the declaration of struct timeval.
* Add FBSDID. Remove unused include. Getopt returns -1 not EOF.charnier2002-03-261-5/+5
|
* #include <sys/time.h> instead of depending on namespace pollution inbde2002-02-251-2/+2
| | | | | | | | | <sys/stat.h> for the declaration of struct timeval. Removed unused includes (<time.h> doesn't declare anything of interest; only <sys/time.h> does). Sorted includes a bit.
* If downloading to a temporary file, set the timestamp on the temp file, notdes2002-02-161-2/+2
| | | | | | | | on the file we're replacing. PR: bin/34992 Submitted by: Shunichiro Ariura <syun1rou@blackshell.org> MFC after: 1 week
* Set fetchDebug if v_level is 3 or more.des2001-12-091-0/+2
| | | | | PR: bin/32615 MFC after: 1 week
* Remove an extraneous argument to fprintf that -Wformat noticed.iedowse2001-11-101-1/+1
| | | | Reviewed by: des
* Remove a debugging warnx() that got committed by mistake.des2001-11-031-1/+0
|
* Don't print running stats unless we're the foreground process.des2001-09-231-0/+11
| | | | PR: 30764
* Add a cast to silence a warning (error because of WARNS=2) on Alpha.mike2001-09-101-1/+1
| | | | Discussed with: des
* If the local file does not exist, or is a regular file, and we're not tryingdes2001-09-081-27/+71
| | | | | | | | | | | | | to resume a transfer, download the requested document into a temporary file which we later rename. This avoids leaving half-completed files around in case of a crash (it'll still leave a half-completed file, but with a hope- fully non-conflicting name), and should reduce the need for human inter- vention on ports-building machines. The temporary file name for "foo/bar" is constructed by invoking mkstemps() with the pattern "foo/.fetch.XXXXXX.bar" Requested by: obrien
* Remove a blank line that snuck in with the previous commit.des2001-08-181-1/+1
| | | | Set the default timeout to 120 seconds instead of 0 (no timeout).
* Add some comments.des2001-08-171-3/+26
|
* Include value of command line argument that causes an error message orse2001-07-281-6/+9
| | | | | | | warning in said message, since fetch may be run from a makefile or script which does not print the command line. Approved by: des
* If we're writing to stdout, we don't care about the size.des2001-07-171-1/+1
| | | | Submitted by: wollman
* WARNS cleanup + remove an unused macro and an unused function argument.des2001-07-171-648/+653
|
* Fix an embarassing if-test-reversal bug that broke scheme guessing.des2001-07-081-2/+2
|
* Don't try to print a completion percentage for zero-size files.des2001-06-011-1/+1
| | | | | PR: 27780 Submitted by: Craig Leres <leres@ee.lbl.gov>
* Damn. Fix typo in previous commit.des2001-05-271-1/+1
|
* When running on a tty, install an authentication callback.des2001-05-261-8/+52
|
* Bring the usage message in synch with reality.des2001-03-281-3/+2
| | | | PR: bin/26160
* Now that libfetch uses the high port range by default, add a -U option todes2001-03-241-7/+10
| | | | make it use the low (default) port range instead.
* If SIGINFO is received during the transfer, print a status line similardes2001-03-071-5/+29
| | | | | | | | to the summary shown at the end of the transfer. Some days, I really hate Unix... Suggested by: cracauer
* Warn if the size of the remote file isn't known.des2000-12-221-2/+11
| | | | | | | If the -R option was specified, don't truncate the local file even if its mtime is incorrect. PR: bin/23719
* If the URL did not specify a scheme, try to guess it from the host name.des2000-12-131-0/+10
|
* If the transfer timed out, but we don't know how large the file is supposeddes2000-11-301-1/+10
| | | | to be, assume it was truncated.
* Format string auditingkris2000-11-271-2/+2
|
* Understand the difference between an empty file and a non-existent file.des2000-10-191-9/+13
| | | | This has been sitting in my tree for ages...
* Don't try to set the mtime of the output file if it's not a regular file.des2000-09-021-1/+2
| | | | Pointed out by: cwt
* Don't unlink the target file if it's not a regular file.des2000-08-311-1/+2
|
* Restore the old semantics of deleting the output file when interrupted.des2000-07-261-2/+4
| | | | Some people liked this and some didn't, so POLA won.
* Don't print summary in quiet mode.des2000-07-211-0/+3
|
* Don't display a running count in quiet mode.des2000-07-211-2/+7
| | | | | Don't add the offset to the size; it's libfetch's job to report the correct size of the requested file.
* Fix two bugs related to resumed transfers:des2000-07-191-20/+26
| | | | | | | | | | - if the dates didn't match, fetch would append the received file to the existing file instead of replacing it. - if the local file was complete and up-to-date, fetch would miscalculate the expected size and report a failure instead of a success, because it had no way of knowing that the server was actually resending the entire file since the requested offset was invalid.
* Braino: don't use passive mode unless the user requests it.des2000-07-191-1/+1
| | | | | PR: bin/20025 Submitted by: HIYAMA Takeshi <th@cis.ibaraki.ac.jp>
* While I'm at it, break a line that was too long, remove a pointless diagnosticdes2000-07-171-3/+3
| | | | and adjust the verbosity level of another.
OpenPOWER on IntegriCloud