Staging
v0.5.1
Revision 123f6c4914827c4ced65d032fab74de62db31cd6 authored by Miss Islington (bot) on 14 August 2019, 21:47:43 UTC, committed by GitHub on 14 August 2019, 21:47:43 UTC

FreeBSD implementation of poll(2) restricts the timeout argument to be
either zero, or positive, or equal to INFTIM (-1).

Unless otherwise overridden, socket timeout defaults to -1. This value
is then converted to milliseconds (-1000) and used as argument to the
poll syscall. poll returns EINVAL (22), and the connection fails.

This bug was discovered during the EINTR handling testing, and the
reproduction code can be found in
https://bugs.python.org/issue23618 (see connect_eintr.py,
attached). On GNU/Linux, the example runs as expected.

This change is trivial:
If the supplied timeout value is negative, truncate it to -1.
(cherry picked from commit 28146206578ebe1b84b48e6f255738a227058c04)

Co-authored-by: Artem Khramov <akhramov@pm.me>
1 parent 557802d
History
File Mode Size
windows-release
ci.yml -rw-r--r-- 3.2 KB
docs-steps.yml -rw-r--r-- 1.3 KB
macos-steps.yml -rw-r--r-- 724 bytes
posix-deps-apt.sh -rwxr-xr-x 580 bytes
posix-steps.yml -rw-r--r-- 2.5 KB
pr.yml -rw-r--r-- 3.1 KB
prebuild-checks.yml -rw-r--r-- 1.2 KB
windows-layout-steps.yml -rw-r--r-- 1.5 KB
windows-release.yml -rw-r--r-- 3.9 KB
windows-steps.yml -rw-r--r-- 1.3 KB

back to top