[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 1/6] curl: Keep pointer to the CURLState in CURLSock
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH 1/6] curl: Keep pointer to the CURLState in CURLSocket |
Date: |
Tue, 27 Aug 2019 18:34:34 +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: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
block/curl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/curl.c b/block/curl.c
index d4c8e94f3e..92dc2f630e 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;
--
2.21.0
- [Qemu-block] [PATCH 0/6] block/curl: Fix hang and potential crash, Max Reitz, 2019/08/27
- [Qemu-block] [PATCH 1/6] curl: Keep pointer to the CURLState in CURLSocket,
Max Reitz <=
- [Qemu-block] [PATCH 2/6] curl: Keep *socket until the end of curl_sock_cb(), Max Reitz, 2019/08/27
- [Qemu-block] [PATCH 3/6] curl: Pass CURLSocket to curl_multi_{do, read}(), Max Reitz, 2019/08/27
- [Qemu-block] [PATCH 4/6] curl: Report only ready sockets, Max Reitz, 2019/08/27
- [Qemu-block] [PATCH 5/6] curl: Handle success in multi_check_completion, Max Reitz, 2019/08/27
- [Qemu-block] [PATCH 6/6] curl: Check curl_multi_add_handle()'s return code, Max Reitz, 2019/08/27