]> Git Repo - qemu.git/commitdiff
curl: strengthen assertion in curl_clean_state
authorPaolo Bonzini <[email protected]>
Mon, 15 May 2017 10:00:53 +0000 (12:00 +0200)
committerJeff Cody <[email protected]>
Tue, 16 May 2017 14:34:03 +0000 (10:34 -0400)
curl_clean_state should only be called after all AIOCBs have been
completed.  This is not so obvious for the call from curl_detach_aio_context,
so assert that.

Cc: [email protected]
Reviewed-by: Jeff Cody <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Message-id: 20170515100059[email protected]
Signed-off-by: Jeff Cody <[email protected]>
block/curl.c

index 43822348d6cc510e2e270624db6d8c89eb3fa41b..562340f4365181c88b614ebbcda37f82b24bb01e 100644 (file)
@@ -533,6 +533,11 @@ static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s)
 
 static void curl_clean_state(CURLState *s)
 {
+    int j;
+    for (j = 0; j < CURL_NUM_ACB; j++) {
+        assert(!s->acb[j]);
+    }
+
     if (s->s->multi)
         curl_multi_remove_handle(s->s->multi, s->curl);
 
This page took 0.041801 seconds and 4 git commands to generate.