Merge ~ahasenack/ubuntu/+source/haproxy:jammy-haproxy-2414-merge into ubuntu/+source/haproxy:ubuntu/devel

Proposed by Andreas Hasenack
Status: Superseded
Proposed branch: ~ahasenack/ubuntu/+source/haproxy:jammy-haproxy-2414-merge
Merge into: ubuntu/+source/haproxy:ubuntu/devel
Diff against target: 1115 lines (+309/-157) (has conflicts)
31 files modified
.github/matrix.py (+3/-0)
.github/workflows/compliance.yml (+1/-1)
.github/workflows/vtest.yml (+1/-1)
.github/workflows/windows.yml (+1/-1)
CHANGELOG (+28/-0)
SUBVERS (+1/-1)
VERDATE (+2/-2)
VERSION (+1/-1)
debian/changelog (+22/-0)
doc/configuration.txt (+1/-1)
include/haproxy/compiler.h (+25/-0)
include/haproxy/htx.h (+2/-2)
include/haproxy/mworker.h (+1/-0)
include/haproxy/server-t.h (+4/-4)
include/haproxy/sock-t.h (+0/-17)
include/haproxy/sock.h (+1/-2)
reg-tests/checks/40be_2srv_odd_health_checks.vtc (+91/-84)
scripts/build-ssl.sh (+11/-4)
src/fd.c (+7/-3)
src/haproxy.c (+5/-8)
src/mailers.c (+1/-1)
src/mux_h1.c (+1/-1)
src/mux_h2.c (+1/-1)
src/mworker.c (+30/-0)
src/proxy.c (+1/-1)
src/resolvers.c (+1/-3)
src/sink.c (+1/-1)
src/sock.c (+35/-1)
src/ssl_sock.c (+2/-2)
src/stream.c (+16/-12)
src/tools.c (+12/-2)
Conflict in debian/changelog
Reviewer Review Type Date Requested Status
Canonical Server Pending
Canonical Server Core Reviewers Pending
Review via email: mp+416139@code.launchpad.net

This proposal has been superseded by a proposal from 2022-02-28.

Description of the change

New upstream release.

The upstream changelog[1] only mentions bugfixes and CI changes, so I think this does not need a feature freeze exception.

With this new upstream release, we are able to drop one of the delta bits we have, which was openssl3 compatibility.

PPA: https://launchpad.net/~ahasenack/+archive/ubuntu/haproxy-merge/+packages

1, http://www.haproxy.org/download/2.4/src/CHANGELOG

To post a comment you must log in.

Unmerged commits

7c8df16... by Andreas Hasenack

update-maintainer

5b165d6... by Andreas Hasenack

reconstruct-changelog

a36d43f... by Andreas Hasenack

merge-changelogs

