You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2017/07/19 19:51:11 UTC
mesos git commit: Used move semantics when returning gzip compressed
responses.
Repository: mesos
Updated Branches:
refs/heads/master b1eb4accd -> 4e6eb4ec5
Used move semantics when returning gzip compressed responses.
We used to copy the compressed body into the eventual response.
For large responses especially from `/state` endpoint made by the
Web UI, these can be pretty expensive. This change replaces the
copy by a move operation.
Review: https://reviews.apache.org/r/58220/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4e6eb4ec
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4e6eb4ec
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4e6eb4ec
Branch: refs/heads/master
Commit: 4e6eb4ec53bd1c8ce77944ce13828072627ce76e
Parents: b1eb4ac
Author: Anand Mazumdar <an...@apache.org>
Authored: Wed Jul 19 12:36:08 2017 -0700
Committer: Michael Park <mp...@apache.org>
Committed: Wed Jul 19 12:51:07 2017 -0700
----------------------------------------------------------------------
3rdparty/libprocess/src/encoder.hpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/4e6eb4ec/3rdparty/libprocess/src/encoder.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/encoder.hpp b/3rdparty/libprocess/src/encoder.hpp
index ea629d7..517ec21 100644
--- a/3rdparty/libprocess/src/encoder.hpp
+++ b/3rdparty/libprocess/src/encoder.hpp
@@ -201,7 +201,8 @@ public:
if (compressed.isError()) {
LOG(WARNING) << "Failed to gzip response body: " << compressed.error();
} else {
- body = compressed.get();
+ body = std::move(compressed.get());
+
headers["Content-Length"] = stringify(body.length());
headers["Content-Encoding"] = "gzip";
}