curl: fix zabbix's curl_easy_setopt and curl_multi_socket_action

Close: #41602
This commit is contained in:
Đoàn Trần Công Danh 2023-01-13 08:54:23 +07:00
parent 61849898b4
commit 7e7ac2559f
3 changed files with 84 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 728400f875e845f72ee5602edb905f6301ade3e7 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 26 Dec 2022 09:59:20 +0100
Subject: [PATCH] cfilters:Curl_conn_get_select_socks: use the first
non-connected filter
When there are filters addded for both socket and SSL, the code
previously checked the SSL sockets during connect when it *should* first
check the socket layer until that has connected.
Fixes #10157
Fixes #10146
Closes #10160
Reviewed-by: Stefan Eissing
---
lib/cfilters.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/cfilters.c b/lib/cfilters.c
index 8951533418915..8b05fbc8f4381 100644
--- a/lib/cfilters.c
+++ b/lib/cfilters.c
@@ -437,6 +437,10 @@ int Curl_conn_get_select_socks(struct Curl_easy *data, int sockindex,
DEBUGASSERT(data);
DEBUGASSERT(data->conn);
cf = data->conn->cfilter[sockindex];
+
+ /* if the next one is not yet connected, that's the one we want */
+ while(cf && cf->next && !cf->next->connected)
+ cf = cf->next;
if(cf) {
return cf->cft->get_select_socks(cf, data, socks);
}

View File

@ -0,0 +1,49 @@
From e2aed004302e51cfa5b6ce8c8ab65ef92aa83196 Mon Sep 17 00:00:00 2001
From: Patrick Monnerat <patrick@monnerat.net>
Date: Fri, 23 Dec 2022 15:35:27 +0100
Subject: [PATCH] typecheck: accept expressions for option/info parameters
As expressions can have side effects, evaluate only once.
To enable deprecation reporting only once, get rid of the __typeof__
use to define the local temporary variable and use the target type
(CURLoption/CURLINFO). This also avoids multiple reports on type
conflicts (if some) by the curlcheck_* macros.
Note that CURLOPT_* and CURLINFO_* symbols may be deprecated, but not
their values: a curl_easy_setopt call with an integer constant as option
will never report a deprecation.
Reported-by: Thomas Klausner
Fixes #10148
Closes #10149
---
include/curl/typecheck-gcc.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h
index bf655bb63220d..85aa8b7b49422 100644
--- a/include/curl/typecheck-gcc.h
+++ b/include/curl/typecheck-gcc.h
@@ -42,9 +42,8 @@
*/
#define curl_easy_setopt(handle, option, value) \
__extension__({ \
- CURL_IGNORE_DEPRECATION(__typeof__(option) _curl_opt = option;) \
+ CURLoption _curl_opt = (option); \
if(__builtin_constant_p(_curl_opt)) { \
- (void) option; \
CURL_IGNORE_DEPRECATION( \
if(curlcheck_long_option(_curl_opt)) \
if(!curlcheck_long(value)) \
@@ -120,9 +119,8 @@
/* wraps curl_easy_getinfo() with typechecking */
#define curl_easy_getinfo(handle, info, arg) \
__extension__({ \
- CURL_IGNORE_DEPRECATION(__typeof__(info) _curl_info = info;) \
+ CURLINFO _curl_info = (info); \
if(__builtin_constant_p(_curl_info)) { \
- (void) info; \
CURL_IGNORE_DEPRECATION( \
if(curlcheck_string_info(_curl_info)) \
if(!curlcheck_arr((arg), char *)) \

View File

@ -1,7 +1,7 @@
# Template file for 'curl'
pkgname=curl
version=7.87.0
revision=1
revision=2
build_style=gnu-configure
configure_args="ac_cv_sizeof_off_t=8 --enable-threaded-resolver --enable-ipv6
--enable-websockets --with-random=/dev/urandom