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
062086d2
Commit
062086d2
authored
Dec 08, 2019
by
Jason Madden
Committed by
GitHub
Dec 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1490 from gevent/issue1331
gevent.pywsgi: Support keep-alive in HTTP/1.0
parents
9fe8ba12
6f734773
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
92 deletions
+112
-92
CHANGES.rst
CHANGES.rst
+3
-0
src/gevent/pywsgi.py
src/gevent/pywsgi.py
+7
-3
src/gevent/tests/test__pywsgi.py
src/gevent/tests/test__pywsgi.py
+102
-89
No files found.
CHANGES.rst
View file @
062086d2
...
...
@@ -43,6 +43,9 @@
calling it, so ``unlink`` can sometimes be optimized out. See
:issue:`1487`.
- Make ``gevent.pywsgi`` support ``Connection: keep-alive`` in
HTTP/1.0. Based on :pr:`1331` by tanchuhan.
1.5a2 (2019-10-21)
==================
...
...
src/gevent/pywsgi.py
View file @
062086d2
...
...
@@ -555,7 +555,11 @@ class WSGIHandler(object):
if
self
.
request_version
==
"HTTP/1.1"
:
conntype
=
self
.
headers
.
get
(
"Connection"
,
""
).
lower
()
self
.
close_connection
=
(
conntype
==
'close'
)
elif
self
.
request_version
==
'HTTP/1.0'
:
conntype
=
self
.
headers
.
get
(
"Connection"
,
"close"
).
lower
()
self
.
close_connection
=
(
conntype
!=
'keep-alive'
)
else
:
# XXX: HTTP 0.9. We should drop support
self
.
close_connection
=
True
return
True
...
...
@@ -842,7 +846,7 @@ class WSGIHandler(object):
self
.
response_headers
=
response_headers
self
.
code
=
code
provided_connection
=
None
provided_connection
=
None
# Did the wsgi app give us a Connection header?
self
.
provided_date
=
None
self
.
provided_content_length
=
None
...
...
@@ -856,8 +860,8 @@ class WSGIHandler(object):
self
.
provided_content_length
=
value
if
self
.
request_version
==
'HTTP/1.0'
and
provided_connection
is
None
:
response_headers
.
append
((
b'Connection'
,
b'close'
))
self
.
close_connection
=
True
conntype
=
b'close'
if
self
.
close_connection
else
b'keep-alive'
response_headers
.
append
((
b'Connection'
,
conntype
))
elif
provided_connection
==
'close'
:
self
.
close_connection
=
True
...
...
src/gevent/tests/test__pywsgi.py
View file @
062086d2
This diff is collapsed.
Click to expand it.
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