From: Vsevolod Stakhov Date: Fri, 8 Nov 2013 17:39:57 +0000 (+0000) Subject: Some fixes to buffered IO. X-Git-Tag: 0.6.0~83 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=edf3105abadf663f6bd4995bf4a8063bd324dc39;p=rspamd.git Some fixes to buffered IO. --- 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; } }