curl: split curl_find_state/curl_init_state
commit3ce6a729b5d78b13283ddc6c529811f67519a62d
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 15 May 2017 10:00:56 +0000 (15 12:00 +0200)
committerJeff Cody <jcody@redhat.com>
Tue, 16 May 2017 14:34:45 +0000 (16 10:34 -0400)
tree2471b85f5d8e5e5ce67ca049d24ccd0f8564a39e
parent456af346297ebef86aa097b3609534d34f3d2f75
curl: split curl_find_state/curl_init_state

If curl_easy_init fails, a CURLState is left with s->in_use = 1.  Split
curl_init_state in two, so that we can distinguish the two failures and
call curl_clean_state if needed.

While at it, simplify curl_find_state, removing a dummy loop.  The
aio_poll loop is moved to the sole caller that needs it.

Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20170515100059.15795-5-pbonzini@redhat.com
Signed-off-by: Jeff Cody <jcody@redhat.com>
block/curl.c