]> Git Repo - qemu.git/commitdiff
curl: Keep pointer to the CURLState in CURLSocket
authorMax Reitz <[email protected]>
Tue, 10 Sep 2019 12:41:30 +0000 (14:41 +0200)
committerMax Reitz <[email protected]>
Mon, 16 Sep 2019 13:31:11 +0000 (15:31 +0200)
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: [email protected]
Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: John Snow <[email protected]>
Message-id: 20190910124136[email protected]
Reviewed-by: Maxim Levitsky <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
block/curl.c

index d4c8e94f3e0fe26ee221e763356e300359d42946..92dc2f630e20f4a6b138c9c82b8b79064dea6304 100644 (file)
@@ -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;
This page took 0.028581 seconds and 4 git commands to generate.