From cf6e0c8a836da211946fa637020e776286093633 Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Fri, 13 Mar 2020 12:34:24 +0100 Subject: [PATCH] MEDIUM: proxy_protocol: Support sending unique IDs using PPv2 This patch adds the `unique-id` option to `proxy-v2-options`. If this option is set a unique ID will be generated based on the `unique-id-format` while sending the proxy protocol v2 header and stored as the unique id for the first stream of the connection. This feature is meant to be used in `tcp` mode. It works on HTTP mode, but might result in inconsistent unique IDs for the first request on a keep-alive connection, because the unique ID for the first stream is generated earlier than the others. Now that we can send unique IDs in `tcp` mode the `%ID` log variable is made available in TCP mode. --- doc/configuration.txt | 24 +++++++---- include/proto/connection.h | 4 +- include/types/server.h | 1 + .../proxy_protocol_send_unique_id.vtc | 42 +++++++++++++++++++ src/connection.c | 20 +++++++-- src/log.c | 2 +- src/server.c | 2 + src/stream_interface.c | 11 +++-- 8 files changed, 90 insertions(+), 16 deletions(-) create mode 100644 reg-tests/connection/proxy_protocol_send_unique_id.vtc diff --git a/doc/configuration.txt b/doc/configuration.txt index 57f777a78a..cc5fbf2d06 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -12657,13 +12657,23 @@ send-proxy-v2 this section and send-proxy" option of the "bind" keyword. proxy-v2-options