mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-05 09:07:35 -04:00
MINOR: send-proxy-v2: sends authority TLV according to TLV received
Since patch "7185b789", the authority TLV in a PROXYv2 header from a client connection is stored. Authority TLV sends in PROXYv2 should be taken into account to allow chaining PROXYv2 without droping it.
This commit is contained in:
parent
c046d167e4
commit
8a4ffa0aab
1 changed files with 13 additions and 3 deletions
|
|
@ -1308,16 +1308,26 @@ int make_proxy_line_v2(char *buf, int buf_len, struct server *srv, struct connec
|
|||
ret += make_tlv(&buf[ret], (buf_len - ret), PP2_TYPE_ALPN, value_len, value);
|
||||
}
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
if (srv->pp_opts & SRV_PP_V2_AUTHORITY) {
|
||||
value = ssl_sock_get_sni(remote);
|
||||
value = NULL;
|
||||
if (remote && remote->proxy_authority) {
|
||||
value = remote->proxy_authority;
|
||||
value_len = remote->proxy_authority_len;
|
||||
}
|
||||
#ifdef USE_OPENSSL
|
||||
else {
|
||||
if (value = ssl_sock_get_sni(remote))
|
||||
value_len = strlen(value);
|
||||
}
|
||||
#endif
|
||||
if (value) {
|
||||
if ((buf_len - ret) < sizeof(struct tlv))
|
||||
return 0;
|
||||
ret += make_tlv(&buf[ret], (buf_len - ret), PP2_TYPE_AUTHORITY, strlen(value), value);
|
||||
ret += make_tlv(&buf[ret], (buf_len - ret), PP2_TYPE_AUTHORITY, value_len, value);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
if (srv->pp_opts & SRV_PP_V2_SSL) {
|
||||
struct tlv_ssl *tlv;
|
||||
int ssl_tlv_len = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue