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
01ec94d2
Commit
01ec94d2
authored
Oct 06, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
96a40e5f
a80ff915
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
3 deletions
+32
-3
.hgignore
.hgignore
+1
-0
gevent/greenlet.py
gevent/greenlet.py
+1
-1
gevent/pywsgi.py
gevent/pywsgi.py
+2
-0
greentest/greentest.py
greentest/greentest.py
+1
-2
greentest/patched_tests_setup.py
greentest/patched_tests_setup.py
+1
-0
greentest/test__pywsgi.py
greentest/test__pywsgi.py
+26
-0
No files found.
.hgignore
View file @
01ec94d2
...
...
@@ -5,6 +5,7 @@ syntax: glob
dist
gevent.egg-info
build
gevent/core.c
gevent/core.so
gevent/core_d.so
doc/_build
...
...
gevent/greenlet.py
View file @
01ec94d2
...
...
@@ -293,7 +293,7 @@ class Greenlet(greenlet):
If block is ``True`` (the default), wait until the greenlet dies or the optional timeout expires.
If block is ``False``, the current greenlet is not unscheduled.
The function always returns ``None`` and never raises an err
i
r.
The function always returns ``None`` and never raises an err
o
r.
`Changed in version 0.13.0:` *block* is now ``True`` by default.
"""
...
...
gevent/pywsgi.py
View file @
01ec94d2
...
...
@@ -173,6 +173,8 @@ class WSGIHandler(object):
self
.
log_request
()
break
finally
:
self
.
socket
.
_sock
.
close
()
# do not rely on garbage collection
self
.
socket
.
close
()
self
.
__dict__
.
pop
(
'socket'
,
None
)
self
.
__dict__
.
pop
(
'rfile'
,
None
)
self
.
__dict__
.
pop
(
'wfile'
,
None
)
...
...
greentest/greentest.py
View file @
01ec94d2
...
...
@@ -91,7 +91,7 @@ class TestCase(BaseTestCase):
@
property
def
testcasename
(
self
):
return
self
.
__class__
.
__name__
+
'.'
+
self
.
testname
@
property
def
modulename
(
self
):
test_method
=
getattr
(
self
,
self
.
testname
)
...
...
@@ -101,7 +101,6 @@ class TestCase(BaseTestCase):
def
fullname
(
self
):
return
splitext
(
basename
(
self
.
modulename
))[
0
]
+
'.'
+
self
.
testcasename
def
hook_stderr
(
self
):
if
VERBOSE
:
return
...
...
greentest/patched_tests_setup.py
View file @
01ec94d2
...
...
@@ -20,6 +20,7 @@ test_socket.GeneralModuleTests.*
tests
=
[
x
.
strip
().
replace
(
'
\
.
'
, '
\\
.
').replace('
*
', '
.
*
?
') for x in tests.split('
\
n
') if x.strip()]
tests = re.compile('
^%
s
$
' % '
|
'.join(tests))
def get_switch_expected(fullname):
"""
>>> get_switch_expected('
test_select
.
SelectTestCase
.
test_error_conditions
')
...
...
greentest/test__pywsgi.py
View file @
01ec94d2
...
...
@@ -858,6 +858,32 @@ Cookie: name2="value2"\n\n'''.replace('\n', '\r\n'))
read_http
(
fd
)
class
TestLeakInput
(
TestCase
):
def
application
(
self
,
environ
,
start_response
):
pi
=
environ
[
"PATH_INFO"
]
self
.
_leak_wsgi_input
=
environ
[
"wsgi.input"
]
self
.
_leak_environ
=
environ
if
pi
==
"/leak-frame"
:
environ
[
"_leak"
]
=
sys
.
_getframe
(
0
)
text
=
"foobar"
start_response
(
'200 OK'
,
[(
'Content-Length'
,
str
(
len
(
text
))),
(
'Content-Type'
,
'text/plain'
)])
return
[
text
]
def
test_connection_close_leak_simple
(
self
):
fd
=
self
.
connect
().
makefile
(
bufsize
=
1
)
fd
.
write
(
"GET / HTTP/1.0
\
r
\
n
Connection: close
\
r
\
n
\
r
\
n
"
)
d
=
fd
.
read
()
assert
d
.
startswith
(
"HTTP/1.0 200 OK"
),
"bad response"
def
test_connection_close_leak_frame
(
self
):
fd
=
self
.
connect
().
makefile
(
bufsize
=
1
)
fd
.
write
(
"GET /leak-frame HTTP/1.0
\
r
\
n
Connection: close
\
r
\
n
\
r
\
n
"
)
d
=
fd
.
read
()
assert
d
.
startswith
(
"HTTP/1.0 200 OK"
),
"bad response"
del
CommonTests
if
__name__
==
'__main__'
:
...
...
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