From 4d8c156915cc427a24884004c145880cc854e256 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 27 Mar 2015 11:56:38 +0000 Subject: [PATCH] continuing accumulation after dropping a frame is bad after all explain why --- router/forwarder.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/router/forwarder.go b/router/forwarder.go index a9e45625..28f410e8 100644 --- a/router/forwarder.go +++ b/router/forwarder.go @@ -306,6 +306,10 @@ func (fwd *Forwarder) accumulateAndSendFrames(frame *ForwardedFrame) bool { } if !fwd.appendFrame(frame) { fwd.logDrop(frame) + // [1] The buffer is empty at this point and therefore we must + // not flush it. The easiest way to accomplish that is simply + // by returning to the surrounding run loop. + return true } for { select { @@ -318,6 +322,7 @@ func (fwd *Forwarder) accumulateAndSendFrames(frame *ForwardedFrame) bool { fwd.flush() if !fwd.appendFrame(frame) { fwd.logDrop(frame) + return true // see [1] } } default: