]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix ssl connection reuse
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Dec 2021 11:58:55 +0000 (11:58 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Dec 2021 11:58:55 +0000 (11:58 +0000)
src/libserver/http/http_connection.c

index e82c543c2da3dedae5d1761b373fcbc4dc77a39a..afd685ae08639f7422d715824a4ff7c7f381ed84 100644 (file)
@@ -1264,13 +1264,6 @@ rspamd_http_connection_new_client_keepalive (struct rspamd_http_context *ctx,
 
                priv = conn->priv;
 
-               if (priv->ssl) {
-                       rspamd_ssl_connection_restore_handlers (priv->ssl,
-                                       rspamd_http_event_handler,
-                                       rspamd_http_ssl_err_handler,
-                                       conn);
-               }
-
                return conn;
        }
 
@@ -2353,6 +2346,13 @@ rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn
                                        return FALSE;
                                }
                        }
+                       else {
+                               /* Just restore SSL handlers */
+                               rspamd_ssl_connection_restore_handlers (priv->ssl,
+                                               rspamd_http_event_handler,
+                                               rspamd_http_ssl_err_handler,
+                                               conn);
+                       }
                }
        }
        else {