remove pre_execute, and post_execute, and make process_request frozen
this way, the user won't be tempted to redefine feature not being part of pure EWSGI interface.
This commit is contained in:
@@ -27,16 +27,14 @@ feature -- Execution
|
|||||||
|
|
||||||
feature -- Process request
|
feature -- Process request
|
||||||
|
|
||||||
process (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
frozen process (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Process request with environment `env', and i/o streams `a_input' and `a_output'
|
-- Process request with environment `env', and i/o streams `a_input' and `a_output'
|
||||||
local
|
local
|
||||||
rescued: BOOLEAN
|
rescued: BOOLEAN
|
||||||
do
|
do
|
||||||
if not rescued then
|
if not rescued then
|
||||||
request_count := request_count + 1
|
request_count := request_count + 1
|
||||||
pre_execute (req)
|
|
||||||
execute (req, res)
|
execute (req, res)
|
||||||
post_execute (req, res)
|
|
||||||
else
|
else
|
||||||
rescue_execute (req, res, (create {EXCEPTION_MANAGER}).last_exception)
|
rescue_execute (req, res, (create {EXCEPTION_MANAGER}).last_exception)
|
||||||
end
|
end
|
||||||
@@ -52,16 +50,6 @@ feature -- Access
|
|||||||
|
|
||||||
feature {NONE} -- Execution
|
feature {NONE} -- Execution
|
||||||
|
|
||||||
pre_execute (req: WGI_REQUEST)
|
|
||||||
-- Operation processed before `execute'
|
|
||||||
do
|
|
||||||
end
|
|
||||||
|
|
||||||
post_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
|
||||||
-- Operation processed after `execute', or after `rescue_execute'
|
|
||||||
do
|
|
||||||
end
|
|
||||||
|
|
||||||
rescue_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER; a_exception: detachable EXCEPTION)
|
rescue_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER; a_exception: detachable EXCEPTION)
|
||||||
-- Operation processed on rescue of `execute'
|
-- Operation processed on rescue of `execute'
|
||||||
do
|
do
|
||||||
@@ -71,7 +59,6 @@ feature {NONE} -- Execution
|
|||||||
res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
|
res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
|
||||||
res.write_string ("<pre>" + l_trace + "</pre>")
|
res.write_string ("<pre>" + l_trace + "</pre>")
|
||||||
end
|
end
|
||||||
post_execute (req, res)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
;note
|
;note
|
||||||
|
|||||||
Reference in New Issue
Block a user