Klaus Demo nginx / 8fd8c32
Modules compatibility: compatibility with NGX_HTTP_SSL. With this change it is now possible to load modules compiled without the "--with-http_ssl_module" configure option into nginx binary compiled with it, and vice versa (if a module doesn't use ssl-specific functions), assuming both use the "--with-compat" option. Maxim Dounin 5 years ago
9 changed file(s) with 28 addition(s) and 35 deletion(s). Raw diff Collapse all Expand all
146146 ngx_str_t proxy_protocol_addr;
147147 in_port_t proxy_protocol_port;
148148
149 #if (NGX_SSL)
149 #if (NGX_SSL || NGX_COMPAT)
150150 ngx_ssl_connection_t *ssl;
151151 #endif
152152
1111 #include <ngx_config.h>
1212
1313
14 typedef struct ngx_module_s ngx_module_t;
15 typedef struct ngx_conf_s ngx_conf_t;
16 typedef struct ngx_cycle_s ngx_cycle_t;
17 typedef struct ngx_pool_s ngx_pool_t;
18 typedef struct ngx_chain_s ngx_chain_t;
19 typedef struct ngx_log_s ngx_log_t;
20 typedef struct ngx_open_file_s ngx_open_file_t;
21 typedef struct ngx_command_s ngx_command_t;
22 typedef struct ngx_file_s ngx_file_t;
23 typedef struct ngx_event_s ngx_event_t;
24 typedef struct ngx_event_aio_s ngx_event_aio_t;
25 typedef struct ngx_connection_s ngx_connection_t;
26 typedef struct ngx_thread_task_s ngx_thread_task_t;
14 typedef struct ngx_module_s ngx_module_t;
15 typedef struct ngx_conf_s ngx_conf_t;
16 typedef struct ngx_cycle_s ngx_cycle_t;
17 typedef struct ngx_pool_s ngx_pool_t;
18 typedef struct ngx_chain_s ngx_chain_t;
19 typedef struct ngx_log_s ngx_log_t;
20 typedef struct ngx_open_file_s ngx_open_file_t;
21 typedef struct ngx_command_s ngx_command_t;
22 typedef struct ngx_file_s ngx_file_t;
23 typedef struct ngx_event_s ngx_event_t;
24 typedef struct ngx_event_aio_s ngx_event_aio_t;
25 typedef struct ngx_connection_s ngx_connection_t;
26 typedef struct ngx_thread_task_s ngx_thread_task_t;
27 typedef struct ngx_ssl_s ngx_ssl_t;
28 typedef struct ngx_ssl_connection_s ngx_ssl_connection_t;
2729
2830 typedef void (*ngx_event_handler_pt)(ngx_event_t *ev);
2931 typedef void (*ngx_connection_handler_pt)(ngx_connection_t *c);
138138 #define NGX_MODULE_SIGNATURE_23 "0"
139139 #endif
140140
141 #if (NGX_HTTP_SSL)
141 #if (NGX_HTTP_SSL || NGX_COMPAT)
142142 #define NGX_MODULE_SIGNATURE_24 "1"
143143 #else
144144 #define NGX_MODULE_SIGNATURE_24 "0"
2626 ngx_uint_t state);
2727 typedef void (*ngx_event_notify_peer_pt)(ngx_peer_connection_t *pc,
2828 void *data, ngx_uint_t type);
29 #if (NGX_SSL)
30
3129 typedef ngx_int_t (*ngx_event_set_peer_session_pt)(ngx_peer_connection_t *pc,
3230 void *data);
3331 typedef void (*ngx_event_save_peer_session_pt)(ngx_peer_connection_t *pc,
3432 void *data);
35 #endif
3633
3734
3835 struct ngx_peer_connection_s {
5047 ngx_event_notify_peer_pt notify;
5148 void *data;
5249
53 #if (NGX_SSL)
50 #if (NGX_SSL || NGX_COMPAT)
5451 ngx_event_set_peer_session_pt set_session;
5552 ngx_event_save_peer_session_pt save_session;
5653 #endif
5353 #define ngx_ssl_conn_t SSL
5454
5555
56 typedef struct {
56 struct ngx_ssl_s {
5757 SSL_CTX *ctx;
5858 ngx_log_t *log;
5959 size_t buffer_size;
60 } ngx_ssl_t;
61
62
63 typedef struct {
60 };
61
62
63 struct ngx_ssl_connection_s {
6464 ngx_ssl_conn_t *connection;
6565 SSL_CTX *session_ctx;
6666
7979 unsigned no_wait_shutdown:1;
8080 unsigned no_send_shutdown:1;
8181 unsigned handshake_buffer_set:1;
82 } ngx_ssl_connection_t;
82 };
8383
8484
8585 #define NGX_SSL_NO_SCACHE -2
6666 unsigned default_server:1;
6767 unsigned bind:1;
6868 unsigned wildcard:1;
69 #if (NGX_HTTP_SSL)
7069 unsigned ssl:1;
71 #endif
7270 unsigned http2:1;
7371 #if (NGX_HAVE_INET6)
7472 unsigned ipv6only:1;
229227
230228 ngx_http_virtual_names_t *virtual_names;
231229
232 #if (NGX_HTTP_SSL)
233230 unsigned ssl:1;
234 #endif
235231 unsigned http2:1;
236232 unsigned proxy_protocol:1;
237233 };
299299 ngx_http_addr_conf_t *addr_conf;
300300 ngx_http_conf_ctx_t *conf_ctx;
301301
302 #if (NGX_HTTP_SSL)
302 #if (NGX_HTTP_SSL || NGX_COMPAT)
303303 ngx_str_t *ssl_servername;
304304 #if (NGX_PCRE)
305305 ngx_http_regex_t *ssl_servername_regex;
312312 ngx_buf_t **free;
313313 ngx_int_t nfree;
314314
315 #if (NGX_HTTP_SSL)
316315 unsigned ssl:1;
317 #endif
318316 unsigned proxy_protocol:1;
319317 } ngx_http_connection_t;
320318
221221 unsigned intercept_404:1;
222222 unsigned change_buffering:1;
223223
224 #if (NGX_HTTP_SSL)
224 #if (NGX_HTTP_SSL || NGX_COMPAT)
225225 ngx_ssl_t *ssl;
226226 ngx_flag_t ssl_session_reuse;
227227
366366 ngx_str_t schema;
367367 ngx_str_t uri;
368368
369 #if (NGX_HTTP_SSL)
369 #if (NGX_HTTP_SSL || NGX_COMPAT)
370370 ngx_str_t ssl_name;
371371 #endif
372372
3939
4040 ngx_uint_t down;
4141
42 #if (NGX_HTTP_SSL)
42 #if (NGX_HTTP_SSL || NGX_COMPAT)
4343 void *ssl_session;
4444 int ssl_session_len;
4545 #endif