]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Stream read fix.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 Jun 2013 16:12:35 +0000 (17:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 Jun 2013 16:12:35 +0000 (17:12 +0100)
src/worker.c

index d37e3f9a24ce86f50faae375495fb8d9f123016a..828d2b4ccf903d9b0abf8b54c088261e66c96def 100644 (file)
@@ -299,15 +299,23 @@ read_socket (f_str_t * in, void *arg)
                break;
        case READ_MESSAGE:
                /* Allow half-closed connections to be proceed */
-               task->dispatcher->want_read = FALSE;
+
                if (task->content_length > 0) {
                        task->msg->begin = in->begin;
                        task->msg->len = in->len;
                        debug_task ("got string of length %z", task->msg->len);
                        task->state = WAIT_FILTER;
-
+                       task->dispatcher->want_read = FALSE;
                }
                else {
+                       if (!task->dispatcher->want_read && in->len == 0) {
+                               /*
+                                * Skip initial zero length string remain from
+                                * buffer policy switch
+                                */
+                               task->dispatcher->want_read = FALSE;
+                               return TRUE;
+                       }
                        if (in->len > 0) {
                                if (task->msg->begin == NULL) {
                                        /* Allocate buf */