From 3671a46f565b9a4f37fe5c0568780fc5bc65b9e7 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 18 Apr 2007 13:03:04 +0000 Subject: [PATCH] dont call proto if must-flush packet is pending --- src/sbuf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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; -- 2.50.1