summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortiptorrent development team <tiptorrent@soleta.eu>2022-02-08 16:04:50 +0100
committertiptorrent development team <tiptorrent@soleta.eu>2022-02-08 16:04:50 +0100
commit93c13ba67cf3ab43ffe1cc154caa802890f3a5f6 (patch)
tree246c09e84b3e1432c5c790560d9133ec735c92ac /src
parenta9899873198ffc1124f89b13c24091ab913a5ef1 (diff)
update statistics after successful download
Diffstat (limited to 'src')
-rw-r--r--src/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 7785150..3d6f50a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -187,11 +187,6 @@ static int tip_client_get_hdr(struct tip_client *cli)
return 1;
}
- if (cli->redirected)
- tip_client_stats.redirects++;
- else
- tip_client_stats.direct_from_server++;
-
lseek(cli->fd, cli->chunk_offset, SEEK_SET);
header_len = trailer - cli->buf;
payload = cli->buf + header_len;
@@ -601,6 +596,11 @@ int main(int argc, char *argv[])
if (ret < 0)
goto err_max_retries;
+ if (_cli.redirected)
+ tip_client_stats.redirects++;
+ else
+ tip_client_stats.direct_from_server++;
+
tip_client_progress(&_cli, true);
file_chunk[k] = true;
data_len += _cli.data_len;