]> source.dussan.org Git - rspamd.git/commitdiff
Some fixes to buffered IO.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 8 Nov 2013 17:39:57 +0000 (17:39 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 8 Nov 2013 17:39:57 +0000 (17:39 +0000)
src/buffer.c
src/controller.c

index 0985fed1055158f77563a0c6c7e56f388792b494..59dd55d3e79af6d6902da3f6be6246547b99adcc 100644 (file)
@@ -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) {
index f8335b8ec8f71cd2a7f2551f6d9d7250d8cbb73d..6c0480e623ca770d8994de0547aea2addceb8943 100644 (file)
@@ -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;
                                }
                        }