Skip to content

Commit 1064baf

Browse files
committed
src: port Pipe to uv_pipe_bind2, uv_pipe_connect2
The introduction of the uv_pipe_bind2 and uv_pipe_connect2 methods in libuv v1.46.0 changed the behaviour of uv_pipe_bind and uv_pipe_connect. This broke the ability to connect to abstract domain sockets on linux. This change ports PipeWrap to use the new uv_pipe_bind2 and uv_pipe_connect2 methods to restore abstract domain socket support. Fixes: nodejs#49656 Refs: libuv/libuv#4030
1 parent ba28cd8 commit 1064baf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/pipe_wrap.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void PipeWrap::Bind(const FunctionCallbackInfo<Value>& args) {
168168
PipeWrap* wrap;
169169
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
170170
node::Utf8Value name(args.GetIsolate(), args[0]);
171-
int err = uv_pipe_bind(&wrap->handle_, *name);
171+
int err = uv_pipe_bind2(&wrap->handle_, *name, name.length(), 0);
172172
args.GetReturnValue().Set(err);
173173
}
174174

@@ -237,9 +237,11 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
237237

238238
ConnectWrap* req_wrap =
239239
new ConnectWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_PIPECONNECTWRAP);
240-
req_wrap->Dispatch(uv_pipe_connect,
240+
req_wrap->Dispatch(uv_pipe_connect2,
241241
&wrap->handle_,
242242
*name,
243+
name.length(),
244+
0,
243245
AfterConnect);
244246

245247
TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(TRACING_CATEGORY_NODE2(net, native),

0 commit comments

Comments
 (0)