| 341 | } |
| 342 | |
| 343 | size_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 | |
| 375 | size_t ByteQueue::CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end, const std::string &channel, bool blocking) const |
| 376 | { |
no test coverage detected