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
b9535272
Commit
b9535272
authored
Mar 13, 2002
by
Toby Dickenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #266: persistent proxy connections
parent
8bdf0ba0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
ZServer/HTTPResponse.py
ZServer/HTTPResponse.py
+13
-3
lib/python/ZServer/HTTPResponse.py
lib/python/ZServer/HTTPResponse.py
+13
-3
No files found.
ZServer/HTTPResponse.py
View file @
b9535272
...
...
@@ -296,6 +296,9 @@ class ChannelPipe:
self
.
_close
=
1
self
.
_request
.
reply_code
=
response
.
status
is_proxying_match
=
re
.
compile
(
r'[^ ]* [^ \\]*:'
).
match
proxying_connection_re
=
re
.
compile
(
'Proxy-Connection: (.*)'
,
re
.
IGNORECASE
)
def
make_response
(
request
,
headers
):
"Simple http response factory"
...
...
@@ -303,9 +306,16 @@ def make_response(request, headers):
response
=
ZServerHTTPResponse
(
stdout
=
ChannelPipe
(
request
),
stderr
=
StringIO
())
response
.
_http_version
=
request
.
version
response
.
_http_connection
=
(
http_server
.
get_header
(
http_server
.
CONNECTION
,
request
.
header
)).
lower
()
if
request
.
version
==
'1.0'
and
is_proxying_match
(
request
.
request
):
# a request that was made as if this zope was an http 1.0 proxy.
# that means we have to use some slightly different http
# headers to manage persistent connections.
connection_re
=
proxying_connection_re
else
:
# a normal http request
connection_re
=
http_server
.
CONNECTION
response
.
_http_connection
=
http_server
.
get_header
(
connection_re
,
request
.
header
).
lower
()
response
.
_server_version
=
request
.
channel
.
server
.
SERVER_IDENT
return
response
lib/python/ZServer/HTTPResponse.py
View file @
b9535272
...
...
@@ -296,6 +296,9 @@ class ChannelPipe:
self
.
_close
=
1
self
.
_request
.
reply_code
=
response
.
status
is_proxying_match
=
re
.
compile
(
r'[^ ]* [^ \\]*:'
).
match
proxying_connection_re
=
re
.
compile
(
'Proxy-Connection: (.*)'
,
re
.
IGNORECASE
)
def
make_response
(
request
,
headers
):
"Simple http response factory"
...
...
@@ -303,9 +306,16 @@ def make_response(request, headers):
response
=
ZServerHTTPResponse
(
stdout
=
ChannelPipe
(
request
),
stderr
=
StringIO
())
response
.
_http_version
=
request
.
version
response
.
_http_connection
=
(
http_server
.
get_header
(
http_server
.
CONNECTION
,
request
.
header
)).
lower
()
if
request
.
version
==
'1.0'
and
is_proxying_match
(
request
.
request
):
# a request that was made as if this zope was an http 1.0 proxy.
# that means we have to use some slightly different http
# headers to manage persistent connections.
connection_re
=
proxying_connection_re
else
:
# a normal http request
connection_re
=
http_server
.
CONNECTION
response
.
_http_connection
=
http_server
.
get_header
(
connection_re
,
request
.
header
).
lower
()
response
.
_server_version
=
request
.
channel
.
server
.
SERVER_IDENT
return
response
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