Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
4cd365ec
提交
4cd365ec
authored
1月 09, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update libuv to v1.10.2
上级
c50dc80c
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
277 行增加
和
35 行删除
+277
-35
AUTHORS
worker/deps/libuv/AUTHORS
+1
-0
ChangeLog
worker/deps/libuv/ChangeLog
+29
-1
appveyor.yml
worker/deps/libuv/appveyor.yml
+1
-1
configure.ac
worker/deps/libuv/configure.ac
+1
-1
uv-version.h
worker/deps/libuv/include/uv-version.h
+1
-1
darwin.c
worker/deps/libuv/src/unix/darwin.c
+10
-0
fs.c
worker/deps/libuv/src/unix/fs.c
+23
-6
error.c
worker/deps/libuv/src/win/error.c
+1
-0
fs.c
worker/deps/libuv/src/win/fs.c
+0
-2
getaddrinfo.c
worker/deps/libuv/src/win/getaddrinfo.c
+1
-2
process.c
worker/deps/libuv/src/win/process.c
+1
-1
tty.c
worker/deps/libuv/src/win/tty.c
+97
-10
test-error.c
worker/deps/libuv/test/test-error.c
+1
-0
test-fs.c
worker/deps/libuv/test/test-fs.c
+11
-9
test-getaddrinfo.c
worker/deps/libuv/test/test-getaddrinfo.c
+7
-0
test-list.h
worker/deps/libuv/test/test-list.h
+4
-0
test-tty.c
worker/deps/libuv/test/test-tty.c
+87
-0
get_dep.sh
worker/scripts/get_dep.sh
+1
-1
没有找到文件。
worker/deps/libuv/AUTHORS
浏览文件 @
4cd365ec
...
@@ -278,3 +278,4 @@ Brad King <brad.king@kitware.com>
...
@@ -278,3 +278,4 @@ Brad King <brad.king@kitware.com>
Philippe Laferriere <laferriere.phil@gmail.com>
Philippe Laferriere <laferriere.phil@gmail.com>
Will Speak <lithiumflame@gmail.com>
Will Speak <lithiumflame@gmail.com>
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
Eric Sciple <ersciple@microsoft.com>
worker/deps/libuv/ChangeLog
浏览文件 @
4cd365ec
2016.11.17, Version 1.10.1 (Stable)
2017.01.10, Version 1.10.2 (Stable)
Changes since version 1.10.1:
* Now working on version 1.10.2 (cjihrig)
* darwin: fix fsync and fdatasync (Joran Dirk Greef)
* Revert "Revert "win,tty: add support for ANSI codes in win10 v1511""
(Santiago Gimeno)
* win,tty: fix MultiByteToWideChar output buffer (Santiago Gimeno)
* win: remove dead code related to BACKUP_SEMANTICS (Sam Roberts)
* win: fix comment in quote_cmd_arg (Eric Sciple)
* darwin: use clock_gettime in macOS 10.12 (Saúl Ibarra Corretgé)
* win, tty: fix crash on restarting with pending data (Nicholas Vavilov)
* fs: fix uv__to_stat on BSD platforms (Santiago Gimeno)
* win: map ERROR_ELEVATION_REQUIRED to UV_EACCES (Richard Lau)
* win: fix free() on bad input in uv_getaddrinfo() (Ben Noordhuis)
2016.11.17, Version 1.10.1 (Stable), 2e49e332bdede6db7cf17fa784a902e8386d5d86
Changes since version 1.10.0:
Changes since version 1.10.0:
...
...
worker/deps/libuv/appveyor.yml
浏览文件 @
4cd365ec
version
:
v1.10.
1
.build{build}
version
:
v1.10.
2
.build{build}
install
:
install
:
-
cinst -y nsis
-
cinst -y nsis
...
...
worker/deps/libuv/configure.ac
浏览文件 @
4cd365ec
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_PREREQ(2.57)
AC_PREREQ(2.57)
AC_INIT([libuv], [1.10.
1
], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.10.
2
], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
m4_include([m4/as_case.m4])
...
...
worker/deps/libuv/include/uv-version.h
浏览文件 @
4cd365ec
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#define UV_VERSION_MAJOR 1
#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 10
#define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH
1
#define UV_VERSION_PATCH
2
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""
#define UV_VERSION_SUFFIX ""
...
...
worker/deps/libuv/src/unix/darwin.c
浏览文件 @
4cd365ec
...
@@ -34,8 +34,12 @@
...
@@ -34,8 +34,12 @@
#include <mach-o/dyld.h>
/* _NSGetExecutablePath */
#include <mach-o/dyld.h>
/* _NSGetExecutablePath */
#include <sys/resource.h>
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <sys/sysctl.h>
#include <time.h>
#include <unistd.h>
/* sysconf */
#include <unistd.h>
/* sysconf */
#undef NANOSEC
#define NANOSEC ((uint64_t) 1e9)
int
uv__platform_loop_init
(
uv_loop_t
*
loop
)
{
int
uv__platform_loop_init
(
uv_loop_t
*
loop
)
{
loop
->
cf_state
=
NULL
;
loop
->
cf_state
=
NULL
;
...
@@ -53,6 +57,11 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
...
@@ -53,6 +57,11 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
uint64_t
uv__hrtime
(
uv_clocktype_t
type
)
{
uint64_t
uv__hrtime
(
uv_clocktype_t
type
)
{
#ifdef MAC_OS_X_VERSION_10_12
struct
timespec
ts
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
ts
);
return
(((
uint64_t
)
ts
.
tv_sec
)
*
NANOSEC
+
ts
.
tv_nsec
);
#else
static
mach_timebase_info_data_t
info
;
static
mach_timebase_info_data_t
info
;
if
((
ACCESS_ONCE
(
uint32_t
,
info
.
numer
)
==
0
||
if
((
ACCESS_ONCE
(
uint32_t
,
info
.
numer
)
==
0
||
...
@@ -61,6 +70,7 @@ uint64_t uv__hrtime(uv_clocktype_t type) {
...
@@ -61,6 +70,7 @@ uint64_t uv__hrtime(uv_clocktype_t type) {
abort
();
abort
();
return
mach_absolute_time
()
*
info
.
numer
/
info
.
denom
;
return
mach_absolute_time
()
*
info
.
numer
/
info
.
denom
;
#endif
}
}
...
...
worker/deps/libuv/src/unix/fs.c
浏览文件 @
4cd365ec
...
@@ -129,8 +129,23 @@
...
@@ -129,8 +129,23 @@
static
ssize_t
uv__fs_fdatasync
(
uv_fs_t
*
req
)
{
static
ssize_t
uv__fs_fdatasync
(
uv_fs_t
*
req
)
{
#if defined(__linux__) || defined(__sun) || defined(__NetBSD__)
#if defined(__linux__) || defined(__sun) || defined(__NetBSD__)
return
fdatasync
(
req
->
file
);
return
fdatasync
(
req
->
file
);
#elif defined(__APPLE__) && defined(SYS_fdatasync)
#elif defined(__APPLE__)
return
syscall
(
SYS_fdatasync
,
req
->
file
);
/* Apple's fdatasync and fsync explicitly do NOT flush the drive write cache
* to the drive platters. This is in contrast to Linux's fdatasync and fsync
* which do, according to recent man pages. F_FULLFSYNC is Apple's equivalent
* for flushing buffered data to permanent storage.
*/
return
fcntl
(
req
->
file
,
F_FULLFSYNC
);
#else
return
fsync
(
req
->
file
);
#endif
}
static
ssize_t
uv__fs_fsync
(
uv_fs_t
*
req
)
{
#if defined(__APPLE__)
/* See the comment in uv__fs_fdatasync. */
return
fcntl
(
req
->
file
,
F_FULLFSYNC
);
#else
#else
return
fsync
(
req
->
file
);
return
fsync
(
req
->
file
);
#endif
#endif
...
@@ -798,6 +813,10 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
...
@@ -798,6 +813,10 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
dst
->
st_flags
=
0
;
dst
->
st_flags
=
0
;
dst
->
st_gen
=
0
;
dst
->
st_gen
=
0
;
#elif !defined(_AIX) && ( \
#elif !defined(_AIX) && ( \
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
defined(_GNU_SOURCE) || \
defined(_GNU_SOURCE) || \
defined(_BSD_SOURCE) || \
defined(_BSD_SOURCE) || \
defined(_SVID_SOURCE) || \
defined(_SVID_SOURCE) || \
...
@@ -809,9 +828,7 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
...
@@ -809,9 +828,7 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) {
dst
->
st_mtim
.
tv_nsec
=
src
->
st_mtim
.
tv_nsec
;
dst
->
st_mtim
.
tv_nsec
=
src
->
st_mtim
.
tv_nsec
;
dst
->
st_ctim
.
tv_sec
=
src
->
st_ctim
.
tv_sec
;
dst
->
st_ctim
.
tv_sec
=
src
->
st_ctim
.
tv_sec
;
dst
->
st_ctim
.
tv_nsec
=
src
->
st_ctim
.
tv_nsec
;
dst
->
st_ctim
.
tv_nsec
=
src
->
st_ctim
.
tv_nsec
;
# if defined(__DragonFly__) || \
# if defined(__FreeBSD__) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__)
defined(__NetBSD__)
dst
->
st_birthtim
.
tv_sec
=
src
->
st_birthtim
.
tv_sec
;
dst
->
st_birthtim
.
tv_sec
=
src
->
st_birthtim
.
tv_sec
;
dst
->
st_birthtim
.
tv_nsec
=
src
->
st_birthtim
.
tv_nsec
;
dst
->
st_birthtim
.
tv_nsec
=
src
->
st_birthtim
.
tv_nsec
;
...
@@ -945,7 +962,7 @@ static void uv__fs_work(struct uv__work* w) {
...
@@ -945,7 +962,7 @@ static void uv__fs_work(struct uv__work* w) {
X
(
FCHOWN
,
fchown
(
req
->
file
,
req
->
uid
,
req
->
gid
));
X
(
FCHOWN
,
fchown
(
req
->
file
,
req
->
uid
,
req
->
gid
));
X
(
FDATASYNC
,
uv__fs_fdatasync
(
req
));
X
(
FDATASYNC
,
uv__fs_fdatasync
(
req
));
X
(
FSTAT
,
uv__fs_fstat
(
req
->
file
,
&
req
->
statbuf
));
X
(
FSTAT
,
uv__fs_fstat
(
req
->
file
,
&
req
->
statbuf
));
X
(
FSYNC
,
fsync
(
req
->
file
));
X
(
FSYNC
,
uv__fs_fsync
(
req
));
X
(
FTRUNCATE
,
ftruncate
(
req
->
file
,
req
->
off
));
X
(
FTRUNCATE
,
ftruncate
(
req
->
file
,
req
->
off
));
X
(
FUTIME
,
uv__fs_futime
(
req
));
X
(
FUTIME
,
uv__fs_futime
(
req
));
X
(
LSTAT
,
uv__fs_lstat
(
req
->
path
,
&
req
->
statbuf
));
X
(
LSTAT
,
uv__fs_lstat
(
req
->
path
,
&
req
->
statbuf
));
...
...
worker/deps/libuv/src/win/error.c
浏览文件 @
4cd365ec
...
@@ -71,6 +71,7 @@ int uv_translate_sys_error(int sys_errno) {
...
@@ -71,6 +71,7 @@ int uv_translate_sys_error(int sys_errno) {
switch
(
sys_errno
)
{
switch
(
sys_errno
)
{
case
ERROR_NOACCESS
:
return
UV_EACCES
;
case
ERROR_NOACCESS
:
return
UV_EACCES
;
case
WSAEACCES
:
return
UV_EACCES
;
case
WSAEACCES
:
return
UV_EACCES
;
case
ERROR_ELEVATION_REQUIRED
:
return
UV_EACCES
;
case
ERROR_ADDRESS_ALREADY_ASSOCIATED
:
return
UV_EADDRINUSE
;
case
ERROR_ADDRESS_ALREADY_ASSOCIATED
:
return
UV_EADDRINUSE
;
case
WSAEADDRINUSE
:
return
UV_EADDRINUSE
;
case
WSAEADDRINUSE
:
return
UV_EADDRINUSE
;
case
WSAEADDRNOTAVAIL
:
return
UV_EADDRNOTAVAIL
;
case
WSAEADDRNOTAVAIL
:
return
UV_EADDRNOTAVAIL
;
...
...
worker/deps/libuv/src/win/fs.c
浏览文件 @
4cd365ec
...
@@ -403,7 +403,6 @@ void fs__open(uv_fs_t* req) {
...
@@ -403,7 +403,6 @@ void fs__open(uv_fs_t* req) {
switch
(
flags
&
(
_O_RDONLY
|
_O_WRONLY
|
_O_RDWR
))
{
switch
(
flags
&
(
_O_RDONLY
|
_O_WRONLY
|
_O_RDWR
))
{
case
_O_RDONLY
:
case
_O_RDONLY
:
access
=
FILE_GENERIC_READ
;
access
=
FILE_GENERIC_READ
;
attributes
|=
FILE_FLAG_BACKUP_SEMANTICS
;
break
;
break
;
case
_O_WRONLY
:
case
_O_WRONLY
:
access
=
FILE_GENERIC_WRITE
;
access
=
FILE_GENERIC_WRITE
;
...
@@ -418,7 +417,6 @@ void fs__open(uv_fs_t* req) {
...
@@ -418,7 +417,6 @@ void fs__open(uv_fs_t* req) {
if
(
flags
&
_O_APPEND
)
{
if
(
flags
&
_O_APPEND
)
{
access
&=
~
FILE_WRITE_DATA
;
access
&=
~
FILE_WRITE_DATA
;
access
|=
FILE_APPEND_DATA
;
access
|=
FILE_APPEND_DATA
;
attributes
&=
~
FILE_FLAG_BACKUP_SEMANTICS
;
}
}
/*
/*
...
...
worker/deps/libuv/src/win/getaddrinfo.c
浏览文件 @
4cd365ec
...
@@ -262,8 +262,7 @@ int uv_getaddrinfo(uv_loop_t* loop,
...
@@ -262,8 +262,7 @@ int uv_getaddrinfo(uv_loop_t* loop,
int
err
;
int
err
;
if
(
req
==
NULL
||
(
node
==
NULL
&&
service
==
NULL
))
{
if
(
req
==
NULL
||
(
node
==
NULL
&&
service
==
NULL
))
{
err
=
WSAEINVAL
;
return
UV_EINVAL
;
goto
error
;
}
}
uv_req_init
(
loop
,
(
uv_req_t
*
)
req
);
uv_req_init
(
loop
,
(
uv_req_t
*
)
req
);
...
...
worker/deps/libuv/src/win/process.c
浏览文件 @
4cd365ec
...
@@ -492,7 +492,7 @@ WCHAR* quote_cmd_arg(const WCHAR *source, WCHAR *target) {
...
@@ -492,7 +492,7 @@ WCHAR* quote_cmd_arg(const WCHAR *source, WCHAR *target) {
* input : hello\\"world
* input : hello\\"world
* output: "hello\\\\\"world"
* output: "hello\\\\\"world"
* input : hello world\
* input : hello world\
* output: "hello world\"
* output: "hello world\
\
"
*/
*/
*
(
target
++
)
=
L'"'
;
*
(
target
++
)
=
L'"'
;
...
...
worker/deps/libuv/src/win/tty.c
浏览文件 @
4cd365ec
...
@@ -56,7 +56,11 @@
...
@@ -56,7 +56,11 @@
#define ANSI_BACKSLASH_SEEN 0x80
#define ANSI_BACKSLASH_SEEN 0x80
#define MAX_INPUT_BUFFER_LENGTH 8192
#define MAX_INPUT_BUFFER_LENGTH 8192
#define MAX_CONSOLE_CHAR 8192
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
static
void
uv_tty_capture_initial_style
(
CONSOLE_SCREEN_BUFFER_INFO
*
info
);
static
void
uv_tty_capture_initial_style
(
CONSOLE_SCREEN_BUFFER_INFO
*
info
);
static
void
uv_tty_update_virtual_window
(
CONSOLE_SCREEN_BUFFER_INFO
*
info
);
static
void
uv_tty_update_virtual_window
(
CONSOLE_SCREEN_BUFFER_INFO
*
info
);
...
@@ -125,6 +129,14 @@ static char uv_tty_default_fg_bright = 0;
...
@@ -125,6 +129,14 @@ static char uv_tty_default_fg_bright = 0;
static
char
uv_tty_default_bg_bright
=
0
;
static
char
uv_tty_default_bg_bright
=
0
;
static
char
uv_tty_default_inverse
=
0
;
static
char
uv_tty_default_inverse
=
0
;
typedef
enum
{
UV_SUPPORTED
,
UV_UNCHECKED
,
UV_UNSUPPORTED
}
uv_vtermstate_t
;
/* Determine whether or not ANSI support is enabled. */
static
uv_vtermstate_t
uv__vterm_state
=
UV_UNCHECKED
;
static
void
uv__determine_vterm_state
(
HANDLE
handle
);
void
uv_console_init
()
{
void
uv_console_init
()
{
if
(
uv_sem_init
(
&
uv_tty_output_lock
,
1
))
if
(
uv_sem_init
(
&
uv_tty_output_lock
,
1
))
...
@@ -168,6 +180,9 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) {
...
@@ -168,6 +180,9 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) {
/* shared between all uv_tty_t handles. */
/* shared between all uv_tty_t handles. */
uv_sem_wait
(
&
uv_tty_output_lock
);
uv_sem_wait
(
&
uv_tty_output_lock
);
if
(
uv__vterm_state
==
UV_UNCHECKED
)
uv__determine_vterm_state
(
handle
);
/* Store the global tty output handle. This handle is used by TTY read */
/* Store the global tty output handle. This handle is used by TTY read */
/* streams to update the virtual window when a CONSOLE_BUFFER_SIZE_EVENT */
/* streams to update the virtual window when a CONSOLE_BUFFER_SIZE_EVENT */
/* is received. */
/* is received. */
...
@@ -989,6 +1004,9 @@ int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb,
...
@@ -989,6 +1004,9 @@ int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb,
if
(
handle
->
tty
.
rd
.
last_key_len
>
0
)
{
if
(
handle
->
tty
.
rd
.
last_key_len
>
0
)
{
SET_REQ_SUCCESS
(
&
handle
->
read_req
);
SET_REQ_SUCCESS
(
&
handle
->
read_req
);
uv_insert_pending_req
(
handle
->
loop
,
(
uv_req_t
*
)
&
handle
->
read_req
);
uv_insert_pending_req
(
handle
->
loop
,
(
uv_req_t
*
)
&
handle
->
read_req
);
/* Make sure no attempt is made to insert it again until it's handled. */
handle
->
flags
|=
UV_HANDLE_READ_PENDING
;
handle
->
reqs_pending
++
;
return
0
;
return
0
;
}
}
...
@@ -1602,17 +1620,29 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
...
@@ -1602,17 +1620,29 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
DWORD
*
error
)
{
DWORD
*
error
)
{
/* We can only write 8k characters at a time. Windows can't handle */
/* We can only write 8k characters at a time. Windows can't handle */
/* much more characters in a single console write anyway. */
/* much more characters in a single console write anyway. */
WCHAR
utf16_buf
[
8192
];
WCHAR
utf16_buf
[
MAX_CONSOLE_CHAR
];
WCHAR
*
utf16_buffer
;
DWORD
utf16_buf_used
=
0
;
DWORD
utf16_buf_used
=
0
;
unsigned
int
i
;
unsigned
int
i
,
len
,
max_len
,
pos
;
int
allocate
=
0
;
#define FLUSH_TEXT() \
do { \
#define FLUSH_TEXT() \
if (utf16_buf_used > 0) { \
do { \
uv_tty_emit_text(handle, utf16_buf, utf16_buf_used, error); \
pos = 0; \
utf16_buf_used = 0; \
do { \
} \
len = utf16_buf_used - pos; \
} while (0)
if (len > MAX_CONSOLE_CHAR) \
len = MAX_CONSOLE_CHAR; \
uv_tty_emit_text(handle, &utf16_buffer[pos], len, error); \
pos += len; \
} while (pos < utf16_buf_used); \
if (allocate) { \
uv__free(utf16_buffer); \
allocate = 0; \
utf16_buffer = utf16_buf; \
} \
utf16_buf_used = 0; \
} while (0)
#define ENSURE_BUFFER_SPACE(wchars_needed) \
#define ENSURE_BUFFER_SPACE(wchars_needed) \
if (wchars_needed > ARRAY_SIZE(utf16_buf) - utf16_buf_used) { \
if (wchars_needed > ARRAY_SIZE(utf16_buf) - utf16_buf_used) { \
...
@@ -1630,12 +1660,48 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
...
@@ -1630,12 +1660,48 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
/* state. */
/* state. */
*
error
=
ERROR_SUCCESS
;
*
error
=
ERROR_SUCCESS
;
utf16_buffer
=
utf16_buf
;
uv_sem_wait
(
&
uv_tty_output_lock
);
uv_sem_wait
(
&
uv_tty_output_lock
);
for
(
i
=
0
;
i
<
nbufs
;
i
++
)
{
for
(
i
=
0
;
i
<
nbufs
;
i
++
)
{
uv_buf_t
buf
=
bufs
[
i
];
uv_buf_t
buf
=
bufs
[
i
];
unsigned
int
j
;
unsigned
int
j
;
if
(
uv__vterm_state
==
UV_SUPPORTED
&&
buf
.
len
>
0
)
{
utf16_buf_used
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
buf
.
base
,
buf
.
len
,
NULL
,
0
);
if
(
utf16_buf_used
==
0
)
{
*
error
=
GetLastError
();
break
;
}
max_len
=
(
utf16_buf_used
+
1
)
*
sizeof
(
WCHAR
);
allocate
=
max_len
>
MAX_CONSOLE_CHAR
;
if
(
allocate
)
utf16_buffer
=
uv__malloc
(
max_len
);
if
(
!
MultiByteToWideChar
(
CP_UTF8
,
0
,
buf
.
base
,
buf
.
len
,
utf16_buffer
,
utf16_buf_used
))
{
if
(
allocate
)
uv__free
(
utf16_buffer
);
*
error
=
GetLastError
();
break
;
}
FLUSH_TEXT
();
continue
;
}
for
(
j
=
0
;
j
<
buf
.
len
;
j
++
)
{
for
(
j
=
0
;
j
<
buf
.
len
;
j
++
)
{
unsigned
char
c
=
buf
.
base
[
j
];
unsigned
char
c
=
buf
.
base
[
j
];
...
@@ -2193,3 +2259,24 @@ int uv_tty_reset_mode(void) {
...
@@ -2193,3 +2259,24 @@ int uv_tty_reset_mode(void) {
/* Not necessary to do anything. */
/* Not necessary to do anything. */
return
0
;
return
0
;
}
}
/* Determine whether or not this version of windows supports
* proper ANSI color codes. Should be supported as of windows
* 10 version 1511, build number 10.0.10586.
*/
static
void
uv__determine_vterm_state
(
HANDLE
handle
)
{
DWORD
dwMode
=
0
;
if
(
!
GetConsoleMode
(
handle
,
&
dwMode
))
{
uv__vterm_state
=
UV_UNSUPPORTED
;
return
;
}
dwMode
|=
ENABLE_VIRTUAL_TERMINAL_PROCESSING
;
if
(
!
SetConsoleMode
(
handle
,
dwMode
))
{
uv__vterm_state
=
UV_UNSUPPORTED
;
return
;
}
uv__vterm_state
=
UV_SUPPORTED
;
}
worker/deps/libuv/test/test-error.c
浏览文件 @
4cd365ec
...
@@ -53,6 +53,7 @@ TEST_IMPL(error_message) {
...
@@ -53,6 +53,7 @@ TEST_IMPL(error_message) {
TEST_IMPL
(
sys_error
)
{
TEST_IMPL
(
sys_error
)
{
#if defined(_WIN32)
#if defined(_WIN32)
ASSERT
(
uv_translate_sys_error
(
ERROR_NOACCESS
)
==
UV_EACCES
);
ASSERT
(
uv_translate_sys_error
(
ERROR_NOACCESS
)
==
UV_EACCES
);
ASSERT
(
uv_translate_sys_error
(
ERROR_ELEVATION_REQUIRED
)
==
UV_EACCES
);
ASSERT
(
uv_translate_sys_error
(
WSAEADDRINUSE
)
==
UV_EADDRINUSE
);
ASSERT
(
uv_translate_sys_error
(
WSAEADDRINUSE
)
==
UV_EADDRINUSE
);
ASSERT
(
uv_translate_sys_error
(
ERROR_BAD_PIPE
)
==
UV_EPIPE
);
ASSERT
(
uv_translate_sys_error
(
ERROR_BAD_PIPE
)
==
UV_EPIPE
);
#else
#else
...
...
worker/deps/libuv/test/test-fs.c
浏览文件 @
4cd365ec
...
@@ -1141,11 +1141,15 @@ TEST_IMPL(fs_fstat) {
...
@@ -1141,11 +1141,15 @@ TEST_IMPL(fs_fstat) {
ASSERT
(
s
->
st_mtim
.
tv_nsec
==
t
.
st_mtimensec
);
ASSERT
(
s
->
st_mtim
.
tv_nsec
==
t
.
st_mtimensec
);
ASSERT
(
s
->
st_ctim
.
tv_sec
==
t
.
st_ctime
);
ASSERT
(
s
->
st_ctim
.
tv_sec
==
t
.
st_ctime
);
ASSERT
(
s
->
st_ctim
.
tv_nsec
==
t
.
st_ctimensec
);
ASSERT
(
s
->
st_ctim
.
tv_nsec
==
t
.
st_ctimensec
);
#elif defined(__sun) || \
#elif defined(__sun) || \
defined(_GNU_SOURCE) || \
defined(__DragonFly__) || \
defined(_BSD_SOURCE) || \
defined(__FreeBSD__) || \
defined(_SVID_SOURCE) || \
defined(__OpenBSD__) || \
defined(_XOPEN_SOURCE) || \
defined(__NetBSD__) || \
defined(_GNU_SOURCE) || \
defined(_BSD_SOURCE) || \
defined(_SVID_SOURCE) || \
defined(_XOPEN_SOURCE) || \
defined(_DEFAULT_SOURCE)
defined(_DEFAULT_SOURCE)
ASSERT
(
s
->
st_atim
.
tv_sec
==
t
.
st_atim
.
tv_sec
);
ASSERT
(
s
->
st_atim
.
tv_sec
==
t
.
st_atim
.
tv_sec
);
ASSERT
(
s
->
st_atim
.
tv_nsec
==
t
.
st_atim
.
tv_nsec
);
ASSERT
(
s
->
st_atim
.
tv_nsec
==
t
.
st_atim
.
tv_nsec
);
...
@@ -1153,10 +1157,8 @@ TEST_IMPL(fs_fstat) {
...
@@ -1153,10 +1157,8 @@ TEST_IMPL(fs_fstat) {
ASSERT
(
s
->
st_mtim
.
tv_nsec
==
t
.
st_mtim
.
tv_nsec
);
ASSERT
(
s
->
st_mtim
.
tv_nsec
==
t
.
st_mtim
.
tv_nsec
);
ASSERT
(
s
->
st_ctim
.
tv_sec
==
t
.
st_ctim
.
tv_sec
);
ASSERT
(
s
->
st_ctim
.
tv_sec
==
t
.
st_ctim
.
tv_sec
);
ASSERT
(
s
->
st_ctim
.
tv_nsec
==
t
.
st_ctim
.
tv_nsec
);
ASSERT
(
s
->
st_ctim
.
tv_nsec
==
t
.
st_ctim
.
tv_nsec
);
# if defined(__DragonFly__) || \
# if defined(__FreeBSD__) || \
defined(__FreeBSD__) || \
defined(__NetBSD__)
defined(__OpenBSD__) || \
defined(__NetBSD__)
ASSERT
(
s
->
st_birthtim
.
tv_sec
==
t
.
st_birthtim
.
tv_sec
);
ASSERT
(
s
->
st_birthtim
.
tv_sec
==
t
.
st_birthtim
.
tv_sec
);
ASSERT
(
s
->
st_birthtim
.
tv_nsec
==
t
.
st_birthtim
.
tv_nsec
);
ASSERT
(
s
->
st_birthtim
.
tv_nsec
==
t
.
st_birthtim
.
tv_nsec
);
ASSERT
(
s
->
st_flags
==
t
.
st_flags
);
ASSERT
(
s
->
st_flags
==
t
.
st_flags
);
...
...
worker/deps/libuv/test/test-getaddrinfo.c
浏览文件 @
4cd365ec
...
@@ -83,6 +83,13 @@ static void getaddrinfo_cuncurrent_cb(uv_getaddrinfo_t* handle,
...
@@ -83,6 +83,13 @@ static void getaddrinfo_cuncurrent_cb(uv_getaddrinfo_t* handle,
TEST_IMPL
(
getaddrinfo_fail
)
{
TEST_IMPL
(
getaddrinfo_fail
)
{
uv_getaddrinfo_t
req
;
uv_getaddrinfo_t
req
;
ASSERT
(
UV_EINVAL
==
uv_getaddrinfo
(
uv_default_loop
(),
&
req
,
(
uv_getaddrinfo_cb
)
abort
,
NULL
,
NULL
,
NULL
));
/* Use a FQDN by ending in a period */
/* Use a FQDN by ending in a period */
ASSERT
(
0
==
uv_getaddrinfo
(
uv_default_loop
(),
ASSERT
(
0
==
uv_getaddrinfo
(
uv_default_loop
(),
&
req
,
&
req
,
...
...
worker/deps/libuv/test/test-list.h
浏览文件 @
4cd365ec
...
@@ -47,6 +47,8 @@ TEST_DECLARE (semaphore_3)
...
@@ -47,6 +47,8 @@ TEST_DECLARE (semaphore_3)
TEST_DECLARE
(
tty
)
TEST_DECLARE
(
tty
)
#ifdef _WIN32
#ifdef _WIN32
TEST_DECLARE
(
tty_raw
)
TEST_DECLARE
(
tty_raw
)
TEST_DECLARE
(
tty_empty_write
)
TEST_DECLARE
(
tty_large_write
)
#endif
#endif
TEST_DECLARE
(
tty_file
)
TEST_DECLARE
(
tty_file
)
TEST_DECLARE
(
tty_pty
)
TEST_DECLARE
(
tty_pty
)
...
@@ -404,6 +406,8 @@ TASK_LIST_START
...
@@ -404,6 +406,8 @@ TASK_LIST_START
TEST_ENTRY
(
tty
)
TEST_ENTRY
(
tty
)
#ifdef _WIN32
#ifdef _WIN32
TEST_ENTRY
(
tty_raw
)
TEST_ENTRY
(
tty_raw
)
TEST_ENTRY
(
tty_empty_write
)
TEST_ENTRY
(
tty_large_write
)
#endif
#endif
TEST_ENTRY
(
tty_file
)
TEST_ENTRY
(
tty_file
)
TEST_ENTRY
(
tty_pty
)
TEST_ENTRY
(
tty_pty
)
...
...
worker/deps/libuv/test/test-tty.c
浏览文件 @
4cd365ec
...
@@ -212,6 +212,93 @@ TEST_IMPL(tty_raw) {
...
@@ -212,6 +212,93 @@ TEST_IMPL(tty_raw) {
MAKE_VALGRIND_HAPPY
();
MAKE_VALGRIND_HAPPY
();
return
0
;
return
0
;
}
}
TEST_IMPL
(
tty_empty_write
)
{
int
r
;
int
ttyout_fd
;
uv_tty_t
tty_out
;
char
dummy
[
1
];
uv_buf_t
bufs
[
1
];
uv_loop_t
*
loop
;
/* Make sure we have an FD that refers to a tty */
HANDLE
handle
;
loop
=
uv_default_loop
();
handle
=
CreateFileA
(
"conout$"
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ASSERT
(
handle
!=
INVALID_HANDLE_VALUE
);
ttyout_fd
=
_open_osfhandle
((
intptr_t
)
handle
,
0
);
ASSERT
(
ttyout_fd
>=
0
);
ASSERT
(
UV_TTY
==
uv_guess_handle
(
ttyout_fd
));
r
=
uv_tty_init
(
uv_default_loop
(),
&
tty_out
,
ttyout_fd
,
0
);
/* Writable. */
ASSERT
(
r
==
0
);
bufs
[
0
].
len
=
0
;
bufs
[
0
].
base
=
&
dummy
;
r
=
uv_try_write
((
uv_stream_t
*
)
&
tty_out
,
bufs
,
1
);
ASSERT
(
r
==
0
);
uv_close
((
uv_handle_t
*
)
&
tty_out
,
NULL
);
uv_run
(
loop
,
UV_RUN_DEFAULT
);
MAKE_VALGRIND_HAPPY
();
return
0
;
}
TEST_IMPL
(
tty_large_write
)
{
int
r
;
int
ttyout_fd
;
uv_tty_t
tty_out
;
char
dummy
[
10000
];
uv_buf_t
bufs
[
1
];
uv_loop_t
*
loop
;
/* Make sure we have an FD that refers to a tty */
HANDLE
handle
;
loop
=
uv_default_loop
();
handle
=
CreateFileA
(
"conout$"
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ASSERT
(
handle
!=
INVALID_HANDLE_VALUE
);
ttyout_fd
=
_open_osfhandle
((
intptr_t
)
handle
,
0
);
ASSERT
(
ttyout_fd
>=
0
);
ASSERT
(
UV_TTY
==
uv_guess_handle
(
ttyout_fd
));
r
=
uv_tty_init
(
uv_default_loop
(),
&
tty_out
,
ttyout_fd
,
0
);
/* Writable. */
ASSERT
(
r
==
0
);
bufs
[
0
]
=
uv_buf_init
(
dummy
,
sizeof
(
dummy
));
r
=
uv_try_write
((
uv_stream_t
*
)
&
tty_out
,
bufs
,
1
);
ASSERT
(
r
==
10000
);
uv_close
((
uv_handle_t
*
)
&
tty_out
,
NULL
);
uv_run
(
loop
,
UV_RUN_DEFAULT
);
MAKE_VALGRIND_HAPPY
();
return
0
;
}
#endif
#endif
...
...
worker/scripts/get_dep.sh
浏览文件 @
4cd365ec
...
@@ -95,7 +95,7 @@ function get_netstring()
...
@@ -95,7 +95,7 @@ function get_netstring()
function
get_libuv
()
function
get_libuv
()
{
{
GIT_REPO
=
"https://github.com/libuv/libuv.git"
GIT_REPO
=
"https://github.com/libuv/libuv.git"
GIT_TAG
=
"v1.10.
1
"
GIT_TAG
=
"v1.10.
2
"
DEST
=
"deps/libuv"
DEST
=
"deps/libuv"
if
[
-d
"
${
DEST
}
"
]
;
then
if
[
-d
"
${
DEST
}
"
]
;
then
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论