From edf3105abadf663f6bd4995bf4a8063bd324dc39 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 8 Nov 2013 17:39:57 +0000 Subject: [PATCH] Some fixes to buffered IO. --- src/buffer.c | 1 + src/controller.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer.c b/src/buffer.c index 0985fed10..59dd55d3e 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -258,6 +258,7 @@ write_buffers (gint fd, rspamd_io_dispatcher_t * d, gboolean is_delayed) event_add (d->ev, d->tv); return TRUE; } + len = d->out_buffers.pending; } if (d->out_buffers.pending == 0) { diff --git a/src/controller.c b/src/controller.c index f8335b8ec..6c0480e62 100644 --- a/src/controller.c +++ b/src/controller.c @@ -235,7 +235,7 @@ restful_write_reply (gint error_code, const gchar *err_message, const gchar *buf r += rspamd_snprintf (hbuf + r, sizeof (hbuf) - r, CRLF); if (buf != NULL) { - if (!rspamd_dispatcher_write (d, hbuf, r, TRUE, FALSE)) { + if (!rspamd_dispatcher_write (d, hbuf, r, TRUE, TRUE)) { return FALSE; } return rspamd_dispatcher_write (d, buf, buflen, FALSE, FALSE); @@ -1353,7 +1353,6 @@ controller_read_socket (f_str_t * in, void *arg) else if (session->cmd != NULL) { if (! process_command (session->cmd, NULL, session)) { msg_debug ("process command failed"); - destroy_session (session->s); return FALSE; } } -- 2.39.5