Skip to content

Commit

Permalink
Bump to libuv 1.43.0
Browse files Browse the repository at this point in the history
Also added comment about why uvloop getaddrinfo() may behave differently
under special cases (IP + TCP/UDP).
  • Loading branch information
fantix committed Sep 13, 2022
1 parent d2deffe commit 94e5e53
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions uvloop/dns.pyx
Expand Up @@ -245,6 +245,29 @@ cdef __static_getaddrinfo_pyaddr(object host, object port,
except Exception:
return

# When the host is an IP while type is one of TCP or UDP, different libc
# implementations of getaddrinfo() behave differently:
# 1. When AI_CANONNAME is set:
# * glibc: returns ai_canonname
# * musl: returns ai_canonname
# * macOS: returns an empty string for ai_canonname
# 2. When AI_CANONNAME is NOT set:
# * glibc: returns an empty string for ai_canonname
# * musl: returns ai_canonname
# * macOS: returns an empty string for ai_canonname
# At the same time, libuv and CPython both uses libc directly, even though
# this different behavior is violating what is in the documentation.
#
# uvloop potentially should be a 100% drop-in replacement for asyncio,
# doing whatever asyncio does, especially when the libc implementations are
# also different in the same way. However, making our implementation to be
# consistent with libc/CPython would be complex and hard to maintain
# (including caching libc behaviors when flag is/not set), therefore we
# decided to simply normalize the behavior in uvloop for this very marginal
# case following the documentation, even though uvloop would behave
# differently to asyncio on macOS and musl platforms, when again the host
# is an IP and type is one of TCP or UDP.
# All other cases are still asyncio-compatible.
if flags & socket_AI_CANONNAME:
if isinstance(host, str):
canon_name = host
Expand Down
2 changes: 1 addition & 1 deletion vendor/libuv
Submodule libuv updated 60 files
+3 −4 .github/stale.yml
+49 −0 .github/workflows/CI.yml
+14 −5 .github/workflows/sanitizer.yml
+4 −0 .mailmap
+17 −0 AUTHORS
+49 −38 CMakeLists.txt
+90 −1 ChangeLog
+4 −6 Makefile.am
+1 −1 README.md
+1 −1 SUPPORTED_PLATFORMS.md
+1 −1 configure.ac
+1 −1 docs/src/guide/basics.rst
+2 −2 docs/src/index.rst
+5 −1 docs/src/misc.rst
+3 −0 include/uv.h
+2 −4 include/uv/unix.h
+1 −1 include/uv/version.h
+7 −0 include/uv/win.h
+7 −0 src/threadpool.c
+1 −3 src/unix/bsd-proctitle.c
+10 −6 src/unix/darwin.c
+1 −1 src/unix/dl.c
+79 −40 src/unix/fs.c
+2 −3 src/unix/kqueue.c
+96 −5 src/unix/linux-core.c
+5 −0 src/unix/os390-syscalls.c
+1 −0 src/unix/os390-syscalls.h
+54 −37 src/unix/process.c
+3 −7 src/unix/stream.c
+54 −8 src/unix/udp.c
+19 −0 src/uv-common.c
+3 −3 src/win/fs-event.c
+15 −3 src/win/fs.c
+0 −2 src/win/pipe.c
+3 −1 src/win/process.c
+2 −3 src/win/tcp.c
+13 −2 src/win/thread.c
+1 −1 src/win/udp.c
+4 −1 src/win/util.c
+10 −0 src/win/winapi.c
+7 −0 src/win/winapi.h
+0 −1 test/benchmark-list.h
+0 −340 test/dns-server.c
+1 −1 test/task.h
+0 −3 test/test-fs-copyfile.c
+48 −4 test/test-fs-event.c
+19 −19 test/test-fs-open-flags.c
+0 −3 test/test-fs-readdir.c
+1 −7 test/test-fs.c
+65 −0 test/test-ip-name.c
+3 −3 test/test-ip6-addr.c
+11 −3 test/test-list.h
+3 −0 test/test-ping-pong.c
+0 −3 test/test-pipe-connect-error.c
+34 −26 test/test-readable-on-eof.c
+1 −1 test/test-tcp-connect-timeout.c
+6 −0 test/test-thread-equal.c
+13 −3 test/test-tty-escape-sequence-processing.c
+1 −1 test/test-udp-connect.c
+200 −0 test/test-udp-connect6.c

0 comments on commit 94e5e53

Please sign in to comment.