Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c89c8a7b
Commit
c89c8a7b
authored
Feb 26, 2014
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asyncio/windows_events.py: use more revelant names to overlapped callbacks
For example: "finish_recv", not just "finish".
parent
98468982
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
Lib/asyncio/selector_events.py
Lib/asyncio/selector_events.py
+1
-2
Lib/asyncio/windows_events.py
Lib/asyncio/windows_events.py
+10
-10
No files found.
Lib/asyncio/selector_events.py
View file @
c89c8a7b
...
...
@@ -702,8 +702,7 @@ class _SelectorSslTransport(_SelectorTransport):
if
self
.
_buffer
:
try
:
n
=
self
.
_sock
.
send
(
self
.
_buffer
)
except
(
BlockingIOError
,
InterruptedError
,
ssl
.
SSLWantWriteError
):
except
(
BlockingIOError
,
InterruptedError
,
ssl
.
SSLWantWriteError
):
n
=
0
except
ssl
.
SSLWantReadError
:
n
=
0
...
...
Lib/asyncio/windows_events.py
View file @
c89c8a7b
...
...
@@ -213,7 +213,7 @@ class IocpProactor:
else
:
ov
.
ReadFile
(
conn
.
fileno
(),
nbytes
)
def
finish
(
trans
,
key
,
ov
):
def
finish
_recv
(
trans
,
key
,
ov
):
try
:
return
ov
.
getresult
()
except
OSError
as
exc
:
...
...
@@ -222,7 +222,7 @@ class IocpProactor:
else
:
raise
return
self
.
_register
(
ov
,
conn
,
finish
)
return
self
.
_register
(
ov
,
conn
,
finish
_recv
)
def
send
(
self
,
conn
,
buf
,
flags
=
0
):
self
.
_register_with_iocp
(
conn
)
...
...
@@ -232,7 +232,7 @@ class IocpProactor:
else
:
ov
.
WriteFile
(
conn
.
fileno
(),
buf
)
def
finish
(
trans
,
key
,
ov
):
def
finish
_send
(
trans
,
key
,
ov
):
try
:
return
ov
.
getresult
()
except
OSError
as
exc
:
...
...
@@ -241,7 +241,7 @@ class IocpProactor:
else
:
raise
return
self
.
_register
(
ov
,
conn
,
finish
)
return
self
.
_register
(
ov
,
conn
,
finish
_send
)
def
accept
(
self
,
listener
):
self
.
_register_with_iocp
(
listener
)
...
...
@@ -300,17 +300,17 @@ class IocpProactor:
ov
=
_overlapped
.
Overlapped
(
NULL
)
ov
.
ConnectNamedPipe
(
pipe
.
fileno
())
def
finish
(
trans
,
key
,
ov
):
def
finish
_accept_pipe
(
trans
,
key
,
ov
):
ov
.
getresult
()
return
pipe
return
self
.
_register
(
ov
,
pipe
,
finish
)
return
self
.
_register
(
ov
,
pipe
,
finish
_accept_pipe
)
def
connect_pipe
(
self
,
address
):
ov
=
_overlapped
.
Overlapped
(
NULL
)
ov
.
WaitNamedPipeAndConnect
(
address
,
self
.
_iocp
,
ov
.
address
)
def
finish
(
err
,
handle
,
ov
):
def
finish
_connect_pipe
(
err
,
handle
,
ov
):
# err, handle were arguments passed to PostQueuedCompletionStatus()
# in a function run in a thread pool.
if
err
==
_overlapped
.
ERROR_SEM_TIMEOUT
:
...
...
@@ -323,7 +323,7 @@ class IocpProactor:
else
:
return
windows_utils
.
PipeHandle
(
handle
)
return
self
.
_register
(
ov
,
None
,
finish
,
wait_for_post
=
True
)
return
self
.
_register
(
ov
,
None
,
finish
_connect_pipe
,
wait_for_post
=
True
)
def
wait_for_handle
(
self
,
handle
,
timeout
=
None
):
if
timeout
is
None
:
...
...
@@ -339,7 +339,7 @@ class IocpProactor:
handle
,
self
.
_iocp
,
ov
.
address
,
ms
)
f
=
_WaitHandleFuture
(
wh
,
loop
=
self
.
_loop
)
def
finish
(
trans
,
key
,
ov
):
def
finish
_wait_for_handle
(
trans
,
key
,
ov
):
if
not
f
.
cancelled
():
try
:
_overlapped
.
UnregisterWait
(
wh
)
...
...
@@ -355,7 +355,7 @@ class IocpProactor:
return
(
_winapi
.
WaitForSingleObject
(
handle
,
0
)
==
_winapi
.
WAIT_OBJECT_0
)
self
.
_cache
[
ov
.
address
]
=
(
f
,
ov
,
None
,
finish
)
self
.
_cache
[
ov
.
address
]
=
(
f
,
ov
,
None
,
finish
_wait_for_handle
)
return
f
def
_register_with_iocp
(
self
,
obj
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment