From: Marko Kreen Date: Wed, 18 Apr 2007 13:03:04 +0000 (+0000) Subject: dont call proto if must-flush packet is pending X-Git-Tag: pgbouncer_1_0_7~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3671a46f565b9a4f37fe5c0568780fc5bc65b9e7;p=pgbouncer dont call proto if must-flush packet is pending --- diff --git a/src/sbuf.c b/src/sbuf.c index 97ffe26..8fe300c 100644 --- a/src/sbuf.c +++ b/src/sbuf.c @@ -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;