async_sock: fix truncating of the temporary iovec in writev_send/recv()
[ira/wip.git] / lib / async_req / async_sock.c
index f803b9cc36bf683cfd749c74c2f82e77ac15a779..be24bae6dfd5b27ea9dc8c2b3aca7e39530b3192 100644 (file)
@@ -485,7 +485,7 @@ static void writev_handler(struct tevent_context *ev, struct tevent_fd *fde,
                        state->iov[0].iov_len -= written;
                        break;
                }
-               written = state->iov[0].iov_len;
+               written -= state->iov[0].iov_len;
                state->iov += 1;
                state->count -= 1;
        }