From 84efa411c78eee4366e5077425d790199a173f93 Mon Sep 17 00:00:00 2001 From: wenyuzifang Date: Thu, 26 Jun 2025 14:20:11 +0800 Subject: [PATCH] Update code from upstream --- 0002-Use-proper-datatypes-for-long-long.patch | 84 +++++++++++++++++++ 0003-allow-30x-redirections.patch | 28 +++++++ xmlrpc-c.spec | 12 ++- 3 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 0002-Use-proper-datatypes-for-long-long.patch create mode 100644 0003-allow-30x-redirections.patch diff --git a/0002-Use-proper-datatypes-for-long-long.patch b/0002-Use-proper-datatypes-for-long-long.patch new file mode 100644 index 0000000..25c7efe --- /dev/null +++ b/0002-Use-proper-datatypes-for-long-long.patch @@ -0,0 +1,84 @@ +From aca713786debd68c81a823c5989afb3de82da45b Mon Sep 17 00:00:00 2001 +From: Enrico Scholz +Date: Sat, 5 Apr 2008 11:41:34 +0200 +Subject: [PATCH 2/3] Use proper datatypes for 'long long' + +xmlrpc-c uses 'long long' at some places (e.g. in printf +statements with PRId64) under the assumption that it has a +width of exactly 64 bits. + +On 64 bit machines 'long long' has a width of 128 bit and +will cause overhead both in memory and cpu usage there. As +'long long' is used only to handle datatypes, the patch +uses a plain 64 integer type there. + +It is arguable whether 'int_least64_t' (and 'int_least32_t') +would be a better choice for 'int64_t' (and 'int32_t'), but +for now, the patch uses datatypes with exact widths. +--- + include/xmlrpc-c/base.h | 7 ++++--- + lib/libutil/string_number.c | 1 + + src/cpp/param_list.cpp | 2 +- + 3 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/include/xmlrpc-c/base.h b/include/xmlrpc-c/base.h +index e74e2c5..90f2c91 100644 +--- a/include/xmlrpc-c/base.h ++++ b/include/xmlrpc-c/base.h +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include + #include /* For XMLRPC_DLLEXPORT */ + #include +@@ -73,9 +74,9 @@ xmlrpc_version(unsigned int * const majorP, + + typedef signed int xmlrpc_int; + /* An integer of the type defined by XML-RPC ; i.e. 32 bit */ +-typedef XMLRPC_INT32 xmlrpc_int32; ++typedef int32_t xmlrpc_int32; + /* An integer of the type defined by XML-RPC ; i.e. 32 bit */ +-typedef XMLRPC_INT64 xmlrpc_int64; ++typedef int64_t xmlrpc_int64; + /* An integer of the type defined by "XML-RPC" ; i.e. 64 bit */ + typedef int xmlrpc_bool; + /* A boolean (of the type defined by XML-RPC , but there's +@@ -112,7 +113,7 @@ typedef int xmlrpc_socket; + #define XMLRPC_INT32_MAX 0x7fffffff + #define XMLRPC_INT32_MIN (-XMLRPC_INT32_MAX - 1) + +-#define XMLRPC_INT64_MAX 0x7fffffffffffffffll ++#define XMLRPC_INT64_MAX ((xmlrpc_int64)0x7fffffffffffffffll) + #define XMLRPC_INT64_MIN (-XMLRPC_INT64_MAX - 1) + + +diff --git a/lib/libutil/string_number.c b/lib/libutil/string_number.c +index 1c284af..a7e78ad 100644 +--- a/lib/libutil/string_number.c ++++ b/lib/libutil/string_number.c +@@ -6,6 +6,7 @@ + ============================================================================*/ + #include + #include ++#include + #include + + #include +diff --git a/src/cpp/param_list.cpp b/src/cpp/param_list.cpp +index 1f7ae41..60f7df9 100644 +--- a/src/cpp/param_list.cpp ++++ b/src/cpp/param_list.cpp +@@ -277,7 +277,7 @@ paramList::getI8(unsigned int const paramNumber, + throw(fault("Parameter that is supposed to be 64-bit integer is not", + fault::CODE_TYPE)); + +- long long const longlongvalue(static_cast( ++ xmlrpc_int64 const longlongvalue(static_cast( + value_i8(this->paramVector[paramNumber]))); + + if (longlongvalue < minimum) +-- +2.13.1 + diff --git a/0003-allow-30x-redirections.patch b/0003-allow-30x-redirections.patch new file mode 100644 index 0000000..2fef64d --- /dev/null +++ b/0003-allow-30x-redirections.patch @@ -0,0 +1,28 @@ +From 9bb040a9ae29e1b5afcb674c74f107114b316818 Mon Sep 17 00:00:00 2001 +From: Enrico Scholz +Date: Thu, 29 Jul 2010 19:25:32 +0200 +Subject: [PATCH 3/3] allow 30x redirections + +--- + lib/curl_transport/curltransaction.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/lib/curl_transport/curltransaction.c b/lib/curl_transport/curltransaction.c +index f0aafae..b5392a9 100644 +--- a/lib/curl_transport/curltransaction.c ++++ b/lib/curl_transport/curltransaction.c +@@ -671,6 +671,10 @@ setupCurlSession(xmlrpc_env * const envP, + + curl_easy_setopt(curlSessionP, CURLOPT_POST, 1); + curl_easy_setopt(curlSessionP, CURLOPT_URL, transP->serverUrl); + ++ curl_easy_setopt(curlSessionP, CURLOPT_FOLLOWLOCATION, 1); ++ curl_easy_setopt(curlSessionP, CURLOPT_MAXREDIRS, (long)10); ++ curl_easy_setopt(curlSessionP, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL); ++ + XMLRPC_MEMBLOCK_APPEND(char, envP, transP->postDataP, "\0", 1); + if (!envP->fault_occurred) { + curl_easy_setopt(curlSessionP, CURLOPT_POSTFIELDS, +-- +2.13.1 + diff --git a/xmlrpc-c.spec b/xmlrpc-c.spec index 9864f65..049e575 100644 --- a/xmlrpc-c.spec +++ b/xmlrpc-c.spec @@ -1,7 +1,7 @@ -%define anolis_release 2 +%define anolis_release 1 Name: xmlrpc-c -Version: 1.54.05 +Version: 1.59.02 Release: %{anolis_release}%{?dist} Summary: Lightweight RPC library based on XML and HTTP # See doc/COPYING for details. @@ -13,6 +13,8 @@ Source0: https://nchc.dl.sourceforge.net/project/xmlrpc-c/Xmlrpc-c%20Supe Patch1: 0001-xmlrpc_server_abyss-use-va_args-properly.patch # enable openssl Patch2: 0002-build-with-openssl.patch +Patch3: 0003-allow-30x-redirections.patch +Patch4: 0002-Use-proper-datatypes-for-long-long.patch BuildRequires: git-core BuildRequires: meson >= 0.36.0 @@ -210,8 +212,12 @@ find %{buildroot} -name "*.a" -delete %doc doc/CREDITS doc/HISTORY tools/xmlrpc_transport/xmlrpc_transport.html %changelog +* Thu Jun 26 2025 wenyuzifang - 1.59.02-1 +- Updated to version 1.59.02 to fix xxxxxxxxx +- Use fixed-width types for 64-bit integers to ensure correctness and efficiency across platforms. + * Sat Mar 04 2023 Shawn Wang - 1.54.05-2 - optimize the spec file * Fri Apr 15 2022 Chunmei Xu - 1.54.05-1 -- init from upstream +- init from upstream \ No newline at end of file -- Gitee