Code

frontend: Execute commands early on large amounts of incoming traffic.
[sysdb.git] / 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;