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
3d150daa
Commit
3d150daa
authored
Nov 02, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8
parent
fb316be9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
gevent/evbuffer.pxi
gevent/evbuffer.pxi
+5
-6
gevent/evdns.pxi
gevent/evdns.pxi
+0
-1
gevent/evhttp.pxi
gevent/evhttp.pxi
+3
-2
No files found.
gevent/evbuffer.pxi
View file @
3d150daa
...
...
@@ -2,7 +2,7 @@ __all__ += ['buffer']
cdef
extern
from
"string.h"
:
void
*
memchr
(
void
*
s
,
int
c
,
size_t
n
)
cdef
extern
from
"libevent.h"
:
struct
evbuffer
:
char
*
buf
"buffer"
...
...
@@ -41,7 +41,7 @@ cdef class buffer:
def
__nonzero__
(
self
):
if
self
.
__obj
:
return
evbuffer_get_length
(
self
.
__obj
)
def
detach
(
self
):
self
.
__obj
=
NULL
...
...
@@ -88,11 +88,11 @@ cdef class buffer:
return
''
cdef
long
length
=
evbuffer_get_length
(
self
.
__obj
)
cdef
char
*
nl
=
<
char
*>
memchr
(
<
void
*>
data
,
10
,
length
)
# search for "\n"
cdef
char
*
nl
=
<
char
*>
memchr
(
<
void
*>
data
,
10
,
length
)
# search for "\n"
if
nl
:
length
=
nl
-
data
+
1
cdef
object
result
=
PyString_FromStringAndSize
(
data
,
length
)
cdef
int
res
=
EVBUFFER_DRAIN
(
self
.
__obj
,
length
)
if
res
:
...
...
@@ -104,4 +104,3 @@ cdef class buffer:
def
readlines
(
self
,
hint
=-
1
):
return
list
(
self
)
gevent/evdns.pxi
View file @
3d150daa
...
...
@@ -131,4 +131,3 @@ def dns_resolve_reverse_ipv6(char* packed_ip, int flags, object callback):
if
result
:
raise
IOError
(
'evdns_resolve_reverse_ipv6(%r, %r) returned %s'
%
(
packed_ip
,
flags
,
result
,
))
Py_INCREF
(
callback
)
gevent/evhttp.pxi
View file @
3d150daa
...
...
@@ -9,7 +9,7 @@ EVHTTP_REQ_HEAD = 2
EVHTTP_REQ_PUT
=
3
EVHTTP_REQ_DELETE
=
4
HTTP_method2name
=
{
0
:
'GET'
,
1
:
'POST'
,
2
:
'HEAD'
,
3
:
'PUT'
,
4
:
'DELETE'
}
HTTP_method2name
=
{
0
:
'GET'
,
1
:
'POST'
,
2
:
'HEAD'
,
3
:
'PUT'
,
4
:
'DELETE'
}
cdef
extern
from
*
:
ctypedef
char
*
const_char_ptr
"const char*"
...
...
@@ -96,9 +96,11 @@ cdef extern from "libevent.h":
class
ObjectDeleted
(
AttributeError
):
pass
class
HttpRequestDeleted
(
ObjectDeleted
):
"""Raised when an attribute is accessed of http_request instance whose _obj is 0"""
class
HttpConnectionDeleted
(
ObjectDeleted
):
"""Raised when an attribute is accessed of http_connection instance whose _obj is 0"""
...
...
@@ -553,4 +555,3 @@ cdef class http:
cdef
res
=
evhttp_accept_socket
(
self
.
__obj
,
fd
)
if
res
:
raise
RuntimeError
(
"evhttp_accept_socket(%r) returned %r"
%
(
fd
,
res
))
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