From 05d40407330a886d529c0e2a66cfd047f720ba74 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 10 Jun 2011 17:50:24 +0400 Subject: [PATCH] Fix connecting to xmlrpc server. --- src/lua/lua_http.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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); } /** -- 2.39.5