You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2016/12/01 21:38:02 UTC

mesos git commit: Fixed bug on OSX with socket shutdown.

Repository: mesos
Updated Branches:
  refs/heads/master 071ed5226 -> 9622bc9eb


Fixed bug on OSX with socket shutdown.


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

Branch: refs/heads/master
Commit: 9622bc9ebd8f4105e05a4e833d29f8625b6ec90d
Parents: 071ed52
Author: Benjamin Hindman <be...@gmail.com>
Authored: Thu Dec 1 13:37:01 2016 -0800
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Thu Dec 1 13:37:37 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/http.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9622bc9e/3rdparty/libprocess/src/http.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/http.cpp b/3rdparty/libprocess/src/http.cpp
index 5203fb3..ac406e2 100644
--- a/3rdparty/libprocess/src/http.cpp
+++ b/3rdparty/libprocess/src/http.cpp
@@ -1771,7 +1771,13 @@ Future<Nothing> serve(
         // Note that we don't look at the return value of
         // `Socket::shutdown` because the socket might already be
         // shutdown!
-        socket.shutdown(network::Socket::Shutdown::READ_WRITE);
+        //
+        // CAREFUL! We can't shutdown with Shutdown::READ_WRITE
+        // because on OSX if the socket is already shutdown with READ
+        // due to the call above then the call will fail rather than
+        // just treat it like a shutdown WRITE.
+        socket.shutdown(network::Socket::Shutdown::READ);
+        socket.shutdown(network::Socket::Shutdown::WRITE);
       });
 
   std::shared_ptr<Promise<Nothing>> promise(new Promise<Nothing>());