From e05edf71df5d4d970d6c74d099813fadbb56b9eb Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Fri, 20 Oct 2023 11:34:46 +0200 Subject: [PATCH] MINOR: cfgparse: rename "rev@" prefix to "rhttp@" 'rev@' was used to specify a bind/server used with reverse HTTP transport. This notation was deemed not explicit enough. Rename it 'rhttp@' instead. --- doc/configuration.txt | 11 ++++++----- include/haproxy/listener-t.h | 2 +- reg-tests/connection/reverse_connect_full.vtc | 4 ++-- reg-tests/connection/reverse_server.vtc | 2 +- reg-tests/connection/reverse_server_name.vtc | 2 +- src/cfgparse.c | 2 +- src/tools.c | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 7ef9d724f..50fe882d0 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -4977,10 +4977,11 @@ bind / [, ...] [param*] - 'quic6@' -> address is resolved as IPv6 and protocol UDP is used. The performance note for QUIC over IPv4 applies as well. - - 'rev@' -> used for reverse HTTP. Address must be a server - with the format '/'. The server will be - used to instantiate connections to a remote address. The - listener will try to maintain 'maxconn' connections. + - 'rhttp@' -> used for reverse HTTP. Address must be a + server with the format '/'. The server + will be used to instantiate connections to a remote + address. The listener will try to maintain 'maxconn' + connections. You may want to reference some environment variables in the address parameter, see section 2.3 about environment @@ -11534,7 +11535,7 @@ server
[:[port]] [param*] one of them over the FD. The bind part will use the received socket as the client FD. Should be used carefully. - - 'rev@' -> custom address family for a passive server in + - 'rhttp@' -> custom address family for a passive server in HTTP reverse context. You may want to reference some environment variables in the address parameter, see section 2.3 about environment diff --git a/include/haproxy/listener-t.h b/include/haproxy/listener-t.h index bb4313176..6b2fc66a7 100644 --- a/include/haproxy/listener-t.h +++ b/include/haproxy/listener-t.h @@ -208,7 +208,7 @@ struct bind_conf { char *arg; /* argument passed to "bind" for better error reporting */ char *file; /* file where the section appears */ int line; /* line where the section appears */ - char *reverse_srvname; /* name of server when using "rev@" address */ + char *reverse_srvname; /* name of server when using "rhttp@" address */ int reverse_nbconn; /* count of connections to initiate in parallel */ __decl_thread(HA_RWLOCK_T sni_lock); /* lock the SNI trees during add/del operations */ struct thread_set thread_set; /* entire set of the allowed threads (0=no restriction) */ diff --git a/reg-tests/connection/reverse_connect_full.vtc b/reg-tests/connection/reverse_connect_full.vtc index 1124f6a46..3978739a7 100644 --- a/reg-tests/connection/reverse_connect_full.vtc +++ b/reg-tests/connection/reverse_connect_full.vtc @@ -21,7 +21,7 @@ frontend pub use_backend be-reverse backend be-reverse - server dev rev@ + server dev rhttp@ frontend priv bind "fd@${priv}" proto h2 @@ -37,7 +37,7 @@ defaults mode http frontend fe - bind "rev@be-pre-connect/srv" maxconn 1 + bind "rhttp@be-pre-connect/srv" maxconn 1 use_backend be backend be-pre-connect diff --git a/reg-tests/connection/reverse_server.vtc b/reg-tests/connection/reverse_server.vtc index 43edcdfea..ec631f6e2 100644 --- a/reg-tests/connection/reverse_server.vtc +++ b/reg-tests/connection/reverse_server.vtc @@ -18,7 +18,7 @@ frontend pub use_backend be-reverse backend be-reverse - server dev rev@ + server dev rhttp@ frontend priv bind "fd@${priv}" proto h2 diff --git a/reg-tests/connection/reverse_server_name.vtc b/reg-tests/connection/reverse_server_name.vtc index 76473d541..667b15f84 100644 --- a/reg-tests/connection/reverse_server_name.vtc +++ b/reg-tests/connection/reverse_server_name.vtc @@ -19,7 +19,7 @@ frontend pub use_backend be-reverse backend be-reverse - server dev rev@ ssl sni hdr(x-name) verify none + server dev rhttp@ ssl sni hdr(x-name) verify none frontend priv bind "fd@${priv}" ssl crt ${testdir}/common.pem verify required ca-verify-file ${testdir}/ca-auth.crt alpn h2 diff --git a/src/cfgparse.c b/src/cfgparse.c index 99d6d6bf9..310214464 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -174,7 +174,7 @@ int str2listener(char *str, struct proxy *curproxy, struct bind_conf *bind_conf, goto fail; } - bind_conf->reverse_srvname = strdup(str + strlen("rev@")); + bind_conf->reverse_srvname = strdup(str + strlen("rhttp@")); if (!bind_conf->reverse_srvname) { memprintf(err, "Cannot allocate reverse HTTP bind.\n"); goto fail; diff --git a/src/tools.c b/src/tools.c index b26e3efee..45f519ab8 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1101,7 +1101,7 @@ struct sockaddr_storage *str2sa_range(const char *str, int *port, int *low, int str2 += 9; ss.ss_family = AF_CUST_SOCKPAIR; } - else if (strncmp(str2, "rev@", 3) == 0) { + else if (strncmp(str2, "rhttp@", 3) == 0) { str2 += 4; ss.ss_family = AF_CUST_REV_SRV; }