Bug: Failed to download file which size is 0

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao
2021-01-25 20:49:19 +08:00
parent b366ff2fab
commit c489816534
+2 -2
View File
@@ -79,13 +79,13 @@ static void on_file_read(struct ev_loop *loop, struct ev_io *w, int revents)
buffer_put_data(&rtty->wb, buf, ret);
ev_io_start(rtty->loop, &rtty->iow);
notify_progress(ctx);
if (ret == 0) {
ctx->busy = false;
ev_io_stop(loop, w);
close(ctx->fd);
ctx->fd = -1;
} else {
notify_progress(ctx);
}
}