comparison src/stream/ngx_stream.h @ 6680:7357abd1fa8c

Stream: the "proxy_protocol" parameter of the "listen" directive.
author Dmitry Volyntsev <xeioex@nginx.com>
date Tue, 06 Sep 2016 21:28:16 +0300
parents 40e8ce405859
children 9cac11efb205
comparison
equal deleted inserted replaced
6679:40e8ce405859 6680:7357abd1fa8c
25 #include <ngx_stream_upstream.h> 25 #include <ngx_stream_upstream.h>
26 #include <ngx_stream_upstream_round_robin.h> 26 #include <ngx_stream_upstream_round_robin.h>
27 27
28 28
29 #define NGX_STREAM_OK 200 29 #define NGX_STREAM_OK 200
30 #define NGX_STREAM_BAD_REQUEST 400
30 #define NGX_STREAM_FORBIDDEN 403 31 #define NGX_STREAM_FORBIDDEN 403
31 #define NGX_STREAM_INTERNAL_SERVER_ERROR 500 32 #define NGX_STREAM_INTERNAL_SERVER_ERROR 500
32 #define NGX_STREAM_BAD_GATEWAY 502 33 #define NGX_STREAM_BAD_GATEWAY 502
33 #define NGX_STREAM_SERVICE_UNAVAILABLE 503 34 #define NGX_STREAM_SERVICE_UNAVAILABLE 503
34 35
56 #endif 57 #endif
57 #if (NGX_HAVE_REUSEPORT) 58 #if (NGX_HAVE_REUSEPORT)
58 unsigned reuseport:1; 59 unsigned reuseport:1;
59 #endif 60 #endif
60 unsigned so_keepalive:2; 61 unsigned so_keepalive:2;
62 unsigned proxy_protocol:1;
61 #if (NGX_HAVE_KEEPALIVE_TUNABLE) 63 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
62 int tcp_keepidle; 64 int tcp_keepidle;
63 int tcp_keepintvl; 65 int tcp_keepintvl;
64 int tcp_keepcnt; 66 int tcp_keepcnt;
65 #endif 67 #endif
70 72
71 typedef struct { 73 typedef struct {
72 ngx_stream_conf_ctx_t *ctx; 74 ngx_stream_conf_ctx_t *ctx;
73 ngx_str_t addr_text; 75 ngx_str_t addr_text;
74 #if (NGX_STREAM_SSL) 76 #if (NGX_STREAM_SSL)
75 ngx_uint_t ssl; /* unsigned ssl:1; */ 77 unsigned ssl:1;
76 #endif 78 #endif
79 unsigned proxy_protocol:1;
77 } ngx_stream_addr_conf_t; 80 } ngx_stream_addr_conf_t;
78 81
79 typedef struct { 82 typedef struct {
80 in_addr_t addr; 83 in_addr_t addr;
81 ngx_stream_addr_conf_t conf; 84 ngx_stream_addr_conf_t conf;
151 ngx_log_t *error_log; 154 ngx_log_t *error_log;
152 155
153 ngx_msec_t resolver_timeout; 156 ngx_msec_t resolver_timeout;
154 ngx_resolver_t *resolver; 157 ngx_resolver_t *resolver;
155 158
159 ngx_msec_t proxy_protocol_timeout;
160
156 ngx_uint_t listen; /* unsigned listen:1; */ 161 ngx_uint_t listen; /* unsigned listen:1; */
157 } ngx_stream_core_srv_conf_t; 162 } ngx_stream_core_srv_conf_t;
158 163
159 164
160 struct ngx_stream_session_s { 165 struct ngx_stream_session_s {