summaryrefslogtreecommitdiff
path: root/filters.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-03-20 20:39:22 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-03-20 20:39:22 +0000
commit4feec7c333fd1ec92d1dd8c7f741249e3919ec5e (patch)
treed1405622c74eefde7d84f93d429d3c7462e59ce1 /filters.cpp
parent2f227820d9c9c10b9625415bf665f211bca23c51 (diff)
downloadcryptopp-4feec7c333fd1ec92d1dd8c7f741249e3919ec5e.tar.gz
fix bug in MeterFilter
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@42 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'filters.cpp')
-rw-r--r--filters.cpp26
1 files changed, 15 insertions, 11 deletions
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)