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
03e88384
Commit
03e88384
authored
Feb 23, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the conflict error retry logic.
parent
b56e1da0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
36 deletions
+50
-36
ZServer/HTTPResponse.py
ZServer/HTTPResponse.py
+25
-18
lib/python/ZServer/HTTPResponse.py
lib/python/ZServer/HTTPResponse.py
+25
-18
No files found.
ZServer/HTTPResponse.py
View file @
03e88384
...
@@ -261,7 +261,15 @@ class ZServerHTTPResponse(HTTPResponse):
...
@@ -261,7 +261,15 @@ class ZServerHTTPResponse(HTTPResponse):
self
.
_tempstart
=
e
self
.
_tempstart
=
e
stdout
.
write
(
file_part_producer
(
t
,
self
.
_templock
,
b
,
e
),
l
)
stdout
.
write
(
file_part_producer
(
t
,
self
.
_templock
,
b
,
e
),
l
)
_retried_response
=
None
def
_finish
(
self
):
def
_finish
(
self
):
if
self
.
_retried_response
:
try
:
self
.
_retried_response
.
_finish
()
finally
:
self
.
_retried_response
=
None
return
stdout
=
self
.
stdout
stdout
=
self
.
stdout
t
=
self
.
_tempfile
t
=
self
.
_tempfile
...
@@ -275,6 +283,20 @@ class ZServerHTTPResponse(HTTPResponse):
...
@@ -275,6 +283,20 @@ class ZServerHTTPResponse(HTTPResponse):
self
.
stdout
=
None
# need to break cycle?
self
.
stdout
=
None
# need to break cycle?
self
.
_request
=
None
self
.
_request
=
None
def
retry
(
self
):
"""Return a request object to be used in a retry attempt
"""
# This implementation is a bit lame, because it assumes that
# only stdout stderr were passed to the constructor. OTOH, I
# think that that's all that is ever passed.
response
=
self
.
__class__
(
stdout
=
self
.
stdout
,
stderr
=
self
.
stderr
)
response
.
_http_version
=
self
.
_http_version
response
.
_http_connection
=
self
.
_http_connection
response
.
_server_version
=
self
.
_server_version
self
.
_retried_response
=
response
return
response
class
ChannelPipe
:
class
ChannelPipe
:
"""Experimental pipe from ZPublisher to a ZServer Channel.
"""Experimental pipe from ZPublisher to a ZServer Channel.
...
@@ -346,21 +368,6 @@ class ChannelPipe:
...
@@ -346,21 +368,6 @@ class ChannelPipe:
self
.
_close
=
1
self
.
_close
=
1
self
.
_request
.
reply_code
=
response
.
status
self
.
_request
.
reply_code
=
response
.
status
def
retry
(
self
):
"""Return a request object to be used in a retry attempt
"""
# This implementation is a bit lame, because it assumes that
# only stdout stderr were passed to the constructor. OTOH, I
# think that that's all that is ever passed.
response
=
self
.
__class__
(
stdout
=
self
.
stdout
,
stderr
=
self
.
stderr
)
response
.
_http_version
=
self
.
_http_version
response
.
_http_connection
=
self
.
_http_connection
response
.
_server_version
=
self
.
_server_version
return
response
def
make_response
(
request
,
headers
):
def
make_response
(
request
,
headers
):
"Simple http response factory"
"Simple http response factory"
...
...
lib/python/ZServer/HTTPResponse.py
View file @
03e88384
...
@@ -261,7 +261,15 @@ class ZServerHTTPResponse(HTTPResponse):
...
@@ -261,7 +261,15 @@ class ZServerHTTPResponse(HTTPResponse):
self
.
_tempstart
=
e
self
.
_tempstart
=
e
stdout
.
write
(
file_part_producer
(
t
,
self
.
_templock
,
b
,
e
),
l
)
stdout
.
write
(
file_part_producer
(
t
,
self
.
_templock
,
b
,
e
),
l
)
_retried_response
=
None
def
_finish
(
self
):
def
_finish
(
self
):
if
self
.
_retried_response
:
try
:
self
.
_retried_response
.
_finish
()
finally
:
self
.
_retried_response
=
None
return
stdout
=
self
.
stdout
stdout
=
self
.
stdout
t
=
self
.
_tempfile
t
=
self
.
_tempfile
...
@@ -275,6 +283,20 @@ class ZServerHTTPResponse(HTTPResponse):
...
@@ -275,6 +283,20 @@ class ZServerHTTPResponse(HTTPResponse):
self
.
stdout
=
None
# need to break cycle?
self
.
stdout
=
None
# need to break cycle?
self
.
_request
=
None
self
.
_request
=
None
def
retry
(
self
):
"""Return a request object to be used in a retry attempt
"""
# This implementation is a bit lame, because it assumes that
# only stdout stderr were passed to the constructor. OTOH, I
# think that that's all that is ever passed.
response
=
self
.
__class__
(
stdout
=
self
.
stdout
,
stderr
=
self
.
stderr
)
response
.
_http_version
=
self
.
_http_version
response
.
_http_connection
=
self
.
_http_connection
response
.
_server_version
=
self
.
_server_version
self
.
_retried_response
=
response
return
response
class
ChannelPipe
:
class
ChannelPipe
:
"""Experimental pipe from ZPublisher to a ZServer Channel.
"""Experimental pipe from ZPublisher to a ZServer Channel.
...
@@ -346,21 +368,6 @@ class ChannelPipe:
...
@@ -346,21 +368,6 @@ class ChannelPipe:
self
.
_close
=
1
self
.
_close
=
1
self
.
_request
.
reply_code
=
response
.
status
self
.
_request
.
reply_code
=
response
.
status
def
retry
(
self
):
"""Return a request object to be used in a retry attempt
"""
# This implementation is a bit lame, because it assumes that
# only stdout stderr were passed to the constructor. OTOH, I
# think that that's all that is ever passed.
response
=
self
.
__class__
(
stdout
=
self
.
stdout
,
stderr
=
self
.
stderr
)
response
.
_http_version
=
self
.
_http_version
response
.
_http_connection
=
self
.
_http_connection
response
.
_server_version
=
self
.
_server_version
return
response
def
make_response
(
request
,
headers
):
def
make_response
(
request
,
headers
):
"Simple http response factory"
"Simple http response factory"
...
...
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