[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/16] curl: Keep pointer to the CURLState in CURLSoc
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PULL 06/16] curl: Keep pointer to the CURLState in CURLSocket |
Date: |
Mon, 16 Sep 2019 16:22:36 +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>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Reviewed-by: Maxim Levitsky <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-devel] [PULL 00/16] Block patches, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 01/16] block: Use QEMU_IS_ALIGNED, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 02/16] block: Remove unused masks, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 03/16] tests/qemu-iotests/check: Replace "tests" with "iotests" in final status text, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 04/16] tests/Makefile: Do not print the name of the check-block.sh shell script, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 06/16] curl: Keep pointer to the CURLState in CURLSocket,
Max Reitz <=
- [Qemu-devel] [PULL 07/16] curl: Keep *socket until the end of curl_sock_cb(), Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 08/16] curl: Check completion in curl_multi_do(), Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 05/16] tests/qemu-iotests: Fix qemu-io related output in 026.out.nocache, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 09/16] curl: Pass CURLSocket to curl_multi_do(), Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 10/16] curl: Report only ready sockets, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 12/16] curl: Check curl_multi_add_handle()'s return code, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 11/16] curl: Handle success in multi_check_completion, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 13/16] blockjob: update nodes head while removing all bdrv, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 14/16] block/qcow2: Fix corruption introduced by commit 8ac0f15f335, Max Reitz, 2019/09/16
- [Qemu-devel] [PULL 15/16] block/qcow2: refactor encryption code, Max Reitz, 2019/09/16