- for (; length > 0; h = &(db->next))
- {
- if (0 == (db = *h))
- {
- if (0 == (db = dbuf_alloc()))
- return dbuf_malloc_error(dyn);
-
+ for (; length > 0; h = &(db->next)) {
+ if (0 == (db = *h)) {
+ if (0 == (db = dbuf_alloc())) {
+#if defined(HAS_FERGUSON_FLUSHER)
+ /*
+ * from "Married With Children" episode were Al bought a REAL toilet
+ * on the black market because he was tired of the wimpy water
+ * conserving toilets they make these days --Bleep
+ */
+ /*
+ * Apparently this doesn't work, the server _has_ to
+ * dump a few clients to handle the load. A fully loaded
+ * server cannot handle a net break without dumping some
+ * clients. If we flush the connections here under a full
+ * load we may end up starving the kernel for mbufs and
+ * crash the machine
+ */
+ /*
+ * attempt to recover from buffer starvation before
+ * bailing this may help servers running out of memory
+ */
+ flush_sendq_except(dyn);
+ if (0 == (db = dbuf_alloc()))
+#endif
+ return dbuf_malloc_error(dyn);
+ }