diff options
author | tiptorrent development team <tiptorrent@soleta.eu> | 2021-09-13 11:59:44 +0200 |
---|---|---|
committer | tiptorrent development team <tiptorrent@soleta.eu> | 2021-09-29 15:48:18 +0200 |
commit | 21aa4a9315921413743e2aa006f6e1102ff71c63 (patch) | |
tree | d1178b02866f8fd21d963e4885ad8d51cf49ae13 /src | |
parent | 7a04638c320c61eb52c0a849fc8cf5ddd6e1ad8c (diff) |
check sendfile error
Diffstat (limited to 'src')
-rw-r--r-- | src/handler.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |