check sendfile error

master
tiptorrent development team 2021-09-13 11:59:44 +02:00
parent 7a04638c32
commit 21aa4a9315
1 changed files with 2 additions and 1 deletions

View File

@ -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;