mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
asyncio, Tulip issue 204: Fix IocpProactor.accept_pipe()
Overlapped.ConnectNamedPipe() now returns a boolean: True if the pipe is connected (if ConnectNamedPipe() failed with ERROR_PIPE_CONNECTED), False if the connection is in progress. This change removes multiple hacks in IocpProactor.
This commit is contained in:
parent
34cd2ae69f
commit
2b77c5467f
2 changed files with 19 additions and 26 deletions
|
@ -1117,10 +1117,10 @@ Overlapped_ConnectNamedPipe(OverlappedObject *self, PyObject *args)
|
|||
switch (err) {
|
||||
case ERROR_PIPE_CONNECTED:
|
||||
mark_as_completed(&self->overlapped);
|
||||
Py_RETURN_NONE;
|
||||
Py_RETURN_TRUE;
|
||||
case ERROR_SUCCESS:
|
||||
case ERROR_IO_PENDING:
|
||||
Py_RETURN_NONE;
|
||||
Py_RETURN_FALSE;
|
||||
default:
|
||||
self->type = TYPE_NOT_STARTED;
|
||||
return SetFromWindowsErr(err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue