| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Adds "fatal" bool field to struct tip_client.
Fatal is looked for when cli->error is set, if fatal is set then no
retry is done and tiptorrent-client should terminate.
|
| |
|
|
|
|
|
|
|
|
| |
Keep client retry count when something goes wrong requesting
file size (HEAD request).
Fixes a bug where tiptorrent-client keeps sending HEAD requests
indifinitely when something goes wrong at this stage.
|
|
|
|
|
|
|
|
|
|
| |
posix_fallocate does not return -1 for an error case.
Replace posix_fallocate for fallocate which does return -1 when
something goes wrong. See fallocate(2):
On success, fallocate() returns zero.
On error, -1 is returned and errno is set to indicate the error.
|
|
|
|
|
|
|
|
|
| |
Test can be run with an optional number, this number indicates how many
client processes to run. Eg: ./run-tests.sh 50
Defaults to 18 clients when no parameter is supplied.
Also, wait for shell jobs to finish before exit.
|
|
|
|
|
| |
subtract HTTP header otherwise connection is closed before all data is
received.
|
| |
|
| |
|
| |
|
|
|
|
| |
Reset the client object after retrying connection to download file.
|
| |
|
|
|
|
|
|
|
|
| |
Use the HTTP header field:
X-Accept-Redirect: off
to ask for a direct download from the server.
|
|
|
|
|
| |
stop downloading remaining chunks if one is missing after the maximum number of
retries.
|
| |
|
|
|
|
|
|
|
| |
The client sends a HTTP HEAD request to the server to check that the file exists
and to get the file size, then it calls open() to create the file and
fallocate() to preallocate the bytes. The client calculates the offset based on
the chunk number and it calls lseek().
|
| |
|
|
|
|
|
| |
If the first recv() call fully gets the HTTP header and the file chunk, then
tip_client_get_hdr() returns 1 to enter the TIP_CLIENT_DONE state to finish.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
- if the connection to server fails, retry 5 times, sleeping 5 seconds before
each retry.
- if the redirection fails, go back and request the chunk from the server again.
|
|
|
|
| |
to avoid bloating the logs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Print a progress message to stdout:
0% (0 Mbytes/second) file.img.2 from 192.168.2.179:9999
29% (113 Mbytes/second) file.img.2 from 192.168.2.179:9999
59% (113 Mbytes/second) file.img.2 from 192.168.2.179:9999
88% (114 Mbytes/second) file.img.2 from 192.168.2.179:9999
100% (128 Mbytes/second) file.img.2 from 192.168.2.179:9999
0% (0 Mbytes/second) file.img.3 from 192.168.2.179:9999
29% (113 Mbytes/second) file.img.3 from 192.168.2.179:9999
58% (113 Mbytes/second) file.img.3 from 192.168.2.179:9999
88% (113 Mbytes/second) file.img.3 from 192.168.2.179:9999
100% (128 Mbytes/second) file.img.3 from 192.168.2.179:9999
0% (0 Mbytes/second) file.img.1 from 192.168.2.179:9999
29% (114 Mbytes/second) file.img.1 from 192.168.2.179:9999
59% (114 Mbytes/second) file.img.1 from 192.168.2.179:9999
88% (113 Mbytes/second) file.img.1 from 192.168.2.179:9999
100% (128 Mbytes/second) file.img.1 from 192.168.2.179:9999
0% (0 Mbytes/second) file.img.0 from 192.168.2.179:9999
29% (113 Mbytes/second) file.img.0 from 192.168.2.179:9999
59% (113 Mbytes/second) file.img.0 from 192.168.2.179:9999
88% (113 Mbytes/second) file.img.0 from 192.168.2.179:9999
100% (128 Mbytes/second) file.img.0 from 192.168.2.179:9999
OK.
|
| |
|
| |
|
|
|
|
| |
fix divide by zero if file download takes less than 1 second.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
accumulate data from all file
|
| |
|
| |
|
|
|
|
| |
Use syslog() and do not check for EINPROGRESS on the second connect() call.
|
| |
|
| |
|
|
|