From 21aa4a9315921413743e2aa006f6e1102ff71c63 Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Mon, 13 Sep 2021 11:59:44 +0200 Subject: check sendfile error --- src/handler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/handler.c b/src/handler.c index b283ea6..8e81c1f 100644 --- a/src/handler.c +++ b/src/handler.c @@ -164,7 +164,8 @@ int tip_client_state_process_payload_reply(struct tip_client *cli) int tip_client_state_process_payload_bulk(struct tip_client *cli) { - sendfile(tip_client_socket(cli), cli->fd, &cli->offset, BLOCK); + if (sendfile(tip_client_socket(cli), cli->fd, &cli->offset, BLOCK) < 0) + return -1; if (cli->offset >= cli->size) { cli->state = TIP_CLIENT_CLOSE_WAIT; -- cgit v1.2.3-18-g5258