Mercurial > hg > nginx
changeset 6735:e38e9c50a40e
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 10 Oct 2016 18:44:17 +0300 |
parents | 0c572ed91b36 |
children | f41c2530dd17 |
files | src/core/ngx_connection.h src/core/ngx_core.h src/core/ngx_module.h src/event/ngx_event_connect.h src/event/ngx_event_openssl.h src/http/ngx_http_core_module.h src/http/ngx_http_request.h src/http/ngx_http_upstream.h src/http/ngx_http_upstream_round_robin.h |
diffstat | 9 files changed, 26 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_connection.h Mon Oct 10 18:44:17 2016 +0300 +++ b/src/core/ngx_connection.h Mon Oct 10 18:44:17 2016 +0300 @@ -147,7 +147,7 @@ ngx_str_t proxy_protocol_addr; in_port_t proxy_protocol_port; -#if (NGX_SSL) +#if (NGX_SSL || NGX_COMPAT) ngx_ssl_connection_t *ssl; #endif
--- a/src/core/ngx_core.h Mon Oct 10 18:44:17 2016 +0300 +++ b/src/core/ngx_core.h Mon Oct 10 18:44:17 2016 +0300 @@ -12,19 +12,21 @@ #include <ngx_config.h> -typedef struct ngx_module_s ngx_module_t; -typedef struct ngx_conf_s ngx_conf_t; -typedef struct ngx_cycle_s ngx_cycle_t; -typedef struct ngx_pool_s ngx_pool_t; -typedef struct ngx_chain_s ngx_chain_t; -typedef struct ngx_log_s ngx_log_t; -typedef struct ngx_open_file_s ngx_open_file_t; -typedef struct ngx_command_s ngx_command_t; -typedef struct ngx_file_s ngx_file_t; -typedef struct ngx_event_s ngx_event_t; -typedef struct ngx_event_aio_s ngx_event_aio_t; -typedef struct ngx_connection_s ngx_connection_t; -typedef struct ngx_thread_task_s ngx_thread_task_t; +typedef struct ngx_module_s ngx_module_t; +typedef struct ngx_conf_s ngx_conf_t; +typedef struct ngx_cycle_s ngx_cycle_t; +typedef struct ngx_pool_s ngx_pool_t; +typedef struct ngx_chain_s ngx_chain_t; +typedef struct ngx_log_s ngx_log_t; +typedef struct ngx_open_file_s ngx_open_file_t; +typedef struct ngx_command_s ngx_command_t; +typedef struct ngx_file_s ngx_file_t; +typedef struct ngx_event_s ngx_event_t; +typedef struct ngx_event_aio_s ngx_event_aio_t; +typedef struct ngx_connection_s ngx_connection_t; +typedef struct ngx_thread_task_s ngx_thread_task_t; +typedef struct ngx_ssl_s ngx_ssl_t; +typedef struct ngx_ssl_connection_s ngx_ssl_connection_t; typedef void (*ngx_event_handler_pt)(ngx_event_t *ev); typedef void (*ngx_connection_handler_pt)(ngx_connection_t *c);
--- a/src/core/ngx_module.h Mon Oct 10 18:44:17 2016 +0300 +++ b/src/core/ngx_module.h Mon Oct 10 18:44:17 2016 +0300 @@ -139,7 +139,7 @@ #define NGX_MODULE_SIGNATURE_23 "0" #endif -#if (NGX_HTTP_SSL) +#if (NGX_HTTP_SSL || NGX_COMPAT) #define NGX_MODULE_SIGNATURE_24 "1" #else #define NGX_MODULE_SIGNATURE_24 "0"
--- a/src/event/ngx_event_connect.h Mon Oct 10 18:44:17 2016 +0300 +++ b/src/event/ngx_event_connect.h Mon Oct 10 18:44:17 2016 +0300 @@ -27,13 +27,10 @@ ngx_uint_t state); typedef void (*ngx_event_notify_peer_pt)(ngx_peer_connection_t *pc, void *data, ngx_uint_t type); -#if (NGX_SSL) - typedef ngx_int_t (*ngx_event_set_peer_session_pt)(ngx_peer_connection_t *pc, void *data); typedef void (*ngx_event_save_peer_session_pt)(ngx_peer_connection_t *pc, void *data); -#endif struct ngx_peer_connection_s { @@ -51,7 +48,7 @@ ngx_event_notify_peer_pt notify; void *data; -#if (NGX_SSL) +#if (NGX_SSL || NGX_COMPAT) ngx_event_set_peer_session_pt set_session; ngx_event_save_peer_session_pt save_session; #endif
--- a/src/event/ngx_event_openssl.h Mon Oct 10 18:44:17 2016 +0300 +++ b/src/event/ngx_event_openssl.h Mon Oct 10 18:44:17 2016 +0300 @@ -54,14 +54,14 @@ #define ngx_ssl_conn_t SSL -typedef struct { +struct ngx_ssl_s { SSL_CTX *ctx; ngx_log_t *log; size_t buffer_size; -} ngx_ssl_t; +}; -typedef struct { +struct ngx_ssl_connection_s { ngx_ssl_conn_t *connection; SSL_CTX *session_ctx; @@ -80,7 +80,7 @@ unsigned no_wait_shutdown:1; unsigned no_send_shutdown:1; unsigned handshake_buffer_set:1; -} ngx_ssl_connection_t; +}; #define NGX_SSL_NO_SCACHE -2
--- a/src/http/ngx_http_core_module.h Mon Oct 10 18:44:17 2016 +0300 +++ b/src/http/ngx_http_core_module.h Mon Oct 10 18:44:17 2016 +0300 @@ -67,9 +67,7 @@ unsigned default_server:1; unsigned bind:1; unsigned wildcard:1; -#if (NGX_HTTP_SSL) unsigned ssl:1; -#endif unsigned http2:1; #if (NGX_HAVE_INET6) unsigned ipv6only:1; @@ -230,9 +228,7 @@ ngx_http_virtual_names_t *virtual_names; -#if (NGX_HTTP_SSL) unsigned ssl:1; -#endif unsigned http2:1; unsigned proxy_protocol:1; };
--- a/src/http/ngx_http_request.h Mon Oct 10 18:44:17 2016 +0300 +++ b/src/http/ngx_http_request.h Mon Oct 10 18:44:17 2016 +0300 @@ -300,7 +300,7 @@ ngx_http_addr_conf_t *addr_conf; ngx_http_conf_ctx_t *conf_ctx; -#if (NGX_HTTP_SSL) +#if (NGX_HTTP_SSL || NGX_COMPAT) ngx_str_t *ssl_servername; #if (NGX_PCRE) ngx_http_regex_t *ssl_servername_regex; @@ -313,9 +313,7 @@ ngx_buf_t **free; ngx_int_t nfree; -#if (NGX_HTTP_SSL) unsigned ssl:1; -#endif unsigned proxy_protocol:1; } ngx_http_connection_t;
--- a/src/http/ngx_http_upstream.h Mon Oct 10 18:44:17 2016 +0300 +++ b/src/http/ngx_http_upstream.h Mon Oct 10 18:44:17 2016 +0300 @@ -222,7 +222,7 @@ unsigned intercept_404:1; unsigned change_buffering:1; -#if (NGX_HTTP_SSL) +#if (NGX_HTTP_SSL || NGX_COMPAT) ngx_ssl_t *ssl; ngx_flag_t ssl_session_reuse; @@ -367,7 +367,7 @@ ngx_str_t schema; ngx_str_t uri; -#if (NGX_HTTP_SSL) +#if (NGX_HTTP_SSL || NGX_COMPAT) ngx_str_t ssl_name; #endif