summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/handler.c3
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;