aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-09-10 14:41:30 +0200
committerMax Reitz <mreitz@redhat.com>2019-09-16 15:31:11 +0200
commit0487861685294660b23bc146e1ebd5304aa8bbe0 (patch)
tree3a228f3dc39dd987d7a6cbc8c3d1ae760ad1a492
parent9407cf862ceabddb22ae4bad5a0c8cb5ef6979c5 (diff)
downloadqemu-0487861685294660b23bc146e1ebd5304aa8bbe0.zip
qemu-0487861685294660b23bc146e1ebd5304aa8bbe0.tar.gz
qemu-0487861685294660b23bc146e1ebd5304aa8bbe0.tar.bz2
curl: Keep pointer to the CURLState in CURLSocket
A follow-up patch will make curl_multi_do() and curl_multi_read() take a CURLSocket instead of the CURLState. They still need the latter, though, so add a pointer to it to the former. Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190910124136.10565-2-mreitz@redhat.com Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
-rw-r--r--block/curl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/curl.c b/block/curl.c
index d4c8e94..92dc2f6 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -80,6 +80,7 @@ static CURLMcode __curl_multi_socket_action(CURLM *multi_handle,
#define CURL_BLOCK_OPT_TIMEOUT_DEFAULT 5
struct BDRVCURLState;
+struct CURLState;
static bool libcurl_initialized;
@@ -97,6 +98,7 @@ typedef struct CURLAIOCB {
typedef struct CURLSocket {
int fd;
+ struct CURLState *state;
QLIST_ENTRY(CURLSocket) next;
} CURLSocket;
@@ -180,6 +182,7 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
if (!socket) {
socket = g_new0(CURLSocket, 1);
socket->fd = fd;
+ socket->state = state;
QLIST_INSERT_HEAD(&state->sockets, socket, next);
}
socket = NULL;