You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/11/22 03:27:25 UTC

[05/13] mesos git commit: Initialized the POD type in the `Request` struct.

Initialized the POD type in the `Request` struct.

Previously, the `keepAlive` member was not initialized correctly,
the behavior is undefined if POD types are not correctly
initialized.

Review: https://reviews.apache.org/r/53482/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/1003f3d2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/1003f3d2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/1003f3d2

Branch: refs/heads/master
Commit: 1003f3d208f6e06e8bf485e395190f9bd4e5fe24
Parents: 6a4de74
Author: Anand Mazumdar <an...@apache.org>
Authored: Mon Nov 21 18:07:11 2016 -0800
Committer: Anand Mazumdar <an...@apache.org>
Committed: Mon Nov 21 19:27:08 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/http.hpp | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1003f3d2/3rdparty/libprocess/include/process/http.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/http.hpp b/3rdparty/libprocess/include/process/http.hpp
index 5f7c0f6..51bfc7e 100644
--- a/3rdparty/libprocess/include/process/http.hpp
+++ b/3rdparty/libprocess/include/process/http.hpp
@@ -413,6 +413,9 @@ private:
 
 struct Request
 {
+  Request()
+    : keepAlive(false) {}
+
   std::string method;
 
   // TODO(benh): Add major/minor version.
@@ -430,6 +433,14 @@ struct Request
 
   // TODO(bmahler): Ensure this is consistent with the 'Connection'
   // header; perhaps make this a function that checks the header.
+  //
+  // TODO(anand): Ideally, this could default to 'true' since
+  // persistent connections are the default since HTTP 1.1.
+  // Perhaps, we need to go from `keepAlive` to `closeConnection`
+  // to reflect the header more accurately, and to have an
+  // intuitive default of false.
+  //
+  // Default: false.
   bool keepAlive;
 
   // For server requests, this contains the address of the client.