]> source.dussan.org Git - rspamd.git/commitdiff
Fix connecting to xmlrpc server.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 10 Jun 2011 13:50:24 +0000 (17:50 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 10 Jun 2011 13:50:24 +0000 (17:50 +0400)
src/lua/lua_http.c

index 89bd024bf52bd5cda28bb9222d54d23f2ad090c4..1ecfdfd1264545af3ce5d261897bbd1d48ff5bae 100644 (file)
@@ -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);
 }
 
 /**