diff options
author | weidai <weidai11@users.noreply.github.com> | 2003-06-06 02:34:03 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2003-06-06 02:34:03 +0000 |
commit | 6c4437d03df6a1beadfadfc7c5388005c69665db (patch) | |
tree | 22ac172cd2a9920b7d33711a25947c5c98e8cef2 /queue.cpp | |
parent | 2f50e8eac958f5a1bf7be05aeac015e5ee400927 (diff) | |
download | cryptopp-git-6c4437d03df6a1beadfadfc7c5388005c69665db.tar.gz |
sync with private branch
Diffstat (limited to 'queue.cpp')
-rw-r--r-- | queue.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -234,8 +234,18 @@ void ByteQueue::LazyPut(const byte *inString, unsigned int size) { if (m_lazyLength > 0) FinalizeLazyPut(); + m_lazyString = const_cast<byte *>(inString); + m_lazyLength = size; + m_lazyStringModifiable = false; +} + +void ByteQueue::LazyPutModifiable(byte *inString, unsigned int size) +{ + if (m_lazyLength > 0) + FinalizeLazyPut(); m_lazyString = inString; m_lazyLength = size; + m_lazyStringModifiable = true; } void ByteQueue::UndoLazyPut(unsigned int size) @@ -309,7 +319,10 @@ unsigned int ByteQueue::TransferTo2(BufferedTransformation &target, unsigned lon unsigned int len = (unsigned int)STDMIN(bytesLeft, (unsigned long)m_lazyLength); if (len) { - target.ChannelPut(channel, m_lazyString, len); + if (m_lazyStringModifiable) + target.ChannelPutModifiable(channel, m_lazyString, len); + else + target.ChannelPut(channel, m_lazyString, len); m_lazyString += len; m_lazyLength -= len; bytesLeft -= len; |