diff options
Diffstat (limited to 'src/operator-copy.cc')
-rw-r--r-- | src/operator-copy.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/operator-copy.cc b/src/operator-copy.cc index 77e1b9d..6f91349 100644 --- a/src/operator-copy.cc +++ b/src/operator-copy.cc @@ -58,12 +58,15 @@ Operator::ProcessResult CopyOperator::process(Depot &depot, Request &command) for (; success && i != srcMailbox->end(); ++i) { Message &source = *i; - if (srcMailbox->fastCopy(source, *destMailbox, depot.mailboxToFilename(toCanonMailbox(dmailbox)))) + if (srcMailbox->fastCopy(source, + *destMailbox, + depot.mailboxToFilename(toCanonMailbox(dmailbox)))) continue; // Have the destination mailbox create a message for us. - Message *dest = destMailbox->createMessage(depot.mailboxToFilename(toCanonMailbox(dmailbox)), - source.getInternalDate()); + Message *dest = destMailbox->createMessage( + depot.mailboxToFilename(toCanonMailbox(dmailbox)), + source.getInternalDate()); if (!dest) { session.setLastError(destMailbox->getLastError()); success = false; @@ -83,11 +86,13 @@ Operator::ProcessResult CopyOperator::process(Depot &depot, Request &command) if (readSize == 0) { break; } else if (readSize == -1) { - bincWarning << "when reading from message " << i.getSqnr() << "/" << source.getUID() << " in \"" - << srcMailbox->getName() << "\": " << source.getLastError() << std::endl; + bincWarning << "when reading from message " << i.getSqnr() << "/" << source.getUID() + << " in \"" << srcMailbox->getName() << "\": " << source.getLastError() + << std::endl; success = false; } else if (!dest->appendChunk(chunk)) { - bincWarning << "when writing to \"" << dmailbox << "\": " << dest->getLastError() << std::endl; + bincWarning << "when writing to \"" << dmailbox << "\": " << dest->getLastError() + << std::endl; success = false; } } while (success); @@ -96,13 +101,15 @@ Operator::ProcessResult CopyOperator::process(Depot &depot, Request &command) } if (!success && !destMailbox->rollBackNewMessages()) { - session.setLastError("Failed to rollback after unsuccessful copy: " + destMailbox->getLastError()); + session.setLastError("Failed to rollback after unsuccessful copy: " + + destMailbox->getLastError()); return NO; } if (success) { if (!destMailbox->commitNewMessages(depot.mailboxToFilename(toCanonMailbox(dmailbox)))) { - session.setLastError("Failed to commit after successful copy: " + destMailbox->getLastError()); + session.setLastError("Failed to commit after successful copy: " + + destMailbox->getLastError()); return NO; } } |