Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Zope
Commits
1209546a
Commit
1209546a
authored
Aug 29, 2004
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't leak the bodyproducer if the response leaks.
parent
b7ef20a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
lib/python/ZServer/HTTPResponse.py
lib/python/ZServer/HTTPResponse.py
+6
-0
No files found.
lib/python/ZServer/HTTPResponse.py
View file @
1209546a
...
@@ -234,6 +234,12 @@ class ZServerHTTPResponse(HTTPResponse):
...
@@ -234,6 +234,12 @@ class ZServerHTTPResponse(HTTPResponse):
self
.
stdout
.
write
(
str
(
self
))
self
.
stdout
.
write
(
str
(
self
))
if
self
.
_bodyproducer
:
if
self
.
_bodyproducer
:
self
.
stdout
.
write
(
self
.
_bodyproducer
,
0
)
self
.
stdout
.
write
(
self
.
_bodyproducer
,
0
)
# we assign None to self._bodyproducer below to ensure that even
# if self is part of a cycle which causes a leak that we
# don't leak the bodyproducer (which often holds a reference to
# an open file descriptor, and leaking file descriptors can have
# particularly bad ramifications for a long-running process)
self
.
_bodyproducer
=
None
def
setBody
(
self
,
body
,
title
=
''
,
is_error
=
0
,
**
kw
):
def
setBody
(
self
,
body
,
title
=
''
,
is_error
=
0
,
**
kw
):
""" Accept either a stream iterator or a string as the body """
""" Accept either a stream iterator or a string as the body """
...
...
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