Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
11c605b811
!31 Update to version 1.3.10
From: @XWwalker 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
2023-08-10 01:57:02 +00:00
xingwei
3e7d05f9d0 Update to version 1.3.10 2023-08-09 09:58:34 +00:00
openeuler-ci-bot
3ae4be2e14
!29 fix problem of scons build of print
From: @li-miaomiao_zhr 
Reviewed-by: @zengwefeng 
Signed-off-by: @zengwefeng
2023-05-05 09:05:55 +00:00
li-miaomiao_zhr
8d266c25f5 fix problem of scons build of print 2023-05-04 15:41:11 +08:00
openeuler-ci-bot
1d93d57a93
!25 bugfix:源代码内指定 gcc 编译器导致 LLVM 下编译错误
From: @backjace 
Reviewed-by: @zengwefeng 
Signed-off-by: @zengwefeng
2023-04-26 10:46:31 +00:00
sjxur
583934ac7d fix CC compiler error 2023-04-26 16:46:52 +08:00
openeuler-ci-bot
b365c45e85
!24 fix build with openssl 3.0
From: @eaglegai 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2023-02-01 08:59:03 +00:00
eaglegai
2b70d47736 fix build with openssl 3.0 2023-02-01 08:23:48 +00:00
openeuler-ci-bot
436f938119
!23 【轻量级 PR】:modify description about libserf
From: @eaglegai 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2022-10-22 03:37:21 +00:00
eaglegai
1ff7e27200
modify description about libserf
Signed-off-by: eaglegai <eaglegai@163.com>
2022-10-22 02:33:10 +00:00
7 changed files with 224 additions and 38 deletions

View File

