fixed cgi and libfcgi connectors due to recent changes from WGI_APPLICATION

This commit is contained in:
Jocelyn Fiat
2011-10-14 14:27:54 +02:00
parent 21e973f8a4
commit c3f5376ef5
2 changed files with 43 additions and 9 deletions

View File

@@ -18,13 +18,30 @@ feature -- Execution
launch
local
req: WGI_REQUEST_FROM_TABLE
res: WGI_RESPONSE_STREAM_BUFFER
res: detachable WGI_RESPONSE_STREAM_BUFFER
rescued: BOOLEAN
do
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {EWF_CGI_INPUT_STREAM}.make)
create res.make (create {EWF_CGI_OUTPUT_STREAM}.make)
application.process (req, res)
if not rescued then
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {EWF_CGI_INPUT_STREAM}.make)
create res.make (create {EWF_CGI_OUTPUT_STREAM}.make)
application.execute (req, res)
else
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
if res /= Void then
if not res.status_is_set then
res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
end
if res.message_writable then
res.write_string ("<pre>" + l_trace + "</pre>")
end
end
end
end
rescue
rescued := True
retry
end
note
copyright: "2011-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"

View File

@@ -47,11 +47,28 @@ feature -- Execution
process_fcgi_request (vars: HASH_TABLE [STRING, STRING]; a_input: like input; a_output: like output)
local
req: WGI_REQUEST_FROM_TABLE
res: WGI_RESPONSE_STREAM_BUFFER
res: detachable WGI_RESPONSE_STREAM_BUFFER
rescued: BOOLEAN
do
create req.make (vars, a_input)
create res.make (a_output)
application.process (req, res)
if not rescued then
create req.make (vars, a_input)
create res.make (a_output)
application.execute (req, res)
else
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
if res /= Void then
if not res.status_is_set then
res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
end
if res.message_writable then
res.write_string ("<pre>" + l_trace + "</pre>")
end
end
end
end
rescue
rescued := True
retry
end
feature -- Input/Output