Added an implementation folder in ewsgi_spec, mainly to provide default implementation just to save the developer of connector some time.

changed structured
This commit is contained in:
Jocelyn Fiat
2011-07-27 17:34:53 +02:00
parent e9b05ffc0b
commit 73284575d4
31 changed files with 190 additions and 58 deletions

View File

@@ -8,7 +8,7 @@ class
GW_CGI_CONNECTOR
inherit
GW_CONNECTOR
EWSGI_CONNECTOR
create
make
@@ -17,7 +17,7 @@ feature -- Execution
launch
local
env: GW_ENVIRONMENT_VARIABLES
env: EWSGI_ENVIRONMENT_VARIABLES
do
create env.make_with_variables ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables)
application.process (env, create {GW_CGI_INPUT_STREAM}.make, create {GW_CGI_OUTPUT_STREAM}.make)

View File

@@ -9,7 +9,7 @@ class
GW_CGI_INPUT_STREAM
inherit
GW_INPUT_STREAM
EWSGI_INPUT_STREAM
CONSOLE
rename

View File

@@ -9,7 +9,7 @@ class
GW_CGI_OUTPUT_STREAM
inherit
GW_OUTPUT_STREAM
EWSGI_OUTPUT_STREAM
undefine
flush
end
@@ -19,6 +19,11 @@ inherit
make as console_make
end
HTTP_STATUS_CODE_MESSAGES
export
{NONE} all
end
create
make
@@ -29,6 +34,26 @@ feature {NONE} -- Initialization
make_open_stdout ("stdout")
end
feature -- Status writing
put_status_line (a_code: INTEGER)
-- Put status code line for `a_code'
--| Note this is a default implementation, and could be redefined
--| for instance in relation to NPH CGI script
local
s: STRING
do
create s.make (16)
s.append ({HTTP_CONSTANTS}.http_version_1_1)
s.append_character (' ')
s.append_integer (a_code)
if attached http_status_code_message (a_code) as l_status_message then
s.append_character (' ')
s.append_string (l_status_message)
end
put_header_line (s)
end
note
copyright: "2011-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"