2eb4322... by Andreas Hasenack

  * Dropped:
    - d/p/fix-ftbfs-openssl3.patch: Cherry-picked from upstream to fix
      the build against OpenSSL3 (LP: #1945773)
      [Fixed upstream]

cc5fa1b... by Miriam EspaƱa Acebal

    - d/{control,rules}: Removing support for OpenTracing due to it is
      in universe.

233891c... by Vincent Bernat

2.4.14-1 (patches unapplied)

Imported using git-ubuntu import.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/.github/matrix.py b/.github/matrix.py
index 9900314..116ea98 100644
--- a/.github/matrix.py
+++ b/.github/matrix.py
@@ -104,6 +104,7 @@ for CC in ["gcc", "clang"]:
104 for ssl in [104 for ssl in [
105 "stock",105 "stock",
106 "OPENSSL_VERSION=1.0.2u",106 "OPENSSL_VERSION=1.0.2u",
107 "OPENSSL_VERSION=3.0.1",
107 "LIBRESSL_VERSION=2.9.2",108 "LIBRESSL_VERSION=2.9.2",
108 "LIBRESSL_VERSION=3.3.3",109 "LIBRESSL_VERSION=3.3.3",
109# "BORINGSSL=yes",110# "BORINGSSL=yes",
@@ -111,6 +112,8 @@ for CC in ["gcc", "clang"]:
111 flags = ["USE_OPENSSL=1"]112 flags = ["USE_OPENSSL=1"]
112 if ssl == "BORINGSSL=yes":113 if ssl == "BORINGSSL=yes":
113 flags.append("USE_QUIC=1")114 flags.append("USE_QUIC=1")
115 if "OPENSSL_VERSION=3.0." in ssl:
116 flags.append('DEBUG_CFLAGS="-g -Wno-deprecated-declarations"')
114 if ssl != "stock":117 if ssl != "stock":
115 flags.append("SSL_LIB=${HOME}/opt/lib")118 flags.append("SSL_LIB=${HOME}/opt/lib")
116 flags.append("SSL_INC=${HOME}/opt/include")119 flags.append("SSL_INC=${HOME}/opt/include")
diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml
index 9f2bec2..4696c06 100644
--- a/.github/workflows/compliance.yml
+++ b/.github/workflows/compliance.yml
@@ -30,7 +30,7 @@ jobs:
30 ERR=1 \30 ERR=1 \
31 TARGET=${{ matrix.TARGET }} \31 TARGET=${{ matrix.TARGET }} \
32 CC=${{ matrix.CC }} \32 CC=${{ matrix.CC }} \
33 DEBUG=-DDEBUG_STRICT=1 \33 DEBUG="-DDEBUG_STRICT -DDEBUG_MEMORY_POOLS -DDEBUG_POOL_INTEGRITY" \
34 USE_OPENSSL=134 USE_OPENSSL=1
35 sudo make install35 sudo make install
36 - name: Show HAProxy version36 - name: Show HAProxy version
diff --git a/.github/workflows/vtest.yml b/.github/workflows/vtest.yml
index cb52f27..8e64995 100644
--- a/.github/workflows/vtest.yml
+++ b/.github/workflows/vtest.yml
@@ -77,7 +77,7 @@ jobs:
77 ERR=1 \77 ERR=1 \
78 TARGET=${{ matrix.TARGET }} \78 TARGET=${{ matrix.TARGET }} \
79 CC=${{ matrix.CC }} \79 CC=${{ matrix.CC }} \
80 DEBUG=-DDEBUG_STRICT=1 \80 DEBUG="-DDEBUG_STRICT -DDEBUG_MEMORY_POOLS -DDEBUG_POOL_INTEGRITY" \
81 ${{ join(matrix.FLAGS, ' ') }} \81 ${{ join(matrix.FLAGS, ' ') }} \
82 ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"82 ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"
83 sudo make install83 sudo make install
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index b5a198a..0449808 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -52,7 +52,7 @@ jobs:
52 ERR=1 \52 ERR=1 \
53 TARGET=${{ matrix.TARGET }} \53 TARGET=${{ matrix.TARGET }} \
54 CC=${{ matrix.CC }} \54 CC=${{ matrix.CC }} \
55 DEBUG=-DDEBUG_STRICT=1 \55 DEBUG="-DDEBUG_STRICT -DDEBUG_MEMORY_POOLS -DDEBUG_POOL_INTEGRITY" \
56 ${{ join(matrix.FLAGS, ' ') }}56 ${{ join(matrix.FLAGS, ' ') }}
57 - name: Show HAProxy version57 - name: Show HAProxy version
58 id: show-version58 id: show-version
diff --git a/CHANGELOG b/CHANGELOG
index 163070a..341776f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,34 @@
1ChangeLog :1ChangeLog :
2===========2===========
33
42022/02/25 : 2.4.14
5 - MINOR: sock: move the unused socket cleaning code into its own function
6 - BUG/MEDIUM: mworker: close unused transferred FDs on load failure
7 - BUG/MINOR: mworker: fix a FD leak of a sockpair upon a failed reload
8 - BUG/MINOR: sink: Use the right field in appctx context in release callback
9 - BUG/MEDIUM: resolvers: Really ignore trailing dot in domain names
10 - BUG/MEDIUM: fd: always align fdtab[] to 64 bytes
11 - BUG/MAJOR: compiler: relax alignment constraints on certain structures
12 - CI: ssl: enable parallel builds for OpenSSL on Linux
13 - CI: ssl: do not needlessly build the OpenSSL docs
14 - CI: ssl: keep the old method for ancient OpenSSL versions
15 - BUILD: fix compilation for OpenSSL-3.0.0-alpha17
16 - BUILD: adopt script/build-ssl.sh for OpenSSL-3.0.0beta2
17 - CI: github actions: add OpenSSL-3.0.0 builds
18 - CI: github actions: -Wno-deprecated-declarations with OpenSSL 3.0.0
19 - CI: github actions: relax OpenSSL-3.0.0 version comparision
20 - CI: github: switch to OpenSSL 3.0.0
21 - CI: github actions: update OpenSSL to 3.0.1
22 - BUG/MINOR: mailers: negotiate SMTP, not ESMTP
23 - BUG/MINOR: tools: url2sa reads ipv4 too far
24 - BUG/MEDIUM: htx: Be sure to have a buffer to perform a raw copy of a message
25 - BUG/MEDIUM: mux-h1: Don't wake h1s if mux is blocked on lack of output buffer
26 - BUG/MAJOR: mux-h2: Be sure to always report HTX parsing error to the app layer
27 - BUG/MINOR: proxy: preset the error message pointer to NULL in parse_new_proxy()
28 - REGTESTS: fix the race conditions in 40be_2srv_odd_health_checks
29 - CI: github: enable pool debugging by default
30 - BUG/MEDIUM: stream: Abort processing if response buffer allocation fails
31
42022/02/16 : 2.4.13322022/02/16 : 2.4.13
5 - BUG/MEDIUM: connection: properly leave stopping list on error33 - BUG/MEDIUM: connection: properly leave stopping list on error
6 - BUG/MEDIUM: htx: Adjust length to add DATA block in an empty HTX buffer34 - BUG/MEDIUM: htx: Adjust length to add DATA block in an empty HTX buffer
diff --git a/SUBVERS b/SUBVERS
index f9dfc31..3c7b54b 100644
--- a/SUBVERS
+++ b/SUBVERS
@@ -1,2 +1,2 @@
1-095275f1-eaa786f
22
diff --git a/VERDATE b/VERDATE
index 550bed4..cd15a46 100644
--- a/VERDATE
+++ b/VERDATE
@@ -1,2 +1,2 @@
12022-02-16 16:29:03 +010012022-02-25 17:10:23 +0100
22022/02/1622022/02/25
diff --git a/VERSION b/VERSION
index b40e924..e5f3129 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
12.4.1312.4.14
diff --git a/debian/changelog b/debian/changelog
index 5e4e436..edba303 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,25 @@
1<<<<<<< debian/changelog
2=======
3haproxy (2.4.14-1ubuntu1) jammy; urgency=medium
4
5 * Merge with Debian unstable. Remaining changes:
6 - d/{control,rules}: Removing support for OpenTracing due to it is
7 in universe.
8 * Dropped:
9 - d/p/fix-ftbfs-openssl3.patch: Cherry-picked from upstream to fix
10 the build against OpenSSL3 (LP: #1945773)
11 [Fixed upstream]
12
13 -- Andreas Hasenack <andreas@canonical.com> Mon, 28 Feb 2022 09:48:35 -0300
14
15haproxy (2.4.14-1) unstable; urgency=medium
16
17 * New upstream release.
18 - Fix compilation with OpenSSL 3.0. Closes: #996423, #1006007.
19
20 -- Vincent Bernat <bernat@debian.org> Fri, 25 Feb 2022 18:38:27 +0100
21
22>>>>>>> debian/changelog
1haproxy (2.4.13-1ubuntu1) jammy; urgency=medium23haproxy (2.4.13-1ubuntu1) jammy; urgency=medium
224
3 * Merge with Debian unstable (LP: #1961195). Remaining changes:25 * Merge with Debian unstable (LP: #1961195). Remaining changes:
diff --git a/doc/configuration.txt b/doc/configuration.txt
index b48b8ad..03420c9 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -4,7 +4,7 @@
4 ----------------------4 ----------------------
5 version 2.45 version 2.4
6 willy tarreau6 willy tarreau
7 2022/02/167 2022/02/25
88
99
10This document covers the configuration language as implemented in the version10This document covers the configuration language as implemented in the version
diff --git a/include/haproxy/compiler.h b/include/haproxy/compiler.h
index 352da8e..b975412 100644
--- a/include/haproxy/compiler.h
+++ b/include/haproxy/compiler.h
@@ -203,6 +203,17 @@
203#define HA_HAVE_CAS_DW203#define HA_HAVE_CAS_DW
204#endif204#endif
205205
206/*********************** IMPORTANT NOTE ABOUT ALIGNMENT **********************\
207 * Alignment works fine for variables. It also works on types and struct *
208 * members by propagating the alignment to the container struct itself, *
209 * but this requires that variables of the affected type are properly *
210 * aligned themselves. While regular variables will always abide, those *
211 * allocated using malloc() will not! Most platforms provide posix_memalign()*
212 * for this, but it's not available everywhere. As such one ought not to use *
213 * these alignment declarations inside structures that are dynamically *
214 * allocated. If the purpose is only to avoid false sharing of cache lines *
215 * for multi_threading, see THREAD_PAD() below. *
216\*****************************************************************************/
206217
207/* sets alignment for current field or variable */218/* sets alignment for current field or variable */
208#ifndef ALIGNED219#ifndef ALIGNED
@@ -277,6 +288,20 @@
277#endif288#endif
278#endif289#endif
279290
291/* add optional padding of the specified size between fields in a structure,
292 * only when threads are enabled. This is used to avoid false sharing of cache
293 * lines for dynamically allocated structures which cannot guarantee alignment.
294 */
295#ifndef THREAD_PAD
296# ifdef USE_THREAD
297# define __THREAD_PAD(x,l) char __pad_##l[x]
298# define _THREAD_PAD(x,l) __THREAD_PAD(x, l)
299# define THREAD_PAD(x) _THREAD_PAD(x, __LINE__)
300# else
301# define THREAD_PAD(x)
302# endif
303#endif
304
280/* The THREAD_LOCAL type attribute defines thread-local storage and is defined305/* The THREAD_LOCAL type attribute defines thread-local storage and is defined
281 * to __thread when threads are enabled or empty when disabled.306 * to __thread when threads are enabled or empty when disabled.
282 */307 */
diff --git a/include/haproxy/htx.h b/include/haproxy/htx.h
index ef9a1bc..ca24213 100644
--- a/include/haproxy/htx.h
+++ b/include/haproxy/htx.h
@@ -749,8 +749,8 @@ static inline int htx_expect_more(const struct htx *htx)
749 */749 */
750static inline int htx_copy_msg(struct htx *htx, const struct buffer *msg)750static inline int htx_copy_msg(struct htx *htx, const struct buffer *msg)
751{751{
752 /* The destination HTX message is empty, we can do a raw copy */752 /* The destination HTX message is allocated and empty, we can do a raw copy */
753 if (htx_is_empty(htx)) {753 if (htx_is_empty(htx) && htx_free_space(htx)) {
754 memcpy(htx, msg->area, msg->size);754 memcpy(htx, msg->area, msg->size);
755 return 1;755 return 1;
756 }756 }
diff --git a/include/haproxy/mworker.h b/include/haproxy/mworker.h
index 279fb08..acabdd3 100644
--- a/include/haproxy/mworker.h
+++ b/include/haproxy/mworker.h
@@ -42,5 +42,6 @@ int mworker_ext_launch_all();
42void mworker_kill_max_reloads(int sig);42void mworker_kill_max_reloads(int sig);
4343
44void mworker_free_child(struct mworker_proc *);44void mworker_free_child(struct mworker_proc *);
45void mworker_cleanup_proc();
4546
46#endif /* _HAPROXY_MWORKER_H_ */47#endif /* _HAPROXY_MWORKER_H_ */
diff --git a/include/haproxy/server-t.h b/include/haproxy/server-t.h
index 200385f..8882388 100644
--- a/include/haproxy/server-t.h
+++ b/include/haproxy/server-t.h
@@ -275,7 +275,7 @@ struct server {
275 /* The elements below may be changed on every single request by any275 /* The elements below may be changed on every single request by any
276 * thread, and generally at the same time.276 * thread, and generally at the same time.
277 */277 */
278 ALWAYS_ALIGN(64);278 THREAD_PAD(63);
279 struct eb32_node idle_node; /* When to next do cleanup in the idle connections */279 struct eb32_node idle_node; /* When to next do cleanup in the idle connections */
280 unsigned int curr_idle_conns; /* Current number of orphan idling connections, both the idle and the safe lists */280 unsigned int curr_idle_conns; /* Current number of orphan idling connections, both the idle and the safe lists */
281 unsigned int curr_idle_nb; /* Current number of connections in the idle list */281 unsigned int curr_idle_nb; /* Current number of connections in the idle list */
@@ -290,14 +290,14 @@ struct server {
290 /* Element below are usd by LB algorithms and must be doable in290 /* Element below are usd by LB algorithms and must be doable in
291 * parallel to other threads reusing connections above.291 * parallel to other threads reusing connections above.
292 */292 */
293 ALWAYS_ALIGN(64);293 THREAD_PAD(63);
294 __decl_thread(HA_SPINLOCK_T lock); /* may enclose the proxy's lock, must not be taken under */294 __decl_thread(HA_SPINLOCK_T lock); /* may enclose the proxy's lock, must not be taken under */
295 unsigned npos, lpos; /* next and last positions in the LB tree, protected by LB lock */295 unsigned npos, lpos; /* next and last positions in the LB tree, protected by LB lock */
296 struct eb32_node lb_node; /* node used for tree-based load balancing */296 struct eb32_node lb_node; /* node used for tree-based load balancing */
297 struct server *next_full; /* next server in the temporary full list */297 struct server *next_full; /* next server in the temporary full list */
298298
299 /* usually atomically updated by any thread during parsing or on end of request */299 /* usually atomically updated by any thread during parsing or on end of request */
300 ALWAYS_ALIGN(64);300 THREAD_PAD(63);
301 int cur_sess; /* number of currently active sessions (including syn_sent) */301 int cur_sess; /* number of currently active sessions (including syn_sent) */
302 int served; /* # of active sessions currently being served (ie not pending) */302 int served; /* # of active sessions currently being served (ie not pending) */
303 int nbpend; /* number of pending connections */303 int nbpend; /* number of pending connections */
@@ -307,7 +307,7 @@ struct server {
307 struct be_counters counters; /* statistics counters */307 struct be_counters counters; /* statistics counters */
308308
309 /* Below are some relatively stable settings, only changed under the lock */309 /* Below are some relatively stable settings, only changed under the lock */
310 ALWAYS_ALIGN(64);310 THREAD_PAD(63);
311311
312 struct eb_root *lb_tree; /* we want to know in what tree the server is */312 struct eb_root *lb_tree; /* we want to know in what tree the server is */
313 struct tree_occ *lb_nodes; /* lb_nodes_tot * struct tree_occ */313 struct tree_occ *lb_nodes; /* lb_nodes_tot * struct tree_occ */
diff --git a/include/haproxy/sock-t.h b/include/haproxy/sock-t.h
index 1a49dfa..b843d44 100644
--- a/include/haproxy/sock-t.h
+++ b/include/haproxy/sock-t.h
@@ -27,23 +27,6 @@
2727
28#include <haproxy/api-t.h>28#include <haproxy/api-t.h>
2929
30#define SOCK_XFER_OPT_FOREIGN 0x000000001
31#define SOCK_XFER_OPT_V6ONLY 0x000000002
32#define SOCK_XFER_OPT_DGRAM 0x000000004
33
34/* The list used to transfer sockets between old and new processes */
35struct xfer_sock_list {
36 int fd;
37 int options; /* socket options as SOCK_XFER_OPT_* */
38 char *iface;
39 char *namespace;
40 int if_namelen;
41 int ns_namelen;
42 struct xfer_sock_list *prev;
43 struct xfer_sock_list *next;
44 struct sockaddr_storage addr;
45};
46
47#endif /* _HAPROXY_SOCK_T_H */30#endif /* _HAPROXY_SOCK_T_H */
4831
49/*32/*
diff --git a/include/haproxy/sock.h b/include/haproxy/sock.h
index 1a5b68c..49dffa9 100644
--- a/include/haproxy/sock.h
+++ b/include/haproxy/sock.h
@@ -30,8 +30,6 @@
30#include <haproxy/listener-t.h>30#include <haproxy/listener-t.h>
31#include <haproxy/sock-t.h>31#include <haproxy/sock-t.h>
3232
33extern struct xfer_sock_list *xfer_sock_list;
34
35int sock_create_server_socket(struct connection *conn);33int sock_create_server_socket(struct connection *conn);
36void sock_enable(struct receiver *rx);34void sock_enable(struct receiver *rx);
37void sock_disable(struct receiver *rx);35void sock_disable(struct receiver *rx);
@@ -40,6 +38,7 @@ int sock_get_src(int fd, struct sockaddr *sa, socklen_t salen, int dir);
40int sock_get_dst(int fd, struct sockaddr *sa, socklen_t salen, int dir);38int sock_get_dst(int fd, struct sockaddr *sa, socklen_t salen, int dir);
41int sock_get_old_sockets(const char *unixsocket);39int sock_get_old_sockets(const char *unixsocket);
42int sock_find_compatible_fd(const struct receiver *rx);40int sock_find_compatible_fd(const struct receiver *rx);
41void sock_drop_unused_old_sockets();
43int sock_accepting_conn(const struct receiver *rx);42int sock_accepting_conn(const struct receiver *rx);
44struct connection *sock_accept_conn(struct listener *l, int *status);43struct connection *sock_accept_conn(struct listener *l, int *status);
45void sock_accept_iocb(int fd);44void sock_accept_iocb(int fd);
diff --git a/reg-tests/checks/40be_2srv_odd_health_checks.vtc b/reg-tests/checks/40be_2srv_odd_health_checks.vtc
index 22f80cd..0065c9c 100644
--- a/reg-tests/checks/40be_2srv_odd_health_checks.vtc
+++ b/reg-tests/checks/40be_2srv_odd_health_checks.vtc
@@ -14,6 +14,8 @@ feature ignore_unknown_macro
14# - so that to ensure that health-checks do not consume any connection14# - so that to ensure that health-checks do not consume any connection
15# (any varnishtest server without -repeat <n> with n > 1 accepts15# (any varnishtest server without -repeat <n> with n > 1 accepts
16# only one connection).16# only one connection).
17# - we take care of sending the clients to the unchecked servers using the
18# "first" lb algo so that servers always receive a valid request
1719
18syslog S1 -level notice {20syslog S1 -level notice {
19 recv21 recv
@@ -115,254 +117,254 @@ syslog S39 -level notice {
115 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be39/srv39 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"117 expect ~ "[^:\\[ ]\\[${h1_pid}\\]: Health check for server be39/srv39 succeeded, reason: Layer4 check passed, check duration: [[:digit:]]+ms, status: 1/1 UP"
116} -start118} -start
117119
118server s0 {} -start120server s0 {
119server s2 {} -start
120server s4 {} -start
121server s6 {} -start
122server s8 {} -start
123server s10 {} -start
124server s12 {} -start
125server s14 {} -start
126server s16 {} -start
127server s18 {} -start
128server s20 {} -start
129server s22 {} -start
130server s24 {} -start
131server s26 {} -start
132server s28 {} -start
133server s30 {} -start
134server s32 {} -start
135server s34 {} -start
136server s36 {} -start
137server s38 {} -start
138
139server s1 {
140 rxreq121 rxreq
141 txresp122 txresp
142} -start123} -start
143124
144server s3 {125server s2 {
145 rxreq126 rxreq
146 txresp127 txresp
147} -start128} -start
148129
149server s5 {130server s4 {
150 rxreq131 rxreq
151 txresp132 txresp
152} -start133} -start
153134
154server s7 {135server s6 {
155 rxreq136 rxreq
156 txresp137 txresp
157} -start138} -start
158139
159server s9 {140server s8 {
160 rxreq141 rxreq
161 txresp142 txresp
162} -start143} -start
163144
164server s11 {145server s10 {
165 rxreq146 rxreq
166 txresp147 txresp
167} -start148} -start
168149
169server s13 {150server s12 {
170 rxreq151 rxreq
171 txresp152 txresp
172} -start153} -start
173154
174server s15 {155server s14 {
175 rxreq156 rxreq
176 txresp157 txresp
177} -start158} -start
178159
179server s17 {160server s16 {
180 rxreq161 rxreq
181 txresp162 txresp
182} -start163} -start
183164
184server s19 {165server s18 {
185 rxreq166 rxreq
186 txresp167 txresp
187} -start168} -start
188169
189server s21 {170server s20 {
190 rxreq171 rxreq
191 txresp172 txresp
192} -start173} -start
193174
194server s23 {175server s22 {
195 rxreq176 rxreq
196 txresp177 txresp
197} -start178} -start
198179
199server s25 {180server s24 {
200 rxreq181 rxreq
201txresp182 txresp
202} -start183} -start
203184
204server s27 {185server s26 {
205 rxreq186 rxreq
206 txresp187 txresp
207} -start188} -start
208189
209server s29 {190server s28 {
210 rxreq191 rxreq
211 txresp192 txresp
212} -start193} -start
213194
214server s31 {195server s30 {
215 rxreq196 rxreq
216 txresp197 txresp
217} -start198} -start
218199
219server s33 {200server s32 {
220 rxreq201 rxreq
221 txresp202 txresp
222} -start203} -start
223204
224server s35 {205server s34 {
225 rxreq206 rxreq
226 txresp207 txresp
227} -start208} -start
228209
229server s37 {210server s36 {
230 rxreq211 rxreq
231 txresp212 txresp
232} -start213} -start
233214
234server s39 {215server s38 {
235 rxreq216 rxreq
236 txresp217 txresp
237} -start218} -start
238219
220server s1 {} -start
221server s3 {} -start
222server s5 {} -start
223server s7 {} -start
224server s9 {} -start
225server s11 {} -start
226server s13 {} -start
227server s15 {} -start
228server s17 {} -start
229server s19 {} -start
230server s21 {} -start
231server s23 {} -start
232server s25 {} -start
233server s27 {} -start
234server s29 {} -start
235server s31 {} -start
236server s33 {} -start
237server s35 {} -start
238server s37 {} -start
239server s39 {} -start
240
239haproxy h1 -conf {241haproxy h1 -conf {
240 defaults242 defaults
241 timeout client 1s243 timeout client 1s
242 timeout server 1s244 timeout server 1s
243 timeout connect 1s245 timeout connect 1s
244 balance first246 balance first
245 default-server no-check inter 5ms downinter 1s rise 1 fall 1247 default-server no-check inter 20ms downinter 1s rise 1 fall 1
246248
247 backend be1249 backend be1
248 option log-health-checks250 option log-health-checks
249 log ${S1_addr}:${S1_port} daemon251 log ${S1_addr}:${S1_port} daemon
250 server srv1 ${s1_addr}:${s1_port} check
251 server srv0 ${s0_addr}:${s0_port}252 server srv0 ${s0_addr}:${s0_port}
253 server srv1 ${s1_addr}:${s1_port} check
252254
253 backend be3255 backend be3
254 option log-health-checks256 option log-health-checks
255 log ${S3_addr}:${S3_port} daemon257 log ${S3_addr}:${S3_port} daemon
256 server srv3 ${s3_addr}:${s3_port} check
257 server srv2 ${s2_addr}:${s2_port}258 server srv2 ${s2_addr}:${s2_port}
259 server srv3 ${s3_addr}:${s3_port} check
258260
259 backend be5261 backend be5
260 option log-health-checks262 option log-health-checks
261 log ${S5_addr}:${S5_port} daemon263 log ${S5_addr}:${S5_port} daemon
262 server srv5 ${s5_addr}:${s5_port} check
263 server srv4 ${s4_addr}:${s4_port}264 server srv4 ${s4_addr}:${s4_port}
265 server srv5 ${s5_addr}:${s5_port} check
264266
265 backend be7267 backend be7
266 option log-health-checks268 option log-health-checks
267 log ${S7_addr}:${S7_port} daemon269 log ${S7_addr}:${S7_port} daemon
268 server srv7 ${s7_addr}:${s7_port} check
269 server srv6 ${s6_addr}:${s6_port}270 server srv6 ${s6_addr}:${s6_port}
271 server srv7 ${s7_addr}:${s7_port} check
270272
271 backend be9273 backend be9
272 option log-health-checks274 option log-health-checks
273 log ${S9_addr}:${S9_port} daemon275 log ${S9_addr}:${S9_port} daemon
274 server srv9 ${s9_addr}:${s9_port} check
275 server srv8 ${s8_addr}:${s8_port}276 server srv8 ${s8_addr}:${s8_port}
277 server srv9 ${s9_addr}:${s9_port} check
276278
277 backend be11279 backend be11
278 option log-health-checks280 option log-health-checks
279 log ${S11_addr}:${S11_port} daemon281 log ${S11_addr}:${S11_port} daemon
280 server srv11 ${s11_addr}:${s11_port} check
281 server srv10 ${s10_addr}:${s10_port}282 server srv10 ${s10_addr}:${s10_port}
283 server srv11 ${s11_addr}:${s11_port} check
282284
283 backend be13285 backend be13
284 option log-health-checks286 option log-health-checks
285 log ${S13_addr}:${S13_port} daemon287 log ${S13_addr}:${S13_port} daemon
286 server srv13 ${s13_addr}:${s13_port} check
287 server srv12 ${s12_addr}:${s12_port}288 server srv12 ${s12_addr}:${s12_port}
289 server srv13 ${s13_addr}:${s13_port} check
288290
289 backend be15291 backend be15
290 option log-health-checks292 option log-health-checks
291 log ${S15_addr}:${S15_port} daemon293 log ${S15_addr}:${S15_port} daemon
292 server srv15 ${s15_addr}:${s15_port} check
293 server srv14 ${s14_addr}:${s14_port}294 server srv14 ${s14_addr}:${s14_port}
295 server srv15 ${s15_addr}:${s15_port} check
294296
295 backend be17297 backend be17
296 option log-health-checks298 option log-health-checks
297 log ${S17_addr}:${S17_port} daemon299 log ${S17_addr}:${S17_port} daemon
298 server srv17 ${s17_addr}:${s17_port} check
299 server srv16 ${s16_addr}:${s16_port}300 server srv16 ${s16_addr}:${s16_port}
301 server srv17 ${s17_addr}:${s17_port} check
300302
301 backend be19303 backend be19
302 option log-health-checks304 option log-health-checks
303 log ${S19_addr}:${S19_port} daemon305 log ${S19_addr}:${S19_port} daemon
304 server srv19 ${s19_addr}:${s19_port} check
305 server srv18 ${s18_addr}:${s18_port}306 server srv18 ${s18_addr}:${s18_port}
307 server srv19 ${s19_addr}:${s19_port} check
306308
307 backend be21309 backend be21
308 option log-health-checks310 option log-health-checks
309 log ${S21_addr}:${S21_port} daemon311 log ${S21_addr}:${S21_port} daemon
310 server srv21 ${s21_addr}:${s21_port} check
311 server srv20 ${s20_addr}:${s20_port}312 server srv20 ${s20_addr}:${s20_port}
313 server srv21 ${s21_addr}:${s21_port} check
312314
313 backend be23315 backend be23
314 option log-health-checks316 option log-health-checks
315 log ${S23_addr}:${S23_port} daemon317 log ${S23_addr}:${S23_port} daemon
316 server srv23 ${s23_addr}:${s23_port} check
317 server srv22 ${s22_addr}:${s22_port}318 server srv22 ${s22_addr}:${s22_port}
319 server srv23 ${s23_addr}:${s23_port} check
318320
319 backend be25321 backend be25
320 option log-health-checks322 option log-health-checks
321 log ${S25_addr}:${S25_port} daemon323 log ${S25_addr}:${S25_port} daemon
322 server srv25 ${s25_addr}:${s25_port} check
323 server srv24 ${s24_addr}:${s24_port}324 server srv24 ${s24_addr}:${s24_port}
325 server srv25 ${s25_addr}:${s25_port} check
324326
325 backend be27327 backend be27
326 option log-health-checks328 option log-health-checks
327 log ${S27_addr}:${S27_port} daemon329 log ${S27_addr}:${S27_port} daemon
328 server srv27 ${s27_addr}:${s27_port} check
329 server srv26 ${s26_addr}:${s26_port}330 server srv26 ${s26_addr}:${s26_port}
331 server srv27 ${s27_addr}:${s27_port} check
330332
331 backend be29333 backend be29
332 option log-health-checks334 option log-health-checks
333 log ${S29_addr}:${S29_port} daemon335 log ${S29_addr}:${S29_port} daemon
334 server srv29 ${s29_addr}:${s29_port} check
335 server srv28 ${s28_addr}:${s28_port}336 server srv28 ${s28_addr}:${s28_port}
337 server srv29 ${s29_addr}:${s29_port} check
336338
337 backend be31339 backend be31
338 option log-health-checks340 option log-health-checks
339 log ${S31_addr}:${S31_port} daemon341 log ${S31_addr}:${S31_port} daemon
340 server srv31 ${s31_addr}:${s31_port} check
341 server srv30 ${s30_addr}:${s30_port}342 server srv30 ${s30_addr}:${s30_port}
343 server srv31 ${s31_addr}:${s31_port} check
342344
343 backend be33345 backend be33
344 option log-health-checks346 option log-health-checks
345 log ${S33_addr}:${S33_port} daemon347 log ${S33_addr}:${S33_port} daemon
346 server srv33 ${s33_addr}:${s33_port} check
347 server srv32 ${s32_addr}:${s32_port}348 server srv32 ${s32_addr}:${s32_port}
349 server srv33 ${s33_addr}:${s33_port} check
348350
349 backend be35351 backend be35
350 option log-health-checks352 option log-health-checks
351 log ${S35_addr}:${S35_port} daemon353 log ${S35_addr}:${S35_port} daemon
352 server srv35 ${s35_addr}:${s35_port} check
353 server srv34 ${s34_addr}:${s34_port}354 server srv34 ${s34_addr}:${s34_port}
355 server srv35 ${s35_addr}:${s35_port} check
354356
355 backend be37357 backend be37
356 option log-health-checks358 option log-health-checks
357 log ${S37_addr}:${S37_port} daemon359 log ${S37_addr}:${S37_port} daemon
358 server srv37 ${s37_addr}:${s37_port} check
359 server srv36 ${s36_addr}:${s36_port}360 server srv36 ${s36_addr}:${s36_port}
361 server srv37 ${s37_addr}:${s37_port} check
360362
361 backend be39363 backend be39
362 option log-health-checks364 option log-health-checks
363 log ${S39_addr}:${S39_port} daemon365 log ${S39_addr}:${S39_port} daemon
364 server srv39 ${s39_addr}:${s39_port} check
365 server srv38 ${s38_addr}:${s38_port}366 server srv38 ${s38_addr}:${s38_port}
367 server srv39 ${s39_addr}:${s39_port} check
366368
367 frontend fe1369 frontend fe1
368 bind "fd@${fe1}"370 bind "fd@${fe1}"
@@ -609,30 +611,35 @@ client c35 -wait
609client c37 -wait611client c37 -wait
610client c39 -wait612client c39 -wait
611613
612server s1 -wait614server s0 -wait
613server s3 -wait615server s2 -wait
614server s5 -wait616server s4 -wait
615server s7 -wait617server s6 -wait
616server s9 -wait618server s8 -wait
617server s11 -wait619server s10 -wait
618server s13 -wait620server s12 -wait
619server s15 -wait621server s14 -wait
620server s17 -wait622server s16 -wait
621server s19 -wait623server s18 -wait
622server s21 -wait624server s20 -wait
623server s23 -wait625server s22 -wait
624server s25 -wait626server s24 -wait
625server s27 -wait627server s26 -wait
626server s29 -wait628server s28 -wait
627server s31 -wait629server s30 -wait
628server s33 -wait630server s32 -wait
629server s35 -wait631server s34 -wait
630server s37 -wait632server s36 -wait
631server s39 -wait633server s38 -wait
632634
633635
634haproxy h1 -cli {636haproxy h1 -cli {
635 send "show servers state"637 send "show servers state"
636 expect ~ "# be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_since_last_change srv_check_status srv_check_result srv_check_health srv_check_state srv_agent_state bk_f_forced_id srv_f_forced_id srv_fqdn srv_port srvrecord srv_use_ssl srv_check_port srv_check_addr srv_agent_addr srv_agent_port\n2 be1 1 srv1 ${s1_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s1_port} - 0 0 - - 0\n2 be1 2 srv0 ${s0_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s0_port} - 0 0 - - 0\n3 be3 1 srv3 ${s3_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s3_port} - 0 0 - - 0\n3 be3 2 srv2 ${s2_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s2_port} - 0 0 - - 0\n4 be5 1 srv5 ${s5_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s5_port} - 0 0 - - 0\n4 be5 2 srv4 ${s4_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s4_port} - 0 0 - - 0\n5 be7 1 srv7 ${s7_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s7_port} - 0 0 - - 0\n5 be7 2 srv6 ${s6_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s6_port} - 0 0 - - 0\n6 be9 1 srv9 ${s9_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s9_port} - 0 0 - - 0\n6 be9 2 srv8 ${s8_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s8_port} - 0 0 - - 0\n7 be11 1 srv11 ${s11_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s11_port} - 0 0 - - 0\n7 be11 2 srv10 ${s10_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s10_port} - 0 0 - - 0\n8 be13 1 srv13 ${s13_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s13_port} - 0 0 - - 0\n8 be13 2 srv12 ${s12_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s12_port} - 0 0 - - 0\n9 be15 1 srv15 ${s15_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s15_port} - 0 0 - - 0\n9 be15 2 srv14 ${s14_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s14_port} - 0 0 - - 0\n10 be17 1 srv17 ${s17_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s17_port} - 0 0 - - 0\n10 be17 2 srv16 ${s16_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s16_port} - 0 0 - - 0\n11 be19 1 srv19 ${s19_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s19_port} - 0 0 - - 0\n11 be19 2 srv18 ${s18_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s18_port} - 0 0 - - 0\n12 be21 1 srv21 ${s21_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s21_port} - 0 0 - - 0\n12 be21 2 srv20 ${s20_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s20_port} - 0 0 - - 0\n13 be23 1 srv23 ${s23_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s23_port} - 0 0 - - 0\n13 be23 2 srv22 ${s22_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s22_port} - 0 0 - - 0\n14 be25 1 srv25 ${s25_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s25_port} - 0 0 - - 0\n14 be25 2 srv24 ${s24_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s24_port} - 0 0 - - 0\n15 be27 1 srv27 ${s27_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s27_port} - 0 0 - - 0\n15 be27 2 srv26 ${s26_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s26_port} - 0 0 - - 0\n16 be29 1 srv29 ${s29_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s29_port} - 0 0 - - 0\n16 be29 2 srv28 ${s28_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s28_port} - 0 0 - - 0\n17 be31 1 srv31 ${s31_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s31_port} - 0 0 - - 0\n17 be31 2 srv30 ${s30_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s30_port} - 0 0 - - 0\n18 be33 1 srv33 ${s33_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s33_port} - 0 0 - - 0\n18 be33 2 srv32 ${s32_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s32_port} - 0 0 - - 0\n19 be35 1 srv35 ${s35_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s35_port} - 0 0 - - 0\n19 be35 2 srv34 ${s34_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s34_port} - 0 0 - - 0\n20 be37 1 srv37 ${s37_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s37_port} - 0 0 - - 0\n20 be37 2 srv36 ${s36_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s36_port} - 0 0 - - 0\n21 be39 1 srv39 ${s39_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s39_port} - 0 0 - - 0\n21 be39 2 srv38 ${s38_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s38_port} - 0 0 - - 0\n"638 # output produced using the command below (warning, a bug inserts a "be0" every other line:
639 # for ((i=0;i<40;i++)); do id=$((i/2+2)); be=$((i|1)); si=$(((i&1)+1));
640 # if ((i&1)); then chk="6 ([[:digit:]]+ ){3}"; else chk="1 0 1 0 ";fi;
641 # printf "%d be%d %d srv%d \${s%d_addr} 2 0 1 1 [[:digit:]]+ %s0 0 0 - \${s%d_port} - 0 0 - - 0\n" "$id" "$be" "$si" "$i" "$i" "$chk" "$i" "$i" ;
642 # done|grep -v be0|sed 's,$,\\n,'| tr -d '\n'
643 expect ~ "# be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_since_last_change srv_check_status srv_check_result srv_check_health srv_check_state srv_agent_state bk_f_forced_id srv_f_forced_id srv_fqdn srv_port srvrecord srv_use_ssl srv_check_port srv_check_addr srv_agent_addr srv_agent_port\n2 be1 1 srv0 ${s0_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s0_port} - 0 0 - - 0\n2 be1 2 srv1 ${s1_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s1_port} - 0 0 - - 0\n3 be3 1 srv2 ${s2_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s2_port} - 0 0 - - 0\n3 be3 2 srv3 ${s3_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s3_port} - 0 0 - - 0\n4 be5 1 srv4 ${s4_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s4_port} - 0 0 - - 0\n4 be5 2 srv5 ${s5_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s5_port} - 0 0 - - 0\n5 be7 1 srv6 ${s6_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s6_port} - 0 0 - - 0\n5 be7 2 srv7 ${s7_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s7_port} - 0 0 - - 0\n6 be9 1 srv8 ${s8_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s8_port} - 0 0 - - 0\n6 be9 2 srv9 ${s9_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s9_port} - 0 0 - - 0\n7 be11 1 srv10 ${s10_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s10_port} - 0 0 - - 0\n7 be11 2 srv11 ${s11_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s11_port} - 0 0 - - 0\n8 be13 1 srv12 ${s12_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s12_port} - 0 0 - - 0\n8 be13 2 srv13 ${s13_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s13_port} - 0 0 - - 0\n9 be15 1 srv14 ${s14_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s14_port} - 0 0 - - 0\n9 be15 2 srv15 ${s15_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s15_port} - 0 0 - - 0\n10 be17 1 srv16 ${s16_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s16_port} - 0 0 - - 0\n10 be17 2 srv17 ${s17_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s17_port} - 0 0 - - 0\n11 be19 1 srv18 ${s18_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s18_port} - 0 0 - - 0\n11 be19 2 srv19 ${s19_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s19_port} - 0 0 - - 0\n12 be21 1 srv20 ${s20_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s20_port} - 0 0 - - 0\n12 be21 2 srv21 ${s21_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s21_port} - 0 0 - - 0\n13 be23 1 srv22 ${s22_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s22_port} - 0 0 - - 0\n13 be23 2 srv23 ${s23_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s23_port} - 0 0 - - 0\n14 be25 1 srv24 ${s24_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s24_port} - 0 0 - - 0\n14 be25 2 srv25 ${s25_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s25_port} - 0 0 - - 0\n15 be27 1 srv26 ${s26_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s26_port} - 0 0 - - 0\n15 be27 2 srv27 ${s27_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s27_port} - 0 0 - - 0\n16 be29 1 srv28 ${s28_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s28_port} - 0 0 - - 0\n16 be29 2 srv29 ${s29_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s29_port} - 0 0 - - 0\n17 be31 1 srv30 ${s30_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s30_port} - 0 0 - - 0\n17 be31 2 srv31 ${s31_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s31_port} - 0 0 - - 0\n18 be33 1 srv32 ${s32_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s32_port} - 0 0 - - 0\n18 be33 2 srv33 ${s33_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s33_port} - 0 0 - - 0\n19 be35 1 srv34 ${s34_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s34_port} - 0 0 - - 0\n19 be35 2 srv35 ${s35_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s35_port} - 0 0 - - 0\n20 be37 1 srv36 ${s36_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s36_port} - 0 0 - - 0\n20 be37 2 srv37 ${s37_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s37_port} - 0 0 - - 0\n21 be39 1 srv38 ${s38_addr} 2 0 1 1 [[:digit:]]+ 1 0 1 0 0 0 0 - ${s38_port} - 0 0 - - 0\n21 be39 2 srv39 ${s39_addr} 2 0 1 1 [[:digit:]]+ 6 ([[:digit:]]+ ){3}0 0 0 - ${s39_port} - 0 0 - - 0\n"
637}644}
638645
diff --git a/scripts/build-ssl.sh b/scripts/build-ssl.sh
index 9a6a2b2..e1d89a0 100755
--- a/scripts/build-ssl.sh
+++ b/scripts/build-ssl.sh
@@ -17,11 +17,18 @@ download_openssl () {
17 fi17 fi
18}18}
1919
20# recent openssl versions support parallel builds and skipping the docs,
21# while older ones require to build everything sequentially.
20build_openssl_linux () {22build_openssl_linux () {
21 (23 (
22 cd "openssl-${OPENSSL_VERSION}/"24 cd "openssl-${OPENSSL_VERSION}/"
23 ./config shared --prefix="${HOME}/opt" --openssldir="${HOME}/opt" -DPURIFY25 ./config shared --prefix="${HOME}/opt" --openssldir="${HOME}/opt" --libdir=lib -DPURIFY
24 make all install_sw26 if [ -z "${OPENSSL_VERSION##1.*}" ]; then
27 make all
28 else
29 make -j$(nproc) build_sw
30 fi
31 make install_sw
25 )32 )
26}33}
2734
@@ -29,8 +36,8 @@ build_openssl_osx () {
29 (36 (
30 cd "openssl-${OPENSSL_VERSION}/"37 cd "openssl-${OPENSSL_VERSION}/"
31 ./Configure darwin64-x86_64-cc shared \38 ./Configure darwin64-x86_64-cc shared \
32 --prefix="${HOME}/opt" --openssldir="${HOME}/opt" -DPURIFY39 --prefix="${HOME}/opt" --openssldir="${HOME}/opt" --libdir=lib -DPURIFY
33 make depend all install_sw40 make depend build_sw install_sw
34 )41 )
35}42}
3643
diff --git a/src/fd.c b/src/fd.c
index 733658c..5f465f0 100644
--- a/src/fd.c
+++ b/src/fd.c
@@ -114,6 +114,7 @@ THREAD_LOCAL int poller_rd_pipe = -1; // Pipe to wake the thread
114int poller_wr_pipe[MAX_THREADS] __read_mostly; // Pipe to wake the threads114int poller_wr_pipe[MAX_THREADS] __read_mostly; // Pipe to wake the threads
115115
116volatile int ha_used_fds = 0; // Number of FD we're currently using116volatile int ha_used_fds = 0; // Number of FD we're currently using
117static struct fdtab *fdtab_addr; /* address of the allocated area containing fdtab */
117118
118#define _GET_NEXT(fd, off) ((volatile struct fdlist_entry *)(void *)((char *)(&fdtab[fd]) + off))->next119#define _GET_NEXT(fd, off) ((volatile struct fdlist_entry *)(void *)((char *)(&fdtab[fd]) + off))->next
119#define _GET_PREV(fd, off) ((volatile struct fdlist_entry *)(void *)((char *)(&fdtab[fd]) + off))->prev120#define _GET_PREV(fd, off) ((volatile struct fdlist_entry *)(void *)((char *)(&fdtab[fd]) + off))->prev
@@ -685,11 +686,14 @@ int init_pollers()
685 int p;686 int p;
686 struct poller *bp;687 struct poller *bp;
687688
688 if ((fdtab = calloc(global.maxsock, sizeof(*fdtab))) == NULL) {689 if ((fdtab_addr = calloc(global.maxsock, sizeof(*fdtab) + 64)) == NULL) {
689 ha_alert("Not enough memory to allocate %d entries for fdtab!\n", global.maxsock);690 ha_alert("Not enough memory to allocate %d entries for fdtab!\n", global.maxsock);
690 goto fail_tab;691 goto fail_tab;
691 }692 }
692693
694 /* always provide an aligned fdtab */
695 fdtab = (struct fdtab*)((((size_t)fdtab_addr) + 63) & -(size_t)64);
696
693 if ((polled_mask = calloc(global.maxsock, sizeof(*polled_mask))) == NULL) {697 if ((polled_mask = calloc(global.maxsock, sizeof(*polled_mask))) == NULL) {
694 ha_alert("Not enough memory to allocate %d entries for polled_mask!\n", global.maxsock);698 ha_alert("Not enough memory to allocate %d entries for polled_mask!\n", global.maxsock);
695 goto fail_polledmask;699 goto fail_polledmask;
@@ -726,7 +730,7 @@ int init_pollers()
726 fail_info:730 fail_info:
727 free(polled_mask);731 free(polled_mask);
728 fail_polledmask:732 fail_polledmask:
729 free(fdtab);733 free(fdtab_addr);
730 fail_tab:734 fail_tab:
731 return 0;735 return 0;
732}736}
@@ -747,7 +751,7 @@ void deinit_pollers() {
747 }751 }
748752
749 ha_free(&fdinfo);753 ha_free(&fdinfo);
750 ha_free(&fdtab);754 ha_free(&fdtab_addr);
751 ha_free(&polled_mask);755 ha_free(&polled_mask);
752}756}
753757
diff --git a/src/haproxy.c b/src/haproxy.c
index ef5021a..d64c0e4 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -714,6 +714,7 @@ void mworker_reload()
714#endif714#endif
715 setenv("HAPROXY_MWORKER_REEXEC", "1", 1);715 setenv("HAPROXY_MWORKER_REEXEC", "1", 1);
716716
717 mworker_cleanup_proc();
717 mworker_proc_list_to_env(); /* put the children description in the env */718 mworker_proc_list_to_env(); /* put the children description in the env */
718719
719 /* during the reload we must ensure that every FDs that can't be720 /* during the reload we must ensure that every FDs that can't be
@@ -860,6 +861,9 @@ void reexec_on_failure()
860861
861 setenv("HAPROXY_MWORKER_WAIT_ONLY", "1", 1);862 setenv("HAPROXY_MWORKER_WAIT_ONLY", "1", 1);
862863
864 /* do not keep unused FDs retrieved from the previous process */
865 sock_drop_unused_old_sockets();
866
863 ha_warning("Reexecuting Master process in waitpid mode\n");867 ha_warning("Reexecuting Master process in waitpid mode\n");
864 mworker_reload();868 mworker_reload();
865}869}
@@ -3029,14 +3033,7 @@ int main(int argc, char **argv)
3029 /* Ok, all listeners should now be bound, close any leftover sockets3033 /* Ok, all listeners should now be bound, close any leftover sockets
3030 * the previous process gave us, we don't need them anymore3034 * the previous process gave us, we don't need them anymore
3031 */3035 */
3032 while (xfer_sock_list != NULL) {3036 sock_drop_unused_old_sockets();
3033 struct xfer_sock_list *tmpxfer = xfer_sock_list->next;
3034 close(xfer_sock_list->fd);
3035 free(xfer_sock_list->iface);
3036 free(xfer_sock_list->namespace);
3037 free(xfer_sock_list);
3038 xfer_sock_list = tmpxfer;
3039 }
30403037
3041 /* prepare pause/play signals */3038 /* prepare pause/play signals */
3042 signal_register_fct(SIGTTOU, sig_pause, SIGTTOU);3039 signal_register_fct(SIGTTOU, sig_pause, SIGTTOU);
diff --git a/src/mailers.c b/src/mailers.c
index 3df02f0..4138bae 100644
--- a/src/mailers.c
+++ b/src/mailers.c
@@ -195,7 +195,7 @@ static int enqueue_one_email_alert(struct proxy *p, struct server *s,
195 goto error;195 goto error;
196196
197 {197 {
198 const char * const strs[4] = { "EHLO ", p->email_alert.myhostname, "\r\n" };198 const char * const strs[4] = { "HELO ", p->email_alert.myhostname, "\r\n" };
199 if (!add_tcpcheck_send_strs(&alert->rules, strs))199 if (!add_tcpcheck_send_strs(&alert->rules, strs))
200 goto error;200 goto error;
201 }201 }
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 41bd4dc..c362dfd 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -2683,7 +2683,7 @@ static int h1_send(struct h1c *h1c)
2683 }2683 }
26842684
2685 end:2685 end:
2686 if (!(h1c->flags & H1C_F_OUT_FULL))2686 if (!(h1c->flags & (H1C_F_OUT_FULL|H1C_F_OUT_ALLOC)))
2687 h1_wake_stream_for_send(h1c->h1s);2687 h1_wake_stream_for_send(h1c->h1s);
26882688
2689 /* We're done, no more to send */2689 /* We're done, no more to send */
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 0476bc3..11c660e 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -6357,7 +6357,7 @@ static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
63576357
6358 /* transfer possibly pending data to the upper layer */6358 /* transfer possibly pending data to the upper layer */
6359 h2s_htx = htx_from_buf(&h2s->rxbuf);6359 h2s_htx = htx_from_buf(&h2s->rxbuf);
6360 if (htx_is_empty(h2s_htx)) {6360 if (htx_is_empty(h2s_htx) && !(h2s_htx->flags & HTX_FL_PARSING_ERROR)) {
6361 /* Here htx_to_buf() will set buffer data to 0 because6361 /* Here htx_to_buf() will set buffer data to 0 because
6362 * the HTX is empty.6362 * the HTX is empty.
6363 */6363 */
diff --git a/src/mworker.c b/src/mworker.c
index 991394c..7a8feda 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -449,6 +449,36 @@ void mworker_cleanlisteners()
449 }449 }
450}450}
451451
452/* Upon a configuration loading error some mworker_proc and FDs/server were
453 * assigned but the worker was never forked, we must close the FDs and
454 * remove the server
455 */
456void mworker_cleanup_proc()
457{
458 struct mworker_proc *child, *it;
459
460 list_for_each_entry_safe(child, it, &proc_list, list) {
461
462 if (child->pid == -1) {
463 /* Close the socketpair master side. We don't need to
464 * close the worker side, because it's stored in the
465 * GLOBAL cli listener which was supposed to be in the
466 * worker and which will be closed in
467 * mworker_cleanlisteners()
468 */
469 if (child->ipc_fd[0] > -1)
470 close(child->ipc_fd[0]);
471 if (child->srv) {
472 /* only exists if we created a master CLI listener */
473 free_server(child->srv);
474 }
475 LIST_DELETE(&child->list);
476 mworker_free_child(child);
477 }
478 }
479}
480
481
452/* Displays workers and processes */482/* Displays workers and processes */
453static int cli_io_handler_show_proc(struct appctx *appctx)483static int cli_io_handler_show_proc(struct appctx *appctx)
454{484{
diff --git a/src/proxy.c b/src/proxy.c
index 4e866b1..92b84ef 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -1754,7 +1754,7 @@ struct proxy *parse_new_proxy(const char *name, unsigned int cap,
1754 const struct proxy *defproxy)1754 const struct proxy *defproxy)
1755{1755{
1756 struct proxy *curproxy = NULL;1756 struct proxy *curproxy = NULL;
1757 char *errmsg;1757 char *errmsg = NULL;
17581758
1759 if (!(curproxy = alloc_new_proxy(name, cap, &errmsg))) {1759 if (!(curproxy = alloc_new_proxy(name, cap, &errmsg))) {
1760 ha_alert("parsing [%s:%d] : %s\n", file, linenum, errmsg);1760 ha_alert("parsing [%s:%d] : %s\n", file, linenum, errmsg);
diff --git a/src/resolvers.c b/src/resolvers.c
index 4a306fa..49e16f6 100644
--- a/src/resolvers.c
+++ b/src/resolvers.c
@@ -1741,10 +1741,8 @@ int resolv_str_to_dn_label(const char *str, int str_len, char *dn, int dn_len)
1741 return -1;1741 return -1;
17421742
1743 /* ignore trailing dot */1743 /* ignore trailing dot */
1744 if (i + 1 == str_len) {1744 if (i + 1 == str_len)
1745 i++;
1746 break;1745 break;
1747 }
17481746
1749 dn[offset] = (i - offset);1747 dn[offset] = (i - offset);
1750 offset = i+1;1748 offset = i+1;
diff --git a/src/sink.c b/src/sink.c
index 6358da5..0f421cc 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -604,7 +604,7 @@ void __sink_forward_session_deinit(struct sink_forward_target *sft)
604604
605static void sink_forward_session_release(struct appctx *appctx)605static void sink_forward_session_release(struct appctx *appctx)
606{606{
607 struct sink_forward_target *sft = appctx->ctx.peers.ptr;607 struct sink_forward_target *sft = appctx->ctx.sft.ptr;
608608
609 if (!sft)609 if (!sft)
610 return;610 return;
diff --git a/src/sock.c b/src/sock.c
index 9d272cc..399f7b7 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -34,8 +34,24 @@
34#include <haproxy/sock_inet.h>34#include <haproxy/sock_inet.h>
35#include <haproxy/tools.h>35#include <haproxy/tools.h>
3636
37#define SOCK_XFER_OPT_FOREIGN 0x000000001
38#define SOCK_XFER_OPT_V6ONLY 0x000000002
39#define SOCK_XFER_OPT_DGRAM 0x000000004
40
37/* the list of remaining sockets transferred from an older process */41/* the list of remaining sockets transferred from an older process */
38struct xfer_sock_list *xfer_sock_list = NULL;42struct xfer_sock_list {
43 int fd;
44 int options; /* socket options as SOCK_XFER_OPT_* */
45 char *iface;
46 char *namespace;
47 int if_namelen;
48 int ns_namelen;
49 struct xfer_sock_list *prev;
50 struct xfer_sock_list *next;
51 struct sockaddr_storage addr;
52};
53
54static struct xfer_sock_list *xfer_sock_list;
3955
4056
41/* Accept an incoming connection from listener <l>, and return it, as well as57/* Accept an incoming connection from listener <l>, and return it, as well as
@@ -595,6 +611,24 @@ int sock_find_compatible_fd(const struct receiver *rx)
595 return ret;611 return ret;
596}612}
597613
614/* After all protocols are bound, there may remain some old sockets that have
615 * been removed between the previous config and the new one. These ones must
616 * be dropped, otherwise they will remain open and may prevent a service from
617 * restarting.
618 */
619void sock_drop_unused_old_sockets()
620{
621 while (xfer_sock_list != NULL) {
622 struct xfer_sock_list *tmpxfer = xfer_sock_list->next;
623
624 close(xfer_sock_list->fd);
625 free(xfer_sock_list->iface);
626 free(xfer_sock_list->namespace);
627 free(xfer_sock_list);
628 xfer_sock_list = tmpxfer;
629 }
630}
631
598/* Tests if the receiver supports accepting connections. Returns positive on632/* Tests if the receiver supports accepting connections. Returns positive on
599 * success, 0 if not possible, negative if the socket is non-recoverable. The633 * success, 0 if not possible, negative if the socket is non-recoverable. The
600 * rationale behind this is that inherited FDs may be broken and that shared634 * rationale behind this is that inherited FDs may be broken and that shared
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index b82ab18..233b520 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -2270,13 +2270,13 @@ static void ssl_set_TLSv12_func(SSL *ssl, set_context_func c) {
2270 : SSL_set_min_proto_version(ssl, TLS1_2_VERSION);2270 : SSL_set_min_proto_version(ssl, TLS1_2_VERSION);
2271}2271}
2272static void ctx_set_TLSv13_func(SSL_CTX *ctx, set_context_func c) {2272static void ctx_set_TLSv13_func(SSL_CTX *ctx, set_context_func c) {
2273#if SSL_OP_NO_TLSv1_32273#if (HA_OPENSSL_VERSION_NUMBER >= 0x10101000L)
2274 c == SET_MAX ? SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION)2274 c == SET_MAX ? SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION)
2275 : SSL_CTX_set_min_proto_version(ctx, TLS1_3_VERSION);2275 : SSL_CTX_set_min_proto_version(ctx, TLS1_3_VERSION);
2276#endif2276#endif
2277}2277}
2278static void ssl_set_TLSv13_func(SSL *ssl, set_context_func c) {2278static void ssl_set_TLSv13_func(SSL *ssl, set_context_func c) {
2279#if SSL_OP_NO_TLSv1_32279#if (HA_OPENSSL_VERSION_NUMBER >= 0x10101000L)
2280 c == SET_MAX ? SSL_set_max_proto_version(ssl, TLS1_3_VERSION)2280 c == SET_MAX ? SSL_set_max_proto_version(ssl, TLS1_3_VERSION)
2281 : SSL_set_min_proto_version(ssl, TLS1_3_VERSION);2281 : SSL_set_min_proto_version(ssl, TLS1_3_VERSION);
2282#endif2282#endif
diff --git a/src/stream.c b/src/stream.c
index e0ba75e..ea997e0 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -775,13 +775,8 @@ static void stream_free(struct stream *s)
775 */775 */
776static int stream_alloc_work_buffer(struct stream *s)776static int stream_alloc_work_buffer(struct stream *s)
777{777{
778 if (LIST_INLIST(&s->buffer_wait.list))
779 LIST_DEL_INIT(&s->buffer_wait.list);
780
781 if (b_alloc(&s->res.buf))778 if (b_alloc(&s->res.buf))
782 return 1;779 return 1;
783
784 LIST_APPEND(&ti->buffer_wq, &s->buffer_wait.list);
785 return 0;780 return 0;
786}781}
787782
@@ -1710,15 +1705,24 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
17101705
1711 resync_stream_interface:1706 resync_stream_interface:
1712 /* below we may emit error messages so we have to ensure that we have1707 /* below we may emit error messages so we have to ensure that we have
1713 * our buffers properly allocated.1708 * our buffers properly allocated. If the allocation failed, an error is
1709 * triggered.
1710 *
1711 * NOTE: An error is returned because the mechanism to queue entities
1712 * waiting for a buffer is totally broken for now. However, this
1713 * part must be refactored. When it will be handled, this part
1714 * must be be reviewed too.
1714 */1715 */
1715 if (!stream_alloc_work_buffer(s)) {1716 if (!stream_alloc_work_buffer(s)) {
1716 /* No buffer available, we've been subscribed to the list of1717 si_f->flags |= SI_FL_ERR;
1717 * buffer waiters, let's wait for our turn.1718 si_f->err_type = SI_ET_CONN_RES;
1718 */1719
1719 si_f->flags &= ~SI_FL_DONT_WAKE;1720 si_b->flags |= SI_FL_ERR;
1720 si_b->flags &= ~SI_FL_DONT_WAKE;1721 si_b->err_type = SI_ET_CONN_RES;
1721 goto update_exp_and_leave;1722
1723 if (!(s->flags & SF_ERR_MASK))
1724 s->flags |= SF_ERR_RESOURCE;
1725 sess_set_term_flags(s);
1722 }1726 }
17231727
1724 /* 1b: check for low-level errors reported at the stream interface.1728 /* 1b: check for low-level errors reported at the stream interface.
diff --git a/src/tools.c b/src/tools.c
index d14286c..bdf78ff 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -1673,12 +1673,20 @@ int url2sa(const char *url, int ulen, struct sockaddr_storage *addr, struct spli
1673 return end - url;1673 return end - url;
1674 }1674 }
1675 else {1675 else {
1676 /* we need to copy the string into the trash because url2ipv4
1677 * needs a \0 at the end of the string */
1678 if (trash.size < ulen)
1679 return -1;
1680
1681 memcpy(trash.area, curr, ulen - (curr - url));
1682 trash.area[ulen - (curr - url)] = '\0';
1683
1676 /* We are looking for IP address. If you want to parse and1684 /* We are looking for IP address. If you want to parse and
1677 * resolve hostname found in url, you can use str2sa_range(), but1685 * resolve hostname found in url, you can use str2sa_range(), but
1678 * be warned this can slow down global daemon performances1686 * be warned this can slow down global daemon performances
1679 * while handling lagging dns responses.1687 * while handling lagging dns responses.
1680 */1688 */
1681 ret = url2ipv4(curr, &((struct sockaddr_in *)addr)->sin_addr);1689 ret = url2ipv4(trash.area, &((struct sockaddr_in *)addr)->sin_addr);
1682 if (ret) {1690 if (ret) {
1683 /* Update out. */1691 /* Update out. */
1684 if (out) {1692 if (out) {
@@ -1686,7 +1694,9 @@ int url2sa(const char *url, int ulen, struct sockaddr_storage *addr, struct spli
1686 out->host_len = ret;1694 out->host_len = ret;
1687 }1695 }
16881696
1689 curr += ret;1697 /* we need to assign again curr and end from the trash */
1698 url = trash.area;
1699 curr = trash.area + ret;
16901700
1691 /* Decode port. */1701 /* Decode port. */
1692 if (*curr == ':') {1702 if (*curr == ':') {

Subscribers

People subscribed via source and target branches