summaryrefslogtreecommitdiffstats
path: root/src/libutil/http.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-21 14:07:27 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-21 14:07:27 +0100
commit0481887fdf5ecfccca2b703efadf84823b245f13 (patch)
tree0345b34c903f81f17a2c13ef0d991a523b4bf821 /src/libutil/http.c
parent4620dfdd5e319a281f4dda0ef9ee492b65c46a33 (diff)
downloadrspamd-0481887fdf5ecfccca2b703efadf84823b245f13.tar.gz
rspamd-0481887fdf5ecfccca2b703efadf84823b245f13.zip
Allow usage of default event base.
Diffstat (limited to 'src/libutil/http.c')
-rw-r--r--src/libutil/http.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index f245ca07c..7146a33c1 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -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);
}