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
f72fc774
Commit
f72fc774
authored
Mar 31, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: detach input_buffer and output_buffer when http_request is detached
parent
37376cd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
gevent/evhttp.pxi
gevent/evhttp.pxi
+14
-2
No files found.
gevent/evhttp.pxi
View file @
f72fc774
...
...
@@ -110,6 +110,8 @@ cdef class http_request:
# prefer gevent.http and gevent.wsgi which should be safe
cdef
evhttp_request
*
__obj
cdef
object
_input_buffer
cdef
object
_output_buffer
def
__init__
(
self
,
size_t
_obj
):
self
.
__obj
=
<
evhttp_request
*>
_obj
...
...
@@ -127,6 +129,10 @@ cdef class http_request:
def
detach
(
self
):
self
.
__obj
=
NULL
if
self
.
_input_buffer
is
not
None
:
self
.
_input_buffer
.
detach
()
if
self
.
_output_buffer
is
not
None
:
self
.
_output_buffer
.
detach
()
def
_format
(
self
):
args
=
(
self
.
typestr
,
self
.
uri
,
self
.
major
,
self
.
minor
,
...
...
@@ -279,16 +285,22 @@ cdef class http_request:
property
input_buffer
:
def
__get__
(
self
):
if
self
.
_input_buffer
is
not
None
:
return
self
.
_input_buffer
if
not
self
.
__obj
:
raise
HttpRequestDeleted
return
buffer
(
<
size_t
>
self
.
__obj
.
input_buffer
)
self
.
_input_buffer
=
buffer
(
<
size_t
>
self
.
__obj
.
input_buffer
)
return
self
.
_input_buffer
property
output_buffer
:
def
__get__
(
self
):
if
self
.
_output_buffer
is
not
None
:
return
self
.
_output_buffer
if
not
self
.
__obj
:
raise
HttpRequestDeleted
return
buffer
(
<
size_t
>
self
.
__obj
.
output_buffer
)
self
.
_output_buffer
=
buffer
(
<
size_t
>
self
.
__obj
.
output_buffer
)
return
self
.
_output_buffer
def
send_reply
(
self
,
int
code
,
char
*
reason
,
object
buf
):
if
not
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