From 4feec7c333fd1ec92d1dd8c7f741249e3919ec5e Mon Sep 17 00:00:00 2001 From: weidai Date: Thu, 20 Mar 2003 20:39:22 +0000 Subject: fix bug in MeterFilter git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@42 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- filters.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'filters.cpp') diff --git a/filters.cpp b/filters.cpp index ffac565..64c2a37 100644 --- a/filters.cpp +++ b/filters.cpp @@ -133,19 +133,23 @@ bool Filter::OutputMessageSeriesEnd(int outputSite, int propagation, bool blocki unsigned int MeterFilter::Put2(const byte *begin, unsigned int length, int messageEnd, bool blocking) { - FILTER_BEGIN; - m_currentMessageBytes += length; - m_totalBytes += length; - - if (messageEnd) + if (m_transparent) { - m_currentMessageBytes = 0; - m_currentSeriesMessages++; - m_totalMessages++; + FILTER_BEGIN; + m_currentMessageBytes += length; + m_totalBytes += length; + + if (messageEnd) + { + m_currentMessageBytes = 0; + m_currentSeriesMessages++; + m_totalMessages++; + } + + FILTER_OUTPUT(1, begin, length, messageEnd); + FILTER_END_NO_MESSAGE_END; } - - FILTER_OUTPUT(1, begin, length, messageEnd); - FILTER_END_NO_MESSAGE_END; + return 0; } bool MeterFilter::IsolatedMessageSeriesEnd(bool blocking) -- cgit v1.2.1