Code

frontend: Execute commands early on large amounts of incoming traffic.
authorSebastian Harl <sh@tokkee.org>
Wed, 14 May 2014 19:03:43 +0000 (21:03 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 14 May 2014 19:03:43 +0000 (21:03 +0200)
This will free up buffer space if possible.

src/frontend/connection.c

index dba431049ac8af878f2c6df85779d57012531218..7cc1ae3544e654ccc362bff0d5c8d213a0a65695 100644 (file)
@@ -434,6 +434,11 @@ connection_read(sdb_conn_t *conn)
                }
 
                n += status;
+
+               /* give the main loop a chance to execute commands (and free up buffer
+                * space) on large amounts of incoming traffic */
+               if (n > 1024 * 1024)
+                       break;
        }
 
        return n;