Last active
November 6, 2015 07:13
-
-
Save tnachen/990b1b0bb0c9e7f8d23c to your computer and use it in GitHub Desktop.
Diff for review 39340
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp b/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp | |
index a8edf13..2d486dc 100644 | |
--- a/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp | |
+++ b/src/slave/containerizer/mesos/provisioner/docker/registry_client.cpp | |
@@ -625,18 +625,15 @@ Future<size_t> RegistryClientProcess::saveBlob( | |
{ | |
return reader.read() | |
.then([this, fd, reader, totalSize]( | |
- const string& data) mutable -> Future<size_t> { | |
+ const string& data) -> Future<size_t> { | |
if (data.empty()) { | |
return totalSize; | |
} | |
- size_t length = data.length(); | |
- return _saveBlob(fd, data.data(), length) | |
- .then([this, fd, reader, length, totalSize]( | |
- ) mutable -> Future<size_t> { | |
- totalSize += length; | |
- | |
- return saveBlob(fd, const_cast<Pipe::Reader&>(reader), totalSize); | |
+ size_t newTotalSize = totalSize + data.length(); | |
+ return _saveBlob(fd, data.data(), newTotalSize) | |
+ .then([this, fd, reader, newTotalSize]() -> Future<size_t> { | |
+ return saveBlob(fd, const_cast<Pipe::Reader&>(reader), newTotalSize); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment