# HG changeset patch
# User Maxim Dounin <[email protected]>
# Date 1746114919 -10800
#      Thu May 01 18:55:19 2025 +0300
# Node ID af60c59087e6721c8f24fae557a98617e7457823
# Parent  ea2fca0e094ffa78db62ec8655a42965441cd8df
Mail: style.

There is no reason to use c->write as we already have wev, and it is
used elsewhere in ngx_mail_send().

diff --git a/src/mail/ngx_mail_handler.c b/src/mail/ngx_mail_handler.c
--- a/src/mail/ngx_mail_handler.c
+++ b/src/mail/ngx_mail_handler.c
@@ -1042,7 +1042,7 @@ ngx_mail_send(ngx_event_t *wev)
     }
 
     if (s->out.len == 0) {
-        if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
+        if (ngx_handle_write_event(wev, 0) != NGX_OK) {
             ngx_mail_close_connection(c);
         }
 
@@ -1086,9 +1086,9 @@ again:
 
     cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
 
-    ngx_add_timer(c->write, cscf->timeout);
+    ngx_add_timer(wev, cscf->timeout);
 
-    if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
+    if (ngx_handle_write_event(wev, 0) != NGX_OK) {
         ngx_mail_close_connection(c);
         return;
     }

Reply via email to