From 1e394730479a0850327ec8d45768d77ce18fd7c7 Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Thu, 24 Sep 2015 15:15:06 -0700 Subject: [PATCH] uv_pipe_connect returns void This fix prevents Libuv.pipe_connect from throwing when the stack memory that was previously incorrectly interpreted as the int return value happens to be negative. When pipe_connect threw, an assertion failure would follow since the pipe handle would be closed prematurely. http://docs.libuv.org/en/v1.x/pipe.html#c.uv_pipe_connect #205 --- src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs b/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs index 254483454d..c3bca07e89 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Networking/Libuv.cs @@ -243,13 +243,13 @@ namespace Microsoft.AspNet.Server.Kestrel.Networking [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void uv_connect_cb(IntPtr req, int status); [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)] - unsafe protected delegate int uv_pipe_connect(UvConnectRequest req, UvPipeHandle handle, string name, uv_connect_cb cb); + unsafe protected delegate void uv_pipe_connect(UvConnectRequest req, UvPipeHandle handle, string name, uv_connect_cb cb); protected uv_pipe_connect _uv_pipe_connect = default(uv_pipe_connect); unsafe public void pipe_connect(UvConnectRequest req, UvPipeHandle handle, string name, uv_connect_cb cb) { req.Validate(); handle.Validate(); - Check(_uv_pipe_connect(req, handle, name, cb)); + _uv_pipe_connect(req, handle, name, cb); } [UnmanagedFunctionPointer(CallingConvention.Cdecl)]