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:
Victor Stinner 2015-01-22 23:50:03 +01:00
parent 34cd2ae69f
commit 2b77c5467f
2 changed files with 19 additions and 26 deletions

View file

@ -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);