You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/11/21 00:32:11 UTC

[2/2] mesos git commit: Windows: Fixed HTTP server build and tests.

Windows: Fixed HTTP server build and tests.

This fixes the code added by:
https://reviews.apache.org/r/61155/

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


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

Branch: refs/heads/master
Commit: f145a4df63789c74a3b034f78be7e551d5c3e405
Parents: dfa5644
Author: Joseph Wu <jo...@apache.org>
Authored: Mon Nov 20 13:31:52 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Nov 20 16:30:35 2017 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/http.cpp             |  2 +-
 3rdparty/libprocess/src/tests/http_tests.cpp | 32 ++++++++++++++++++-----
 2 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f145a4df/3rdparty/libprocess/src/http.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/http.cpp b/3rdparty/libprocess/src/http.cpp
index eb4cd58..ef391a7 100644
--- a/3rdparty/libprocess/src/http.cpp
+++ b/3rdparty/libprocess/src/http.cpp
@@ -2145,7 +2145,7 @@ private:
     Future<Nothing> serving;
   };
 
-  hashmap<int, Client> clients;
+  hashmap<int_fd, Client> clients;
 };
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/f145a4df/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 a025a87..3190ca3 100644
--- a/3rdparty/libprocess/src/tests/http_tests.cpp
+++ b/3rdparty/libprocess/src/tests/http_tests.cpp
@@ -2359,8 +2359,14 @@ TEST(HttpServerTest, Pipeline)
 
   ASSERT_SOME(address);
 
-  Future<http::Connection> connect =
-    http::connect(address.get(), http::Scheme::HTTP);
+  // Connect to the IP from the libprocess library, but use the port from
+  // the server above. The libprocess IP will always report a locally
+  // bindable IP, meaning it will also work for the server above.
+  //
+  // See the comment in `HttpServeTest.Pipelining` for more details.
+  Future<http::Connection> connect = http::connect(
+      inet::Address(process::address().ip, address->port),
+      http::Scheme::HTTP);
 
   AWAIT_ASSERT_READY(connect);
 
@@ -2481,14 +2487,21 @@ TEST(HttpServerTest, Discard)
 
   ASSERT_SOME(address);
 
+  // Connect to the IP from the libprocess library, but use the port from
+  // the server above. The libprocess IP will always report a locally
+  // bindable IP, meaning it will also work for the server above.
+  //
+  // See the comment in `HttpServeTest.Pipelining` for more details.
+  //
   // NOTE: we can't guarantee that after the call to `server->run()`
   // the server is actually running because the actor might not yet
   // have received the asynchronous dispatch. Thus, we need some
   // happens before guarantee that the server is running which we get
   // by making a connection. We then use that connection to properly
   // test that we shutdown each client below.
-  Future<http::Connection> connect =
-    http::connect(address.get(), http::Scheme::HTTP);
+  Future<http::Connection> connect = http::connect(
+      inet::Address(process::address().ip, address->port),
+      http::Scheme::HTTP);
 
   AWAIT_ASSERT_READY(connect);
 
@@ -2540,14 +2553,21 @@ TEST(HttpServerTest, Finalize)
 
     ASSERT_SOME(address);
 
+    // Connect to the IP from the libprocess library, but use the port from
+    // the server above. The libprocess IP will always report a locally
+    // bindable IP, meaning it will also work for the server above.
+    //
+    // See the comment in `HttpServeTest.Pipelining` for more details.
+    //
     // NOTE: we can't guarantee that after the call to `server->run()`
     // the server is actually running because the actor might not yet
     // have received the asynchronous dispatch. Thus, we need some
     // happens before guarantee that the server is running which we
     // get by making a connection. We then use that connection to
     // properly test that we shutdown each client below.
-    Future<http::Connection> connect =
-      http::connect(address.get(), http::Scheme::HTTP);
+    Future<http::Connection> connect = http::connect(
+        inet::Address(process::address().ip, address->port),
+        http::Scheme::HTTP);
 
     AWAIT_ASSERT_READY(connect);