[nginx] Mail: fixed build without SSL.

Maxim Dounin mdounin at mdounin.ru
Thu Mar 11 01:48:16 UTC 2021


details:   https://hg.nginx.org/nginx/rev/777373b5a169
branches:  
changeset: 7801:777373b5a169
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Thu Mar 11 04:46:26 2021 +0300
description:
Mail: fixed build without SSL.

Broken by d84f13618277 and 12ea1de7d87c (1.19.8).

Reported by Sergey Osokin.

diffstat:

 src/mail/ngx_mail_auth_http_module.c |  5 +++--
 src/mail/ngx_mail_handler.c          |  7 ++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r 43d9c9c2981f -r 777373b5a169 src/mail/ngx_mail_auth_http_module.c
--- a/src/mail/ngx_mail_auth_http_module.c	Thu Mar 11 04:46:22 2021 +0300
+++ b/src/mail/ngx_mail_auth_http_module.c	Thu Mar 11 04:46:26 2021 +0300
@@ -1135,10 +1135,10 @@ ngx_mail_auth_http_create_request(ngx_ma
     size_t                     len;
     ngx_buf_t                 *b;
     ngx_str_t                  login, passwd;
+    ngx_connection_t          *c;
 #if (NGX_MAIL_SSL)
     ngx_str_t                  verify, subject, issuer, serial, fingerprint,
                                raw_cert, cert;
-    ngx_connection_t          *c;
     ngx_mail_ssl_conf_t       *sslcf;
 #endif
     ngx_mail_core_srv_conf_t  *cscf;
@@ -1151,9 +1151,10 @@ ngx_mail_auth_http_create_request(ngx_ma
         return NULL;
     }
 
+    c = s->connection;
+
 #if (NGX_MAIL_SSL)
 
-    c = s->connection;
     sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
 
     if (c->ssl && sslcf->verify) {
diff -r 43d9c9c2981f -r 777373b5a169 src/mail/ngx_mail_handler.c
--- a/src/mail/ngx_mail_handler.c	Thu Mar 11 04:46:22 2021 +0300
+++ b/src/mail/ngx_mail_handler.c	Thu Mar 11 04:46:26 2021 +0300
@@ -272,16 +272,17 @@ ngx_mail_proxy_protocol_handler(ngx_even
 static void
 ngx_mail_init_session_handler(ngx_event_t *rev)
 {
-    ngx_connection_t    *c;
-    ngx_mail_session_t  *s;
+    ngx_connection_t  *c;
 
     c = rev->data;
-    s = c->data;
 
 #if (NGX_MAIL_SSL)
     {
+    ngx_mail_session_t   *s;
     ngx_mail_ssl_conf_t  *sslcf;
 
+    s = c->data;
+
     sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
 
     if (sslcf->enable || s->ssl) {


More information about the nginx-devel mailing list