| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
|
| | |
| |
| |
| |
| | |
Do nothing if the transport is already closed. Before it was not possible to
close the transport twice.
|
| | |
| |
| |
| | |
Skip SSL tests on the ProactorEventLoop if ssl.MemoryIO is missing
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
before setting its exception.
Add unit tests for this case.
|
| | |
| |
| |
| |
| |
| | |
cancelled waiter.
Add unit test cancelling subprocess methods.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The new SSL implementation is based on the new ssl.MemoryBIO which is only
available on Python 3.5. On Python 3.4 and older, the legacy SSL implementation
(using SSL_write, SSL_read, etc.) is used. The proactor event loop only
supports the new implementation.
The new asyncio.sslproto module adds _SSLPipe, SSLProtocol and
_SSLProtocolTransport classes. _SSLPipe allows to "wrap" or "unwrap" a socket
(switch between cleartext and SSL/TLS).
Patch written by Antoine Pitrou. sslproto.py is based on gruvi/ssl.py of the
gruvi project written by Geert Jansen.
This change adds SSL support to ProactorEventLoop on Python 3.5 and newer!
It becomes also possible to implement STARTTTLS: switch a cleartext socket to
SSL.
|
| | |
| |
| |
| | |
Pass explicitly the event loop to StreamReaderProtocol.
|
| | |
| |
| |
| |
| |
| | |
RuntimeError if the selector is closed. And selectors.BaseSelector.close() now
clears its internal reference to the selector mapping to break a reference
cycle. Initial patch written by Martin Richard.
|
| | |
| |
| |
| |
| |
| |
| | |
loop parameter is not set
Add unit tests to ensure that constructor of StreamReader and
StreamReaderProtocol classes get the event loop.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Python 3.3
* Use time.time if time.monotonic is not available
* Get socketpair from asyncio.test_utils
* Get selectors from asyncio.selectors
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
future before setting its result.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
methods of BaseEventLoop now use the identifier of the current thread to ensure
that they are called from the thread running the event loop.
Before, the get_event_loop() method was used to check the thread, and no
exception was raised when the thread had no event loop. Now the methods always
raise an exception in debug mode when called from the wrong thread. It should
help to notice misusage of the API.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
module to run the asyncio test suite. The test module is rarely installed.
|
| | |
| |
| |
| | |
no event loop even if assertions are disabled.
|
| | |
|
| |
|
|
| |
finished
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* _check_resolved_address() is implemented with getaddrinfo() which is slow
* If available, use socket.inet_pton() instead of socket.getaddrinfo(), because
it is much faster
Microbenchmark (timeit) on Fedora 21 (Python 3.4, Linux 3.17, glibc 2.20) to
validate the IPV4 address "127.0.0.1" or the IPv6 address "::1":
* getaddrinfo() 10.4 usec per loop
* inet_pton(): 0.285 usec per loop
On glibc older than 2.14, getaddrinfo() always requests the list of all local
IP addresses to the kernel (using a NETLINK socket). getaddrinfo() has other
known issues, it's better to avoid it when it is possible.
|
| |
|
|
|
|
|
| |
transport was closed. The check broken a Tulip example and this limitation is
arbitrary. Check if _proc is None should be enough.
Enhance also close(): do nothing when called the second time.
|
| | |
|
| |
|
|
|
| |
BaseSubprocessTransport now check if the transport was closed and if the
process exited.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes on BaseSubprocessTransport:
* Add a wait() method to wait until the child process exit
* The constructor now accepts an optional waiter parameter. The _post_init()
coroutine must not be called explicitly anymore. It makes subprocess
transports closer to other transports, and it gives more freedom if we want
later to change completly how subprocess transports are created.
* close() now kills the process instead of kindly terminate it: the child
process may ignore SIGTERM and continue to run. Call explicitly terminate()
and wait() if you want to kindly terminate the child process.
* close() now logs a warning in debug mode if the process is still running and
needs to be killed
* _make_subprocess_transport() is now fully asynchronous again: if the creation
of the transport failed, wait asynchronously for the process eixt. Before the
wait was synchronous. This change requires close() to *kill*, and not
terminate, the child process.
* Remove the _kill_wait() method, replaced with a more agressive close()
method. It fixes _make_subprocess_transport() on error.
BaseSubprocessTransport.close() calls the close() method of pipe transports,
whereas _kill_wait() closed directly pipes of the subprocess.Popen object
without unregistering file descriptors from the selector (which caused severe
bugs).
These changes simplifies the code of subprocess.py.
|
| |
|
|
| |
event loop or a transport is not explicitly closed
|
| | |
|
| |
|
|
|
| |
* Close the transport on error
* In debug mode, log errors using call_exception_handler()
|
| |
|
|
| |
Only start reading when connection_made() has been called.
|
| |
|
|
|
|
|
|
| |
Don't call protocol.connection_lost() if protocol.connection_made() was not
called yet: if the SSL handshake failed or is still in progress.
The close() method can be called if the creation of the connection is
cancelled, by a timeout for example.
|
| |
|
|
|
| |
Only start reading when connection_made() has been called:
protocol.data_received() must not be called before protocol.connection_made().
|
| |
|
|
| |
Wake-up the waiter if it is not done yet.
|
| | |
|
| |
|
|
|
|
|
| |
Use a coroutine with asyncio.sleep() instead of call_later() to ensure that the
schedule call is cancelled.
Add also a unit test cancelling connect_pipe().
|
|
|
In debug mode, BaseEventLoop._run_once() now sets the
BaseEventLoop._current_handle attribute to the handle currently executed.
In release mode or when no handle is executed, the attribute is None.
BaseEventLoop.default_exception_handler() displays the traceback of the current
handle if available.
|