Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
0e536ba3
Commit
0e536ba3
authored
Apr 14, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test__fileobject.py under libuv.
parent
abab3e25
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
src/gevent/libuv/_corecffi_cdef.c
src/gevent/libuv/_corecffi_cdef.c
+1
-2
src/gevent/libuv/watcher.py
src/gevent/libuv/watcher.py
+18
-5
No files found.
src/gevent/libuv/_corecffi_cdef.c
View file @
0e536ba3
...
...
@@ -18,9 +18,8 @@ typedef enum {
enum
uv_poll_event
{
UV_READABLE
=
1
,
UV_WRITABLE
=
2
,
/* new in 1.9
/* new in 1.9 */
UV_DISCONNECT
=
4
*/
};
enum
uv_fs_event
{
...
...
src/gevent/libuv/watcher.py
View file @
0e536ba3
...
...
@@ -19,8 +19,11 @@ def _uv_close_callback(handle):
_closing_handles
.
remove
(
handle
)
def
_dbg
(
*
args
,
**
kwargs
):
# pylint:disable=unused-argument
pass
#_dbg = print
_events
=
[(
libuv
.
UV_READABLE
,
"READ"
),
(
libuv
.
UV_WRITABLE
,
"WRITE"
)]
...
...
@@ -124,7 +127,7 @@ class io(_base.IoMixin, watcher):
_watcher_type
=
'poll'
_watcher_callback_name
=
'_gevent_poll_callback2'
EVENT_MASK
=
libuv
.
UV_READABLE
|
libuv
.
UV_WRITABLE
EVENT_MASK
=
libuv
.
UV_READABLE
|
libuv
.
UV_WRITABLE
|
libuv
.
UV_DISCONNECT
_multiplex_watchers
=
None
...
...
@@ -212,14 +215,24 @@ class io(_base.IoMixin, watcher):
def
_io_callback
(
self
,
events
):
if
events
<
0
:
# actually a status error code
print
(
"Callback error"
,
ffi
.
string
(
libuv
.
uv_err_name
(
events
)),
ffi
.
string
(
libuv
.
uv_strerror
(
events
)))
return
_dbg
(
"Callback error on"
,
self
.
_fd
,
ffi
.
string
(
libuv
.
uv_err_name
(
events
)),
ffi
.
string
(
libuv
.
uv_strerror
(
events
)))
# XXX: We've seen one half of a FileObjectPosix pair
# (the read side of a pipe) report errno 11 'bad file descriptor'
# after the write side was closed and its watcher removed. But
# we still need to attempt to read from it to clear out what's in
# its buffers--if we return with the watcher inactive before proceeding to wake up
# the reader, we get a LoopExit. So we can't return here and arguably shouldn't print it
# either. The negative events mask will match the watcher's mask.
# See test__fileobject.py:Test.test_newlines for an example.
#return
for
watcher_ref
in
self
.
_multiplex_watchers
:
watcher
=
watcher_ref
()
if
not
watcher
or
not
watcher
.
callback
:
continue
if
events
&
watcher
.
events
:
if
not
watcher
.
pass_events
:
watcher
.
callback
(
*
watcher
.
args
)
...
...
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