]> source.dussan.org Git - rspamd.git/commitdiff
Allow usage of default event base.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Aug 2014 13:07:27 +0000 (14:07 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 21 Aug 2014 13:07:27 +0000 (14:07 +0100)
src/libutil/http.c

index f245ca07c1097f654c2f696f8a4c00000162e439..7146a33c11008d5f0b40bbb6186e1a41c37bacaf 100644 (file)
@@ -821,7 +821,9 @@ rspamd_http_connection_read_message (struct rspamd_http_connection *conn,
                EV_READ | EV_PERSIST,
                rspamd_http_event_handler,
                conn);
-       event_base_set (base, &priv->ev);
+       if (base != NULL) {
+               event_base_set (base, &priv->ev);
+       }
        event_add (&priv->ev, priv->ptv);
 }
 
@@ -968,7 +970,9 @@ rspamd_http_connection_write_message (struct rspamd_http_connection *conn,
        }
 
        event_set (&priv->ev, fd, EV_WRITE, rspamd_http_event_handler, conn);
-       event_base_set (base, &priv->ev);
+       if (base != NULL) {
+               event_base_set (base, &priv->ev);
+       }
        event_add (&priv->ev, priv->ptv);
 }