[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 23/55] curl: Keep pointer to the CURLState in CURLSocket
From: |
Michael Roth |
Subject: |
[PATCH 23/55] curl: Keep pointer to the CURLState in CURLSocket |
Date: |
Tue, 5 Nov 2019 14:52:11 -0600 |
From: Max Reitz <address@hidden>
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>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Reviewed-by: Maxim Levitsky <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
(cherry picked from commit 0487861685294660b23bc146e1ebd5304aa8bbe0)
Signed-off-by: Michael Roth <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.17.1
- [PATCH 00/55] Patch Round-up for stable 4.1.1, freeze on 2019-11-12, Michael Roth, 2019/11/05
- [PATCH 12/55] vpc: Return 0 from vpc_co_create() on success, Michael Roth, 2019/11/05
- [PATCH 11/55] x86: do not advertise die-id in query-hotpluggbale-cpus if '-smp dies' is not set, Michael Roth, 2019/11/05
- [PATCH 09/55] iotests: Test reverse sub-cluster qcow2 writes, Michael Roth, 2019/11/05
- [PATCH 14/55] iotests: Add supported protocols to execute_test(), Michael Roth, 2019/11/05
- [PATCH 18/55] target/arm: Free TCG temps in trans_VMOV_64_sp(), Michael Roth, 2019/11/05
- [PATCH 19/55] target/arm: Don't abort on M-profile exception return in linux-user mode, Michael Roth, 2019/11/05
- [PATCH 16/55] iotests: Restrict nbd Python tests to nbd, Michael Roth, 2019/11/05
- [PATCH 01/55] dma-helpers: ensure AIO callback is invoked after cancellation, Michael Roth, 2019/11/05
- [PATCH 23/55] curl: Keep pointer to the CURLState in CURLSocket,
Michael Roth <=
- [PATCH 20/55] libvhost-user: fix SLAVE_SEND_FD handling, Michael Roth, 2019/11/05
- [PATCH 24/55] curl: Keep *socket until the end of curl_sock_cb(), Michael Roth, 2019/11/05
- [PATCH 15/55] iotests: Restrict file Python tests to file, Michael Roth, 2019/11/05
- [PATCH 17/55] iotests: Test blockdev-create for vpc, Michael Roth, 2019/11/05
- [PATCH 26/55] curl: Pass CURLSocket to curl_multi_do(), Michael Roth, 2019/11/05
- [PATCH 28/55] curl: Handle success in multi_check_completion, Michael Roth, 2019/11/05
- [PATCH 32/55] qcow2: Fix corruption bug in qcow2_detect_metadata_preallocation(), Michael Roth, 2019/11/05
- [PATCH 36/55] make-release: pull in edk2 submodules so we can build it from tarballs, Michael Roth, 2019/11/05
- [PATCH 27/55] curl: Report only ready sockets, Michael Roth, 2019/11/05
- [PATCH 30/55] block/qcow2: Fix corruption introduced by commit 8ac0f15f335, Michael Roth, 2019/11/05