diff options
author | Chris Wilson <chris+github@qwirx.com> | 2013-08-22 00:17:34 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2013-08-22 00:17:34 +0000 |
commit | c8af9906b692de24dbf1b03c563d85fa85d3a4dc (patch) | |
tree | 16c97aa693fb5e7133b4e10c826c901bdcddbe10 /bin/bbackupd/BackupDaemon.cpp | |
parent | 410c85a13d5812efeadb13e3ffa82b9629331100 (diff) |
Pass std::auto_ptr objects to Protocol for upload.
Passing raw pointers is bad C++ style, and dangerous, because Protocol
will free the passed-in pointers after uploading them, so we should not
keep using them.
Reduce code duplication in BackupClientDirectoryRecord patch/normal upload.
Return a std::auto_ptr<BackupStoreFileEncodeStream> instead of a
std::auto_ptr<IOStream> from BackupStoreFile::EncodeFile* functions.
Diffstat (limited to 'bin/bbackupd/BackupDaemon.cpp')
-rw-r--r-- | bin/bbackupd/BackupDaemon.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index 8133aec3..39bb98e3 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -2460,7 +2460,8 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con // Execute create directory command try { - MemBlockStream attrStream(attr); + std::auto_ptr<IOStream> attrStream( + new MemBlockStream(attr)); std::auto_ptr<BackupProtocolSuccess> dirCreate(connection.QueryCreateDirectory( BackupProtocolListDirectory::RootDirectory, |