diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2004-04-08 01:31:06 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2004-04-08 01:31:06 +0000 |
commit | f99115e8901ebb39ff2e3e43c311a9ffc237865a (patch) | |
tree | 04496c5967e92359826dd6f86899cf85866a5a83 /network.cpp | |
parent | 2bb4ca7209a6b7ed86fd9c90a35c1b29df372c38 (diff) | |
download | cryptopp-f99115e8901ebb39ff2e3e43c311a9ffc237865a.tar.gz |
fix extraneous FinalizeLazyPut in NetworkSink::Put2 in case of exceptions
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@157 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'network.cpp')
-rw-r--r-- | network.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/network.cpp b/network.cpp index ab495da..53284a6 100644 --- a/network.cpp +++ b/network.cpp @@ -195,7 +195,7 @@ unsigned int NetworkSink::Put2(const byte *inString, unsigned int length, int me inString += m_skipBytes; length -= m_skipBytes; } - LazyPutter lp(m_buffer, inString, length); + m_buffer.LazyPut(inString, length); if (!blocking || m_buffer.CurrentSize() > m_autoFlushBound) TimedFlush(0, 0); @@ -209,10 +209,13 @@ unsigned int NetworkSink::Put2(const byte *inString, unsigned int length, int me assert(!blocking); unsigned int blockedBytes = STDMIN(m_buffer.CurrentSize() - targetSize, (unsigned long)length); m_buffer.UndoLazyPut(blockedBytes); + m_buffer.FinalizeLazyPut(); m_wasBlocked = true; m_skipBytes += length - blockedBytes; return STDMAX(blockedBytes, 1U); } + + m_buffer.FinalizeLazyPut(); m_wasBlocked = false; m_skipBytes = 0; |