summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-26 21:30:49 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-26 21:30:49 (GMT)
commit41063d2a59a24e257cd9ce62137e36c862e3ab1e (patch)
tree65f8861d33e1cdd09058f464a5ad162a80bffc69 /Modules
parent24dfa3c1d6b21e731bd167a13153968bba8fa5ce (diff)
downloadcpython-41063d2a59a24e257cd9ce62137e36c862e3ab1e.zip
cpython-41063d2a59a24e257cd9ce62137e36c862e3ab1e.tar.gz
cpython-41063d2a59a24e257cd9ce62137e36c862e3ab1e.tar.bz2
asyncio, Tulip issue 204: Fix IocpProactor.recv()
If ReadFile() fails with ERROR_BROKEN_PIPE, the operation is not pending: don't register the overlapped. I don't know if WSARecv() can fail with ERROR_BROKEN_PIPE. Since Overlapped.WSARecv() already handled ERROR_BROKEN_PIPE, let me guess that it has the same behaviour than ReadFile().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/overlapped.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
index 4661152..1a081ec 100644
--- a/Modules/overlapped.c
+++ b/Modules/overlapped.c
@@ -730,7 +730,7 @@ Overlapped_ReadFile(OverlappedObject *self, PyObject *args)
switch (err) {
case ERROR_BROKEN_PIPE:
mark_as_completed(&self->overlapped);
- Py_RETURN_NONE;
+ return SetFromWindowsErr(err);
case ERROR_SUCCESS:
case ERROR_MORE_DATA:
case ERROR_IO_PENDING:
@@ -789,7 +789,7 @@ Overlapped_WSARecv(OverlappedObject *self, PyObject *args)
switch (err) {
case ERROR_BROKEN_PIPE:
mark_as_completed(&self->overlapped);
- Py_RETURN_NONE;
+ return SetFromWindowsErr(err);
case ERROR_SUCCESS:
case ERROR_MORE_DATA:
case ERROR_IO_PENDING: