MCPcopy Create free account
hub / github.com/LUX-Core/lux / TransferTo2

Method TransferTo2

src/cryptopp/queue.cpp:343–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343size_t ByteQueue::TransferTo2(BufferedTransformation &target, lword &transferBytes, const std::string &channel, bool blocking)
344{
345 if (blocking)
346 {
347 lword bytesLeft = transferBytes;
348 for (ByteQueueNode *current=m_head; bytesLeft && current; current=current->next)
349 bytesLeft -= current->TransferTo(target, bytesLeft, channel);
350 CleanupUsedNodes();
351
352 size_t len = (size_t)STDMIN(bytesLeft, (lword)m_lazyLength);
353 if (len)
354 {
355 if (m_lazyStringModifiable)
356 target.ChannelPutModifiable(channel, m_lazyString, len);
357 else
358 target.ChannelPut(channel, m_lazyString, len);
359 m_lazyString += len;
360 m_lazyLength -= len;
361 bytesLeft -= len;
362 }
363 transferBytes -= bytesLeft;
364 return 0;
365 }
366 else
367 {
368 Walker walker(*this);
369 size_t blockedBytes = walker.TransferTo2(target, transferBytes, channel, blocking);
370 Skip(transferBytes);
371 return blockedBytes;
372 }
373}
374
375size_t ByteQueue::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const
376{

Callers 1

CopyRangeTo2Method · 0.45

Calls 3

TransferToMethod · 0.80
CurrentSizeMethod · 0.45
ChannelPut2Method · 0.45

Tested by

no test coverage detected