]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not double call error handler on ssl errors in the timeout path
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 18 Nov 2021 15:45:09 +0000 (15:45 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 18 Nov 2021 15:45:09 +0000 (15:45 +0000)
src/libserver/http/http_connection.c

index a24fe6de68a7a7d113cc187146440fc941ebbf56..e3e32eef81be1474855e2638be9d7b984c857680 100644 (file)
@@ -1056,7 +1056,7 @@ rspamd_http_event_handler (int fd, short what, gpointer ud)
                        }
                }
                else if (r == 0) {
-                       if (!conn->finished) {
+                       if (!conn->finished && !priv->ssl) {
                                err = g_error_new (HTTP_ERROR, 408,
                                                "IO timeout");
                                conn->error_handler (conn, err);
@@ -1069,10 +1069,12 @@ rspamd_http_event_handler (int fd, short what, gpointer ud)
                        return;
                }
                else {
-                       err = g_error_new (HTTP_ERROR, 408,
-                                       "IO timeout");
-                       conn->error_handler (conn, err);
-                       g_error_free (err);
+                       if (!priv->ssl) {
+                               err = g_error_new(HTTP_ERROR, 408,
+                                               "IO timeout");
+                               conn->error_handler(conn, err);
+                               g_error_free(err);
+                       }
 
                        REF_RELEASE (pbuf);
                        rspamd_http_connection_unref (conn);