Commit b7079df4 authored by Matthew Booth's avatar Matthew Booth Committed by Kevin Wolf
Browse files

curl: Fix hang reading from slow connections



When receiving a new aio read request, we first look for an existing
transaction whose range will cover the read request by the time it
completes. However, we weren't checking that the existing transaction
was still active. If it had timed out, we were adding the request to a
transaction which would never complete and had already been cancelled,
resulting in a hang.

Signed-off-by: default avatarMatthew Booth <mbooth@redhat.com>
Tested-by: default avatarRichard W.M. Jones <rjones@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 1f2cead3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -220,7 +220,8 @@ static int curl_find_buf(BDRVCURLState *s, size_t start, size_t len,
        }

        // Wait for unfinished chunks
        if ((start >= state->buf_start) &&
        if (state->in_use &&
            (start >= state->buf_start) &&
            (start <= buf_fend) &&
            (end >= state->buf_start) &&
            (end <= buf_fend))