You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2017/02/24 02:15:27 UTC

[1/2] mesos git commit: Updated docker fetcher pluggin corresponding to the former commit.

Repository: mesos
Updated Branches:
  refs/heads/1.2.x de995a31c -> 85536a69d


Updated docker fetcher pluggin corresponding to the former commit.

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


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

Branch: refs/heads/1.2.x
Commit: 85536a69d7833a23e6aae30800707d57f7eddf92
Parents: 2949ca0
Author: Gilbert Song <so...@gmail.com>
Authored: Thu Feb 23 18:03:08 2017 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu Feb 23 18:15:24 2017 -0800

----------------------------------------------------------------------
 src/uri/fetchers/docker.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/85536a69/src/uri/fetchers/docker.cpp
----------------------------------------------------------------------
diff --git a/src/uri/fetchers/docker.cpp b/src/uri/fetchers/docker.cpp
index b61a71a..68f380d 100644
--- a/src/uri/fetchers/docker.cpp
+++ b/src/uri/fetchers/docker.cpp
@@ -643,7 +643,7 @@ Future<http::Headers> DockerFetcherPluginProcess::getAuthHeader(
     const http::Response& response)
 {
   Result<http::header::WWWAuthenticate> header =
-    response.headers.header<http::header::WWWAuthenticate>();
+    response.headers.get<http::header::WWWAuthenticate>();
 
   if (header.isError()) {
     return Failure(


[2/2] mesos git commit: Renamed 'Headers' class templete method to 'get()'.

Posted by ji...@apache.org.
Renamed 'Headers' class templete method to 'get()'.

This patch changed the 'Headers' class templete method from 'header()'
to 'get()' since 'get' is more accurate for grabbing a header object
while it can be defined as different type (e.g., WWWAuthenticate).

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


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

Branch: refs/heads/1.2.x
Commit: 2949ca0abb8fb6bd97d67a35b2a22377198f8a21
Parents: de995a3
Author: Gilbert Song <so...@gmail.com>
Authored: Thu Feb 23 18:03:04 2017 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu Feb 23 18:15:24 2017 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/http.hpp | 11 ++++++++++-
 3rdparty/libprocess/src/tests/http_tests.cpp | 18 +++++++++---------
 2 files changed, 19 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2949ca0a/3rdparty/libprocess/include/process/http.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/http.hpp b/3rdparty/libprocess/include/process/http.hpp
index 52828ee..eb2c87d 100644
--- a/3rdparty/libprocess/include/process/http.hpp
+++ b/3rdparty/libprocess/include/process/http.hpp
@@ -482,7 +482,7 @@ public:
           CaseInsensitiveEqual>(list) {}
 
   template <typename T>
-  Result<T> header() const
+  Result<T> get() const
   {
     Option<std::string> value = get(T::NAME);
     if (value.isNone()) {
@@ -494,6 +494,15 @@ public:
     }
     return header.get();
   }
+
+  Option<std::string> get(const std::string& key) const
+  {
+    return hashmap<
+        std::string,
+        std::string,
+        CaseInsensitiveHash,
+        CaseInsensitiveEqual>::get(key);
+  }
 };
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2949ca0a/3rdparty/libprocess/src/tests/http_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/http_tests.cpp b/3rdparty/libprocess/src/tests/http_tests.cpp
index 71e8ad6..fb4da9a 100644
--- a/3rdparty/libprocess/src/tests/http_tests.cpp
+++ b/3rdparty/libprocess/src/tests/http_tests.cpp
@@ -1527,7 +1527,7 @@ TEST_P(HTTPTest, WWWAuthenticateHeader)
   headers["Www-Authenticate"] = "Basic realm=\"basic-realm\"";
 
   Result<http::header::WWWAuthenticate> header =
-    headers.header<http::header::WWWAuthenticate>();
+    headers.get<http::header::WWWAuthenticate>();
 
   ASSERT_SOME(header);
 
@@ -1536,7 +1536,7 @@ TEST_P(HTTPTest, WWWAuthenticateHeader)
   EXPECT_EQ("basic-realm", header->authParam()["realm"]);
 
   headers.clear();
-  header = headers.header<http::header::WWWAuthenticate>();
+  header = headers.get<http::header::WWWAuthenticate>();
 
   EXPECT_NONE(header);
 
@@ -1545,7 +1545,7 @@ TEST_P(HTTPTest, WWWAuthenticateHeader)
     "service=\"registry.docker.io\","
     "scope=\"repository:gilbertsong/inky:pull\"";
 
-  header = headers.header<http::header::WWWAuthenticate>();
+  header = headers.get<http::header::WWWAuthenticate>();
 
   ASSERT_SOME(header);
 
@@ -1556,32 +1556,32 @@ TEST_P(HTTPTest, WWWAuthenticateHeader)
   EXPECT_EQ("repository:gilbertsong/inky:pull", header->authParam()["scope"]);
 
   headers["Www-Authenticate"] = "";
-  header = headers.header<http::header::WWWAuthenticate>();
+  header = headers.get<http::header::WWWAuthenticate>();
 
   EXPECT_ERROR(header);
 
   headers["Www-Authenticate"] = " ";
-  header = headers.header<http::header::WWWAuthenticate>();
+  header = headers.get<http::header::WWWAuthenticate>();
 
   EXPECT_ERROR(header);
 
   headers["Www-Authenticate"] = "Digest";
-  header = headers.header<http::header::WWWAuthenticate>();
+  header = headers.get<http::header::WWWAuthenticate>();
 
   EXPECT_ERROR(header);
 
   headers["Www-Authenticate"] = "Digest =";
-  header = headers.header<http::header::WWWAuthenticate>();
+  header = headers.get<http::header::WWWAuthenticate>();
 
   EXPECT_ERROR(header);
 
   headers["Www-Authenticate"] = "Digest ,,";
-  header = headers.header<http::header::WWWAuthenticate>();
+  header = headers.get<http::header::WWWAuthenticate>();
 
   EXPECT_ERROR(header);
 
   headers["Www-Authenticate"] = "Digest uri=\"/dir/index.html\",qop=auth";
-  header = headers.header<http::header::WWWAuthenticate>();
+  header = headers.get<http::header::WWWAuthenticate>();
 
   EXPECT_ERROR(header);
 }