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
5df4cef9
Commit
5df4cef9
authored
Sep 14, 2013
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #303: 'requestline' AttributeError in pywsgi
Close #304: original PR by Neil Chintomby.
parent
d54a13df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
gevent/pywsgi.py
gevent/pywsgi.py
+6
-5
greentest/test__pywsgi.py
greentest/test__pywsgi.py
+14
-0
No files found.
gevent/pywsgi.py
View file @
5df4cef9
...
...
@@ -291,21 +291,22 @@ class WSGIHandler(object):
return
try
:
raw_
requestline
=
self
.
read_requestline
()
self
.
requestline
=
self
.
read_requestline
()
except
socket
.
error
:
# "Connection reset by peer" or other socket errors aren't interesting here
return
if
not
raw_
requestline
:
if
not
self
.
requestline
:
return
self
.
response_length
=
0
if
len
(
raw_
requestline
)
>=
MAX_REQUEST_LINE
:
if
len
(
self
.
requestline
)
>=
MAX_REQUEST_LINE
:
return
(
'414'
,
_REQUEST_TOO_LONG_RESPONSE
)
try
:
if
not
self
.
read_request
(
raw_requestline
):
# for compatibility with older versions of pywsgi, we pass self.requestline as an argument there
if
not
self
.
read_request
(
self
.
requestline
):
return
(
'400'
,
_BAD_REQUEST_RESPONSE
)
except
Exception
:
ex
=
sys
.
exc_info
()[
1
]
...
...
@@ -473,7 +474,7 @@ class WSGIHandler(object):
return
'%s - - [%s] "%s" %s %s %s'
%
(
self
.
client_address
[
0
],
now
,
self
.
requestline
,
getattr
(
self
,
'requestline'
,
''
)
,
(
getattr
(
self
,
'status'
,
None
)
or
'000'
).
split
()[
0
],
length
,
delta
)
...
...
greentest/test__pywsgi.py
View file @
5df4cef9
...
...
@@ -1218,6 +1218,20 @@ class TestInputRaw(greentest.BaseTestCase):
i
=
self
.
make_input
(
"2
\
r
\
n
1"
,
chunked_input
=
True
)
self
.
assertRaises
(
IOError
,
i
.
readline
)
class
Test414
(
TestCase
):
@
staticmethod
def
application
(
env
,
start_response
):
raise
AssertionError
(
'should not get there'
)
def
test
(
self
):
fd
=
self
.
makefile
()
longline
=
'x'
*
20000
fd
.
write
(
'''GET /%s HTTP/1.0
\
r
\
n
Hello: world
\
r
\
n
\
r
\
n
'''
%
longline
)
read_http
(
fd
,
code
=
414
,
version
=
'1.0'
)
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