1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

win: remove check for UV_PIPE_NO_TRUNCATE (#4221)

There is no length at which this gets truncated on Windows. The
underlying file system will just not successfully connect to a longer
path (in WTF-16 characters), which will return an error asynchronously
with the existing API.

Refs: #4040
This commit is contained in:
Jameson Nash 2023-11-15 09:08:49 -05:00 committed by GitHub
parent b9421d7066
commit 35da5ded3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 14 deletions

View File

@ -722,12 +722,6 @@ int uv_pipe_bind2(uv_pipe_t* handle,
return UV_EINVAL;
}
if (flags & UV_PIPE_NO_TRUNCATE) {
if (namelen > 256) {
return UV_EINVAL;
}
}
if (handle->flags & UV_HANDLE_BOUND) {
return UV_EINVAL;
}
@ -886,12 +880,6 @@ int uv_pipe_connect2(uv_connect_t* req,
return UV_EINVAL;
}
if (flags & UV_PIPE_NO_TRUNCATE) {
if (namelen > 256) {
return UV_EINVAL;
}
}
if (handle->flags & UV_HANDLE_PIPESERVER) {
err = ERROR_INVALID_PARAMETER;
goto error;

View File

@ -164,12 +164,14 @@ static void connect_overlong_cb(uv_connect_t* connect_req, int status) {
TEST_IMPL(pipe_overlong_path) {
char path[512];
uv_pipe_t pipe;
uv_connect_t req;
memset(path, '@', sizeof(path));
ASSERT_OK(uv_pipe_init(uv_default_loop(), &pipe, 0));
#ifndef _WIN32
char path[512];
memset(path, '@', sizeof(path));
ASSERT_EQ(UV_EINVAL,
uv_pipe_bind2(&pipe, path, sizeof(path), UV_PIPE_NO_TRUNCATE));
ASSERT_EQ(UV_EINVAL,
@ -180,6 +182,7 @@ TEST_IMPL(pipe_overlong_path) {
UV_PIPE_NO_TRUNCATE,
(uv_connect_cb) abort));
ASSERT_OK(uv_run(uv_default_loop(), UV_RUN_DEFAULT));
#endif
ASSERT_EQ(UV_EINVAL, uv_pipe_bind(&pipe, ""));
uv_pipe_connect(&req,