@ -0,0 +1,38 @@
From aa8e7871ddf3f852f79161f83a8f51f1fa186e42 Mon Sep 17 00:00:00 2001
From: sjxur <sjxur@isoftstone.com>
Date: Mon, 24 Apr 2023 17:26:43 +0800
Subject: [PATCH] fix CC compiler error
---
SConstruct | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/SConstruct b/SConstruct
index 4358a23..01aa8f7 100644
--- a/SConstruct
+++ b/SConstruct
@@ -72,6 +72,12 @@ else:
default_libdir='$PREFIX/lib'
default_prefix='/usr/local'
+cc_key = os.getenv('CC', 'null')
+if cc_key == 'null':
+ os_cc='gcc'
+else:
+ os_cc = os.environ["CC"]
+
opts = Variables(files=[SAVED_CONFIG])
opts.AddVariables(
PathVariable('PREFIX',
@@ -108,7 +114,7 @@ opts.AddVariables(
BoolVariable('APR_STATIC',
"Enable using a static compiled APR",
False),
- RawListVariable('CC', "Command name or path of the C compiler", None),
+ RawListVariable('CC', "Command name or path of the C compiler", os_cc),
RawListVariable('CFLAGS', "Extra flags for the C compiler (space-separated)",
None),
RawListVariable('LIBS', "Extra libraries passed to the linker, "
--
2.33.0

View File

@ -0,0 +1,13 @@
--- serf-1.3.9/buckets/ssl_buckets.c.errgetfunc
+++ serf-1.3.9/buckets/ssl_buckets.c
@@ -1204,6 +1204,10 @@
}
}
+#ifndef ERR_GET_FUNC
+#define ERR_GET_FUNC(ec) (0)
+#endif
+
static int ssl_need_client_cert(SSL *ssl, X509 **cert, EVP_PKEY **pkey)
{
serf_ssl_context_t *ctx = SSL_get_app_data(ssl);

View File

@ -0,0 +1,133 @@
commit 9f03432308609644d633ed79aaa17bcf19b6060e
Author: Tomas Korbar <tkorbar@redhat.com>
Date: Fri Jan 27 14:01:11 2023 +0100
Fix connection to multihome servers
When libserfs connection is rejected, epoll socket receives EPOLLHUP
and its handling has to be suspended if the connection was never
set up, so we can check another address if the target server
is located on more ip addresses.
diff --git a/outgoing.c b/outgoing.c
index 5f5f6b5..313b6c9 100644
--- a/outgoing.c
+++ b/outgoing.c
@@ -153,6 +153,11 @@ apr_status_t serf__conn_update_pollset(serf_connection_t *conn)
/* Now put it back in with the correct read/write values. */
desc.reqevents = APR_POLLHUP | APR_POLLERR;
+
+ if (conn->wait_for_connect) {
+ desc.reqevents |= APR_POLLOUT;
+ }
+
if (conn->requests &&
conn->state != SERF_CONN_INIT) {
/* If there are any outstanding events, then we want to read. */
@@ -391,6 +396,9 @@ apr_status_t serf__open_connections(serf_context_t *ctx)
if (status != APR_SUCCESS) {
if (!APR_STATUS_IS_EINPROGRESS(status))
return status;
+
+ /* Keep track of when we really connect */
+ conn->wait_for_connect = true;
}
/* Flag our pollset as dirty now that we have a new socket. */
@@ -1253,7 +1261,7 @@ apr_status_t serf__process_connection(serf_connection_t *conn,
* the like sitting on the connection, we give the app a chance to read
* it before we trigger a reset condition.
*/
- if ((events & APR_POLLIN) != 0) {
+ if ((events & APR_POLLIN) != 0 && !conn->wait_for_connect) {
if ((status = read_from_connection(conn)) != APR_SUCCESS)
return status;
@@ -1264,7 +1272,13 @@ apr_status_t serf__process_connection(serf_connection_t *conn,
return APR_SUCCESS;
}
}
- if ((events & APR_POLLHUP) != 0) {
+ /*
+ * Since new connection which is refused also creates HUP event,
+ * we need to suppress its handling until we are sure that connection
+ * was established, so we can eventually handle denial of connection
+ * by trying different server
+ */
+ if ((events & APR_POLLHUP) != 0 && !conn->wait_for_connect) {
/* The connection got reset by the server. On Windows this can happen
when all data is read, so just cleanup the connection and open
a new one.
@@ -1292,11 +1306,16 @@ apr_status_t serf__process_connection(serf_connection_t *conn,
{
apr_os_sock_t osskt;
if (!apr_os_sock_get(&osskt, conn->skt)) {
- int error;
+ int error = 0;
+ int rv;
apr_socklen_t l = sizeof(error);
- if (!getsockopt(osskt, SOL_SOCKET, SO_ERROR, (char*)&error,
- &l)) {
+ rv = getsockopt(osskt, SOL_SOCKET, SO_ERROR, (char*)&error, &l);
+ /* The error is placed in errno on Solaris for SO_ERROR */
+ if(rv)
+ error = errno;
+
+ if (error) {
status = APR_FROM_OS_ERROR(error);
/* Handle fallback for multi-homed servers.
@@ -1310,7 +1329,8 @@ apr_status_t serf__process_connection(serf_connection_t *conn,
&& conn->address->next != NULL
&& (APR_STATUS_IS_ECONNREFUSED(status)
|| APR_STATUS_IS_TIMEUP(status)
- || APR_STATUS_IS_ENETUNREACH(status))) {
+ || APR_STATUS_IS_ENETUNREACH(status)
+ || APR_STATUS_IS_EHOSTUNREACH(status))) {
conn->address = conn->address->next;
return reset_connection(conn, 1);
@@ -1324,6 +1344,8 @@ apr_status_t serf__process_connection(serf_connection_t *conn,
return APR_EGENERAL;
}
if ((events & APR_POLLOUT) != 0) {
+ if (conn->wait_for_connect)
+ conn->wait_for_connect = false;
if ((status = write_to_connection(conn)) != APR_SUCCESS)
return status;
}
@@ -1358,6 +1380,7 @@ serf_connection_t *serf_connection_create(
conn->baton.u.conn = conn;
conn->hit_eof = 0;
conn->state = SERF_CONN_INIT;
+ conn->wait_for_connect = false;
conn->latency = -1; /* unknown */
/* Create a subpool for our connection. */
diff --git a/serf_private.h b/serf_private.h
index f906379..b2da7df 100644
--- a/serf_private.h
+++ b/serf_private.h
@@ -21,6 +21,8 @@
#ifndef _SERF_PRIVATE_H_
#define _SERF_PRIVATE_H_
+#include <stdbool.h>
+
/* ### what the hell? why does the APR interface have a "size" ??
### the implication is that, if we bust this limit, we'd need to
### stop, rebuild a pollset, and repopulate it. what suckage. */
@@ -284,6 +286,10 @@ struct serf_connection_t {
/* Calculated connection latency. Negative value if latency is unknown. */
apr_interval_time_t latency;
+ /* Wait for connect: connect() returned APR_EINPROGRESS.
+ Socket not usable yet */
+ bool wait_for_connect;
+
/* Needs to read first before we can write again. */
int stop_writing;
};

View File

@ -1,30 +0,0 @@
diff -up serf-1.3.9/SConstruct.python3 serf-1.3.9/SConstruct
--- serf-1.3.9/SConstruct.python3 2018-07-02 17:21:47.331685070 +0200
+++ serf-1.3.9/SConstruct 2018-07-02 17:27:12.316413515 +0200
@@ -20,6 +20,8 @@
# ====================================================================
#
+from __future__ import print_function
+
import sys
import os
import re
@@ -166,7 +168,7 @@ env.Append(BUILDERS = {
match = re.search('SERF_MAJOR_VERSION ([0-9]+).*'
'SERF_MINOR_VERSION ([0-9]+).*'
'SERF_PATCH_VERSION ([0-9]+)',
- env.File('serf.h').get_contents(),
+ env.File('serf.h').get_contents().decode('utf-8'),
re.DOTALL)
MAJOR, MINOR, PATCH = [int(x) for x in match.groups()]
env.Append(MAJOR=str(MAJOR))
@@ -183,7 +185,7 @@ CALLOUT_OKAY = not (env.GetOption('clean
unknown = opts.UnknownVariables()
if unknown:
- print 'Warning: Used unknown variables:', ', '.join(unknown.keys())
+ print('Warning: Used unknown variables:', ', '.join(unknown.keys()))
apr = str(env['APR'])
apu = str(env['APU'])

View File

@ -2,22 +2,24 @@
%global scons_pkg python3-scons
Name: libserf
Version: 1.3.9
Release: 14
Version: 1.3.10
Release: 1
Summary: High-Performance Asynchronous HTTP Client Library
License: ASL 2.0
License: Apache-2.0
URL: https://serf.apache.org/
Source0: https://archive.apache.org/dist/serf/serf-%{version}.tar.bz2
BuildRequires: gcc, %{scons_pkg}, pkgconfig, zlib-devel
BuildRequires: apr-devel, apr-util-devel, krb5-devel, openssl-devel
Patch0: %{name}-norpath.patch
Patch1: %{name}-python3.patch
Patch1: backport-%{name}-1.3.9-errgetfunc.patch
Patch2: 0001-fix-CC-compiler-error.patch
Patch3: backport-%{name}-1.3.9-multihome.patch
%description
The serf library is a high performance C-based HTTP client library built upon
the Apache Portable Runtime (APR) library. It is permissively licensed under
the Apache License, v2.
The serf library is a C-based HTTP client library built upon the Apache
Portable Runtime (APR) library. It multiplexes connections, running the
read/write communication asynchronously. Memory copies and transformations are
kept to a minimum to provide high performance operation.
%package devel
Summary: Development files for %{name}
@ -68,6 +70,36 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%doc README CHANGES design-guide.txt
%changelog
* Wed Aug 09 2023 xingwei <xingwei14@h-partners.com> - 1.3.10-1
- Type:requirement
- Id:NA
- SUG:NA
- DESC:Update to version 1.3.10
* Thu May 4 2023 li-miaomiao_zhr <mmlidc@isoftstone.com> - 1.3.9-18
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix problem of scons build of print
* Mon Apr 24 2023 sjxur <sjxur@isoftstone.com> - 1.3.9-17
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix CC compiler error
* Wed Feb 01 2023 gaihuiying <eaglegai@163.com> - 1.3.9-16
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix build with openssl 3.0
* Sat Oct 22 2022 gaihuiying <eaglegai@163.com> - 1.3.9-15
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:modify description about libserf
* Thu Apr 28 2022 xinghe <xinghe2@h-partners.com> - 1.3.9-14
- Type:bugfix
- ID:NA

BIN
serf-1.3.10.tar.bz2 Normal file

Binary file not shown.

Binary file not shown.