Router: introduced nxt_http_forward_t.

This makes the replacement of forwarded request header
like client_ip and protocol more generic.
It's a prerequirement for protocol replacement.

No functional changes.
This commit is contained in:
Zhidao HONG
2022-06-20 13:16:25 +08:00
parent fd38e69c3d
commit 14dfa439ee
4 changed files with 40 additions and 38 deletions

View File

@@ -273,10 +273,15 @@ typedef struct {
} nxt_http_proto_table_t;
struct nxt_http_client_ip_s {
nxt_http_route_addr_rule_t *source;
typedef struct {
nxt_str_t *header;
uint32_t header_hash;
} nxt_http_forward_header_t;
struct nxt_http_forward_s {
nxt_http_forward_header_t client_ip;
nxt_http_route_addr_rule_t *source;
uint8_t recursive; /* 1 bit */
};