diff options
Diffstat (limited to 'libthor/thor_net.c')
-rw-r--r-- | libthor/thor_net.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libthor/thor_net.c b/libthor/thor_net.c index 29cb295..9da314c 100644 --- a/libthor/thor_net.c +++ b/libthor/thor_net.c @@ -242,8 +242,6 @@ static void data_finished(sigval_t sigval) struct t_thor_net_transfer *transfer = chunk->user_data; int ret; - chunk->data_finished = 1; - ret = aio_error(&chunk->data_transfer); if (ret == ECANCELED || transfer->ret) { return; @@ -260,6 +258,7 @@ static void data_finished(sigval_t sigval) return; } + chunk->data_finished = 1; if (chunk->resp_finished) check_next_chunk(chunk, transfer); } @@ -270,7 +269,6 @@ static void resp_finished(sigval_t sigval) struct t_thor_net_transfer *transfer = chunk->user_data; int ret; - chunk->resp_finished = 1; transfer->data_in_progress -= chunk->useful_size; ret = aio_error(&chunk->resp_transfer); @@ -309,6 +307,7 @@ static void resp_finished(sigval_t sigval) chunk->chunk_number, transfer->user_data); + chunk->resp_finished = 1; if (chunk->data_finished) check_next_chunk(chunk, transfer); } |