| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(GH-8532) (GH-8586)
|
|
|
|
|
| |
(cherry picked from commit 9045199c5aaeac9b52537581be127d999b5944ee)
Co-authored-by: twisteroid ambassador <twisteroidambassador@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit d904c238ca3551750cb97d15d827c3e525970867)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
| |
Supersedes https://github.com/python/cpython/pull/2490
(cherry picked from commit 12f482e0ae33021c04264294f33fa6baa9617cec)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
|
|
|
| |
_feed_data_to_bufferred_proto() renamed to
_feed_data_to_buffered_proto() ("bufferred" => "buffered").
Typo spotted by Nathaniel J. Smith.
(cherry picked from commit ff6c07729211fb98431a2793e074d07a21e0650a)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
| |
(cherry picked from commit 8f4042964d5b0ddf5cdf87862db962ba64e3f64a)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The cancellation of an overlapped WSARecv() has a race condition
which causes data loss because of the current implementation of
proactor in asyncio.
No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport
to work around the race condition.
Remove the optimized recv_into() implementation to get simple
implementation of pause_reading() using the single _pending_data
attribute.
Move _feed_data_to_bufferred_proto() to protocols.py.
Remove set_protocol() method which became useless.
(cherry picked from commit 79790bc35fe722a49977b52647f9b5fe1deda2b7)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
|
|
|
| |
(GH-7428)
In addition to that, mark SSLTransport as "closed" in its "abort()" method to prevent bogus warnings.
(cherry picked from commit 415bc46a78e785f357c8960ae70f18a6b6cccbb6)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
|
|
|
|
| |
* Fix AttributeError (not all SSL exceptions have 'errno' attribute)
* Increase default handshake timeout from 10 to 60 seconds
* Make sure start_tls can be cancelled correctly
* Make sure any error in SSLProtocol gets propagated (instead of just being logged)
(cherry picked from commit 9602643120a509858d0bee4215d7f150e6125468)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
| |
(GH-7233)
This reverts commit 2a7eb0b531656f4a77d85078e6e009e4b3639ef9.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, asyncio.wait_for(fut), upon reaching the timeout deadline,
cancels the future and returns immediately. This is problematic for
when *fut* is a Task, because it will be left running for an arbitrary
amount of time. This behavior is iself surprising and may lead to
related bugs such as the one described in bpo-33638:
condition = asyncio.Condition()
async with condition:
await asyncio.wait_for(condition.wait(), timeout=0.5)
Currently, instead of raising a TimeoutError, the above code will fail
with `RuntimeError: cannot wait on un-acquired lock`, because
`__aexit__` is reached _before_ `condition.wait()` finishes its
cancellation and re-acquires the condition lock.
To resolve this, make `wait_for` await for the task cancellation.
The tradeoff here is that the `timeout` promise may be broken if the
task decides to handle its cancellation in a slow way. This represents
a behavior change and should probably not be back-patched to 3.6 and
earlier.
(cherry picked from commit e2b340ab4196e1beb902327f503574b5d7369185)
Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
|
|
|
|
|
|
|
| |
(GH-7209) (#7222)
(cherry picked from commit 863b6749093a86810c4077112a857363410cc221)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
| |
Original patch by Dan O'Reilly.
(cherry picked from commit 5d97b7bcc19496617bf8c448d2f149cc28c73bc7)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
|
|
|
|
| |
Use transport.set_write_buffer_limits() in sendfile tests of
test_asyncio to make sure that the protocol is paused after sending
4 KiB. Previously,
test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed
on FreeBSD if the DATA was smaller than the default limit of 64 KiB.
(cherry picked from commit 9551f7719213243fd96c4f284079243773c26b3c)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
|
|
| |
(GH-7194)
(cherry picked from commit 2179022d94937d7b0600b0dc192ca6fa5f53d830)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
| |
(cherry picked from commit f295587c45f96b62d24f9a12cef6931b0805f596)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
|
|
|
| |
Fix a race condition in SSLProtocol.connection_made() of
asyncio.sslproto: start immediately the handshake instead of using
call_soon(). Previously, data_received() could be called before the
handshake started, causing the handshake to hang or fail.
(cherry picked from commit be00a5583a2cb696335c527b921d1868266a42c6)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
| |
(cherry picked from commit 7165754b6b5f3b7c07050d921fa1c58bba5f0ff1)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
| |
(cherry picked from commit 416c1ebd9896b394790dcb4f9f035b1a44ebe9ff)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
| |
(cherry picked from commit fdccfe09f0b10776645fdb04a0783d6864c32b21)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
|
| |
(GH-7173)
(cherry picked from commit 989b9e0e6d7dd2fa911f9bfd4744e7f3a82d6006)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this commit:
* Support BufferedProtocol in set_protocol() and start_tls()
* Fix proactor to cancel readers reliably
* Update tests to be compatible with OpenSSL 1.1.1
* Clarify BufferedProtocol docs
* Bump TLS tests timeouts to 60 seconds; eliminate possible race from start_serving
* Rewrite test_start_tls_server_1
(cherry picked from commit dbf102271fcc316f353c7e0a283811b661d128f2)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
|
| |
(GH-6836) (#7162)
(cherry picked from commit e549c4be5fb010f5faf12236af8faa720a1429be)
Co-authored-by: jimmylai <albert_chs@yahoo.com.tw>
|
|
|
|
|
|
|
|
|
| |
(GH-7149) (GH-7153)
Fixed bug where calling write_eof() on a _SelectorSocketTransport after
it's already closed raises AttributeError.
(cherry picked from commit 23f587e395e41bd5e116312b036183f42bc4159b)
Co-authored-by: twisteroid ambassador <twisteroidambassador@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-33263 Fix FD leak in _SelectorSocketTransport. (GH-6450)
Under particular circumstances _SelectorSocketTransport can try to add a reader
even the transport is already being closed. This can lead to FD leak and
invalid stated of the following connections. Fixed the SelectorSocketTransport
to add the reader only if the trasport is still active.
(cherry picked from commit a84d0b361a26c05c6fadc6640591ec3feee5bfb5)
Co-authored-by: Vlad Starostin <drtyrsa@yandex.ru>
|
|
|
|
|
|
| |
Fix typo from commit 6370f345e1d5829e1fba59cd695c8b82c5a8c620
(cherry picked from commit d361e99868a9eaa7ffce9341e1207705dbb66b50)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the following bugs in the C implementation:
* get_future_loop() silenced all exceptions raised when look up the get_loop
attribute, not just an AttributeError.
* enter_task() silenced all exceptions raised when look up the current task,
not just a KeyError.
* repr() was called for a borrowed link in enter_task() and task_step_impl().
* str() was used instead of repr() in formatting one error message (in
Python implementation too).
* There where few reference leaks in error cases.
(cherry picked from commit 6655354afcd116c27486bb5ba1dfa50b369d8d85)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The proactor event loop has a race condition when reading with
pausing/resuming. `resume_reading()` unconditionally schedules the read
function to read from the current future. If `resume_reading()` was
called before the previously scheduled done callback fires, this results
in two attempts to get the data from the most recent read and an
assertion failure. This commit tracks whether or not `resume_reading`
needs to reschedule the callback to restart the loop, preventing a
second attempt to read the data.
(cherry picked from commit 4151061855b571bf8a7579daa7875b8e243057b9)
Co-authored-by: CtrlZvi <viz+github@flippedperspective.com>
|
|
|
|
|
| |
Most of them have been added in 3.7.
(cherry picked from commit bac2d5ba30339298db7d4caa9c8cd31d807cf081)
|
|
|
|
|
|
| |
* Also in docs
(cherry picked from commit 65a34709f60711f7c46031d4c6c420f567bc790a)
Co-authored-by: Sam Dunster <me@sdunster.com>
|
|
|
|
|
|
|
|
| |
(GH-6057)
* Skip write()/data_received() if sslpipe is destroyed
(cherry picked from commit 5e80a71ab67045fecec46573a1892e240b569ace)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
|
|
|
|
|
| |
* Support sendfile on Windows Proactor event loop naively.
(cherry picked from commit a19fb3c6aaa7632410d1d9dcb395d7101d124da4)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 5746510b7aef423fa4afc92b2abb919307b1dbb9)
Co-authored-by: Bar Harel <bzvi7919@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 2f79c014931cbb23b08a7d16c534a3cc9607ae14)
Co-authored-by: Bar Harel <bzvi7919@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 3d4dbd8f019c0bbac99fc9248077044ff1039ca3)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
| |
|
| |
|
|
|
|
| |
I've run some tests on 3.7 asyncio and it appears that too many
things assume that run_in_executor returns a Future.
|
|
|
|
| |
On mac, sendfile throws ENOTCONN on a repeated sendfile call if
the connection is closed. Normalize it to behave like other systems.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bpo-31399: Let OpenSSL verify hostname and IP
The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and
X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses.
* Remove match_hostname calls
* Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host()
* Add documentation for OpenSSL 1.0.2 requirement
* Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform.
* Add hostname_checks_common_name
Signed-off-by: Christian Heimes <christian@python.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-32662: Implement Server.start_serving() and Server.serve_forever()
New methods:
* Server.start_serving(),
* Server.serve_forever(), and
* Server.is_serving().
Add 'start_serving' keyword parameter to loop.create_server() and
loop.create_unix_server().
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Specifically, it's not possible to subclass Task/Future classes
and override the following methods:
* Future._schedule_callbacks
* Task._step
* Task._wakeup
|
| |
|
| |
|
|
|
|
|
|
| |
* Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth
* Use coroutine origin information in the unawaited coroutine warning
* Stop using set_coroutine_wrapper in asyncio debug mode
* In BaseEventLoop.set_debug, enable debugging in the correct thread
|