Added the possibility to set the "Status" header (different from the status line) in GW_HEADER

Renamed EWSGI_RESPONSE as EWSGI_RESPONSE_STREAM to avoid confusion with EWSGI_RESPONSE as stated in Paul's proposal
Added default "configuration" (for nino and cgi) to be independant of the connector (at compilation time)
Added example implementing Paul's proposal on top of EWSGI
This commit is contained in:
Jocelyn Fiat
2011-07-27 18:34:06 +02:00
parent 73284575d4
commit 436f2afd00
22 changed files with 579 additions and 25 deletions

View File

@@ -27,7 +27,7 @@ feature {NONE} -- Implementation
request_creator: FUNCTION [ANY, TUPLE [env: EWSGI_ENVIRONMENT; input: EWSGI_INPUT_STREAM], EWSGI_REQUEST]
response_creator: FUNCTION [ANY, TUPLE [req: EWSGI_REQUEST; output: EWSGI_OUTPUT_STREAM], EWSGI_RESPONSE]
response_creator: FUNCTION [ANY, TUPLE [req: EWSGI_REQUEST; output: EWSGI_OUTPUT_STREAM], EWSGI_RESPONSE_STREAM]
callback: PROCEDURE [ANY, TUPLE [req: like new_request; res: like new_response]]
-- Procedure called on `execute'
@@ -45,7 +45,7 @@ feature -- Factory
Result := request_creator.item ([env, a_input])
end
new_response (req: EWSGI_REQUEST; a_output: EWSGI_OUTPUT_STREAM): EWSGI_RESPONSE
new_response (req: EWSGI_REQUEST; a_output: EWSGI_OUTPUT_STREAM): EWSGI_RESPONSE_STREAM
do
Result := response_creator.item ([req, a_output])
end

View File

@@ -33,7 +33,7 @@ feature -- Process request
feature {NONE} -- Execution
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE)
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_STREAM)
-- Execute the request
-- See `req.input' for input stream
-- `req.environment' for the Gateway environment
@@ -48,12 +48,12 @@ feature {NONE} -- Execution
do
end
post_execute (req: detachable EWSGI_REQUEST; res: detachable EWSGI_RESPONSE)
post_execute (req: detachable EWSGI_REQUEST; res: detachable EWSGI_RESPONSE_STREAM)
-- Operation processed after `execute', or after `rescue_execute'
do
end
rescue_execute (req: detachable EWSGI_REQUEST; res: detachable EWSGI_RESPONSE; a_exception: detachable EXCEPTION)
rescue_execute (req: detachable EWSGI_REQUEST; res: detachable EWSGI_RESPONSE_STREAM; a_exception: detachable EXCEPTION)
-- Operation processed on rescue of `execute'
do
post_execute (req, res)
@@ -64,16 +64,16 @@ feature -- Factory
new_request (env: EWSGI_ENVIRONMENT; a_input: EWSGI_INPUT_STREAM): EWSGI_REQUEST
-- New Request context based on `env' and `a_input'
--| note: you can redefine this function to create your own
--| descendant of GW_REQUEST_CONTEXT , or even to reuse/recycle existing
--| instance of GW_REQUEST_CONTEXT
--| descendant of EWSGI_REQUEST , or even to reuse/recycle existing
--| instance of EWSGI_REQUEST
deferred
end
new_response (req: EWSGI_REQUEST; a_output: EWSGI_OUTPUT_STREAM): EWSGI_RESPONSE
new_response (req: EWSGI_REQUEST; a_output: EWSGI_OUTPUT_STREAM): EWSGI_RESPONSE_STREAM
-- New Response based on `req' and `a_output'
--| note: you can redefine this function to create your own
--| descendant of GW_RESPONSE , or even to reuse/recycle existing
--| instance of GW_RESPONSE
--| descendant of EWSGI_RESPONSE_STREAM , or even to reuse/recycle existing
--| instance of EWSGI_RESPONSE_STREAM
deferred
end

View File

@@ -1,11 +1,11 @@
note
description: "Summary description for {EWSGI_RESPONSE}."
description: "Summary description for {EWSGI_RESPONSE_STREAM}."
author: ""
date: "$Date$"
revision: "$Revision$"
deferred class
EWSGI_RESPONSE
EWSGI_RESPONSE_STREAM
feature {EWSGI_APPLICATION} -- Commit