From 86beaee6e6fc602f170dc4a7efd205253b37142a Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Sat, 12 Feb 2022 12:54:34 +0100 Subject: fix received data incorrect arithmetics subtract HTTP header otherwise connection is closed before all data is received. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 1372437..969e287 100644 --- a/src/main.c +++ b/src/main.c @@ -191,7 +191,7 @@ static int tip_client_get_hdr(struct tip_client *cli) header_len = trailer - cli->buf; payload = cli->buf + header_len; payload_len = cli->buf_len - header_len; - cli->data_len += cli->buf_len; + cli->data_len += payload_len; cli->buf_len = 0; gettimeofday(&cli->tv_start, NULL); cli->tv_last = cli->tv_start; -- cgit v1.2.3-18-g5258