]> granicus.if.org Git - pgbouncer/commitdiff
dont call proto if must-flush packet is pending
authorMarko Kreen <markokr@gmail.com>
Wed, 18 Apr 2007 13:03:04 +0000 (13:03 +0000)
committerMarko Kreen <markokr@gmail.com>
Wed, 18 Apr 2007 13:03:04 +0000 (13:03 +0000)
src/sbuf.c

index 97ffe2681e7fba86b3b342793c7d2bea678c6db2..8fe300c6e6d074dbf67f460dbbd36714cafb8b0d 100644 (file)
@@ -389,8 +389,14 @@ static bool sbuf_process_pending(SBuf *sbuf)
                if (avail == 0 || (full && avail <= SMALL_PKT))
                        break;
 
-               /* handle proto if start of packet */
-               if (sbuf->pkt_remain == 0) { /* start of new block */
+               /*
+                * If start of packet, process packet header.
+                *
+                * Dont append anything to flush packets, send them first.
+                */
+               if (sbuf->pkt_remain == 0 && !sbuf->pkt_flush) {
+                       /* if flush then send it before looking */
+
                        res = sbuf_call_proto(sbuf, SBUF_EV_READ);
                        if (!res)
                                return false;