From: Vsevolod Stakhov Date: Fri, 10 Jun 2011 13:50:24 +0000 (+0400) Subject: Fix connecting to xmlrpc server. X-Git-Tag: 0.3.14~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=05d40407330a886d529c0e2a66cfd047f720ba74;p=rspamd.git Fix connecting to xmlrpc server. --- diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c index 89bd024bf..1ecfdfd12 100644 --- a/src/lua/lua_http.c +++ b/src/lua/lua_http.c @@ -308,15 +308,12 @@ lua_http_dns_callback (struct rspamd_dns_reply *reply, gpointer arg) ud->io_dispatcher = rspamd_create_dispatcher (ud->fd, BUFFER_LINE, lua_http_read_cb, NULL, lua_http_err_cb, &tv, ud); /* Write request */ + register_async_event (ud->task->s, lua_http_fin, ud, FALSE); - if (!rspamd_dispatcher_write (ud->io_dispatcher, ud->req_buf, ud->req_len, FALSE, TRUE)) { + if (!rspamd_dispatcher_write (ud->io_dispatcher, ud->req_buf, ud->req_len, TRUE, TRUE)) { lua_http_push_error (450, ud); - rspamd_remove_dispatcher (ud->io_dispatcher); - close (ud->fd); return; } - - register_async_event (ud->task->s, lua_http_fin, ud, FALSE); } /**