|
|
016a62 |
From 46598620c18de69d9565e662a47d2615984cc49b Mon Sep 17 00:00:00 2001
|
|
|
016a62 |
From: Max Reitz <mreitz@redhat.com>
|
|
|
016a62 |
Date: Tue, 19 Nov 2019 15:29:55 +0000
|
|
|
016a62 |
Subject: [PATCH 3/8] curl: Keep *socket until the end of curl_sock_cb()
|
|
|
016a62 |
MIME-Version: 1.0
|
|
|
016a62 |
Content-Type: text/plain; charset=UTF-8
|
|
|
016a62 |
Content-Transfer-Encoding: 8bit
|
|
|
016a62 |
|
|
|
016a62 |
RH-Author: Max Reitz <mreitz@redhat.com>
|
|
|
016a62 |
Message-id: <20191119153000.101646-3-mreitz@redhat.com>
|
|
|
016a62 |
Patchwork-id: 92517
|
|
|
016a62 |
O-Subject: [RHEL-8.2.0 qemu-kvm PATCH 2/7] curl: Keep *socket until the end of curl_sock_cb()
|
|
|
016a62 |
Bugzilla: 1744602
|
|
|
016a62 |
RH-Acked-by: Maxim Levitsky <mlevitsk@redhat.com>
|
|
|
016a62 |
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
|
|
|
016a62 |
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
|
016a62 |
|
|
|
016a62 |
This does not really change anything, but it makes the code a bit easier
|
|
|
016a62 |
to follow once we use @socket as the opaque pointer for
|
|
|
016a62 |
aio_set_fd_handler().
|
|
|
016a62 |
|
|
|
016a62 |
Cc: qemu-stable@nongnu.org
|
|
|
016a62 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
016a62 |
Message-id: 20190910124136.10565-3-mreitz@redhat.com
|
|
|
016a62 |
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
|
|
|
016a62 |
Reviewed-by: John Snow <jsnow@redhat.com>
|
|
|
016a62 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
016a62 |
(cherry picked from commit 007f339b1099af46a008dac438ca0943e31dba72)
|
|
|
016a62 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
016a62 |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
016a62 |
---
|
|
|
016a62 |
block/curl.c | 10 +++++-----
|
|
|
016a62 |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
016a62 |
|
|
|
016a62 |
diff --git a/block/curl.c b/block/curl.c
|
|
|
016a62 |
index fa602d1..b3fe09f 100644
|
|
|
016a62 |
--- a/block/curl.c
|
|
|
016a62 |
+++ b/block/curl.c
|
|
|
016a62 |
@@ -181,10 +181,6 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
|
|
|
016a62 |
|
|
|
016a62 |
QLIST_FOREACH(socket, &state->sockets, next) {
|
|
|
016a62 |
if (socket->fd == fd) {
|
|
|
016a62 |
- if (action == CURL_POLL_REMOVE) {
|
|
|
016a62 |
- QLIST_REMOVE(socket, next);
|
|
|
016a62 |
- g_free(socket);
|
|
|
016a62 |
- }
|
|
|
016a62 |
break;
|
|
|
016a62 |
}
|
|
|
016a62 |
}
|
|
|
016a62 |
@@ -194,7 +190,6 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
|
|
|
016a62 |
socket->state = state;
|
|
|
016a62 |
QLIST_INSERT_HEAD(&state->sockets, socket, next);
|
|
|
016a62 |
}
|
|
|
016a62 |
- socket = NULL;
|
|
|
016a62 |
|
|
|
016a62 |
DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, (int)fd);
|
|
|
016a62 |
switch (action) {
|
|
|
016a62 |
@@ -216,6 +211,11 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
|
|
|
016a62 |
break;
|
|
|
016a62 |
}
|
|
|
016a62 |
|
|
|
016a62 |
+ if (action == CURL_POLL_REMOVE) {
|
|
|
016a62 |
+ QLIST_REMOVE(socket, next);
|
|
|
016a62 |
+ g_free(socket);
|
|
|
016a62 |
+ }
|
|
|
016a62 |
+
|
|
|
016a62 |
return 0;
|
|
|
016a62 |
}
|
|
|
016a62 |
|
|
|
016a62 |
--
|
|
|
016a62 |
1.8.3.1
|
|
|
016a62 |
|