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:
@@ -10,7 +10,8 @@
|
|||||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
|
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||||
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
|
<library name="ewsgi_spec" location="..\..\ewsgi_specification-safe.ecf" readonly="false"/>
|
||||||
|
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>
|
||||||
<cluster name="src" location=".\src\" recursive="true"/>
|
<cluster name="src" location=".\src\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
<option warning="true" full_class_checking="true">
|
<option warning="true" full_class_checking="true">
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
<library name="ewsgi" location="..\ewsgi.ecf" readonly="false"/>
|
<library name="ewsgi_spec" location="..\..\ewsgi_specification.ecf" readonly="false"/>
|
||||||
|
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/>
|
||||||
<cluster name="src" location=".\src\" recursive="true"/>
|
<cluster name="src" location=".\src\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class
|
|||||||
GW_CGI_CONNECTOR
|
GW_CGI_CONNECTOR
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_CONNECTOR
|
EWSGI_CONNECTOR
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -17,7 +17,7 @@ feature -- Execution
|
|||||||
|
|
||||||
launch
|
launch
|
||||||
local
|
local
|
||||||
env: GW_ENVIRONMENT_VARIABLES
|
env: EWSGI_ENVIRONMENT_VARIABLES
|
||||||
do
|
do
|
||||||
create env.make_with_variables ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables)
|
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)
|
application.process (env, create {GW_CGI_INPUT_STREAM}.make, create {GW_CGI_OUTPUT_STREAM}.make)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
GW_CGI_INPUT_STREAM
|
GW_CGI_INPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_INPUT_STREAM
|
EWSGI_INPUT_STREAM
|
||||||
|
|
||||||
CONSOLE
|
CONSOLE
|
||||||
rename
|
rename
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
GW_CGI_OUTPUT_STREAM
|
GW_CGI_OUTPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_OUTPUT_STREAM
|
EWSGI_OUTPUT_STREAM
|
||||||
undefine
|
undefine
|
||||||
flush
|
flush
|
||||||
end
|
end
|
||||||
@@ -19,6 +19,11 @@ inherit
|
|||||||
make as console_make
|
make as console_make
|
||||||
end
|
end
|
||||||
|
|
||||||
|
HTTP_STATUS_CODE_MESSAGES
|
||||||
|
export
|
||||||
|
{NONE} all
|
||||||
|
end
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
|
|
||||||
@@ -29,6 +34,26 @@ feature {NONE} -- Initialization
|
|||||||
make_open_stdout ("stdout")
|
make_open_stdout ("stdout")
|
||||||
end
|
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
|
note
|
||||||
copyright: "2011-2011, Eiffel Software and others"
|
copyright: "2011-2011, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
|||||||
@@ -10,8 +10,9 @@
|
|||||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
|
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||||
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
|
<library name="ewsgi_spec" location="..\..\ewsgi_specification-safe.ecf" readonly="false"/>
|
||||||
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi-safe.ecf" />
|
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi-safe.ecf" />
|
||||||
|
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>
|
||||||
<cluster name="src" location=".\" recursive="true"/>
|
<cluster name="src" location=".\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -10,8 +10,9 @@
|
|||||||
<option warning="true" full_class_checking="true">
|
<option warning="true" full_class_checking="true">
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
|
<library name="ewsgi_spec" location="..\..\ewsgi_specification.ecf" readonly="false"/>
|
||||||
<library name="libfcgi" location="..\..\libfcgi\libfcgi.ecf" />
|
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi.ecf" />
|
||||||
|
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/>
|
||||||
<cluster name="src" location=".\" recursive="true"/>
|
<cluster name="src" location=".\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
GW_LIBFCGI_CONNECTOR
|
GW_LIBFCGI_CONNECTOR
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_CONNECTOR
|
EWSGI_CONNECTOR
|
||||||
redefine
|
redefine
|
||||||
initialize
|
initialize
|
||||||
end
|
end
|
||||||
@@ -46,7 +46,7 @@ feature -- Execution
|
|||||||
|
|
||||||
process_fcgi_request (vars: HASH_TABLE [STRING, STRING]; a_input: like input; a_output: like output)
|
process_fcgi_request (vars: HASH_TABLE [STRING, STRING]; a_input: like input; a_output: like output)
|
||||||
local
|
local
|
||||||
gw_env: GW_ENVIRONMENT_VARIABLES
|
gw_env: EWSGI_ENVIRONMENT_VARIABLES
|
||||||
do
|
do
|
||||||
create gw_env.make_with_variables (vars)
|
create gw_env.make_with_variables (vars)
|
||||||
application.process (gw_env, a_input, a_output)
|
application.process (gw_env, a_input, a_output)
|
||||||
@@ -54,10 +54,10 @@ feature -- Execution
|
|||||||
|
|
||||||
feature -- Input/Output
|
feature -- Input/Output
|
||||||
|
|
||||||
input: GW_INPUT_STREAM
|
input: EWSGI_INPUT_STREAM
|
||||||
-- Input from client (from httpd server via FCGI)
|
-- Input from client (from httpd server via FCGI)
|
||||||
|
|
||||||
output: GW_OUTPUT_STREAM
|
output: EWSGI_OUTPUT_STREAM
|
||||||
-- Output to client (via httpd server/fcgi)
|
-- Output to client (via httpd server/fcgi)
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
GW_LIBFCGI_INPUT_STREAM
|
GW_LIBFCGI_INPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_INPUT_STREAM
|
EWSGI_INPUT_STREAM
|
||||||
|
|
||||||
STRING_HANDLER
|
STRING_HANDLER
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,12 @@ class
|
|||||||
GW_LIBFCGI_OUTPUT_STREAM
|
GW_LIBFCGI_OUTPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_OUTPUT_STREAM
|
EWSGI_OUTPUT_STREAM
|
||||||
|
|
||||||
|
HTTP_STATUS_CODE_MESSAGES
|
||||||
|
export
|
||||||
|
{NONE} all
|
||||||
|
end
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -23,6 +28,26 @@ feature {NONE} -- Initialization
|
|||||||
fcgi := a_fcgi
|
fcgi := a_fcgi
|
||||||
end
|
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
|
||||||
|
|
||||||
feature -- Basic operation
|
feature -- Basic operation
|
||||||
|
|
||||||
put_string (s: STRING)
|
put_string (s: STRING)
|
||||||
|
|||||||
@@ -10,8 +10,12 @@
|
|||||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
|
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||||
|
<library name="ewsgi_spec" location="..\..\ewsgi_specification-safe.ecf" readonly="false"/>
|
||||||
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
|
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
|
||||||
<library name="nino" location="..\..\..\..\..\ext\server\nino\nino-safe.ecf" readonly="false"/>
|
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>
|
||||||
|
<library name="nino" location="..\..\..\..\..\ext\server\nino\nino-safe.ecf" readonly="false">
|
||||||
|
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
||||||
|
</library>
|
||||||
<cluster name="src" location=".\src\" recursive="true"/>
|
<cluster name="src" location=".\src\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -10,8 +10,12 @@
|
|||||||
<option warning="true" full_class_checking="true">
|
<option warning="true" full_class_checking="true">
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
<library name="ewsgi" location="..\ewsgi.ecf" readonly="false"/>
|
<library name="ewsgi_spec" location="..\..\ewsgi_specification.ecf" readonly="false"/>
|
||||||
<library name="nino" location="..\..\..\..\..\ext\server\nino\nino.ecf" readonly="false"/>
|
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
|
||||||
|
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/>
|
||||||
|
<library name="nino" location="..\..\..\..\..\ext\server\nino\nino.ecf" readonly="false">
|
||||||
|
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
||||||
|
</library>
|
||||||
<cluster name="src" location=".\src\" recursive="true"/>
|
<cluster name="src" location=".\src\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class
|
|||||||
GW_NINO_CONNECTOR
|
GW_NINO_CONNECTOR
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_CONNECTOR
|
EWSGI_CONNECTOR
|
||||||
redefine
|
redefine
|
||||||
initialize
|
initialize
|
||||||
end
|
end
|
||||||
@@ -62,7 +62,7 @@ feature -- Server
|
|||||||
local
|
local
|
||||||
l_http_handler : HTTP_HANDLER
|
l_http_handler : HTTP_HANDLER
|
||||||
do
|
do
|
||||||
create {GW_NINO_HANDLER} l_http_handler.make_with_callback (server, "GW_NINO_HANDLER", Current)
|
create {GW_NINO_HANDLER} l_http_handler.make_with_callback (server, "NINO_HANDLER", Current)
|
||||||
debug ("nino")
|
debug ("nino")
|
||||||
if attached base as l_base then
|
if attached base as l_base then
|
||||||
print ("Base=" + l_base + "%N")
|
print ("Base=" + l_base + "%N")
|
||||||
@@ -73,7 +73,7 @@ feature -- Server
|
|||||||
|
|
||||||
process_request (env: HASH_TABLE [STRING, STRING]; a_headers_text: STRING; a_input: HTTP_INPUT_STREAM; a_output: HTTP_OUTPUT_STREAM)
|
process_request (env: HASH_TABLE [STRING, STRING]; a_headers_text: STRING; a_input: HTTP_INPUT_STREAM; a_output: HTTP_OUTPUT_STREAM)
|
||||||
local
|
local
|
||||||
gw_env: GW_ENVIRONMENT_VARIABLES
|
gw_env: EWSGI_ENVIRONMENT_VARIABLES
|
||||||
do
|
do
|
||||||
create gw_env.make_with_variables (env)
|
create gw_env.make_with_variables (env)
|
||||||
gw_env.set_variable ("RAW_HEADER_DATA", a_headers_text)
|
gw_env.set_variable ("RAW_HEADER_DATA", a_headers_text)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
GW_NINO_INPUT_STREAM
|
GW_NINO_INPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_INPUT_STREAM
|
EWSGI_INPUT_STREAM
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -22,7 +22,7 @@ feature {NONE} -- Initialization
|
|||||||
set_nino_input (a_nino_input)
|
set_nino_input (a_nino_input)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {GW_NINO_CONNECTOR, GW_APPLICATION} -- Nino
|
feature {GW_NINO_CONNECTOR, EWSGI_APPLICATION} -- Nino
|
||||||
|
|
||||||
set_nino_input (i: like nino_input)
|
set_nino_input (i: like nino_input)
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -9,7 +9,12 @@ class
|
|||||||
GW_NINO_OUTPUT_STREAM
|
GW_NINO_OUTPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
GW_OUTPUT_STREAM
|
EWSGI_OUTPUT_STREAM
|
||||||
|
|
||||||
|
HTTP_STATUS_CODE_MESSAGES
|
||||||
|
export
|
||||||
|
{NONE} all
|
||||||
|
end
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -21,7 +26,7 @@ feature {NONE} -- Initialization
|
|||||||
set_nino_output (a_nino_output)
|
set_nino_output (a_nino_output)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {GW_NINO_CONNECTOR, GW_APPLICATION} -- Nino
|
feature {GW_NINO_CONNECTOR, EWSGI_APPLICATION} -- Nino
|
||||||
|
|
||||||
set_nino_output (o: like nino_output)
|
set_nino_output (o: like nino_output)
|
||||||
do
|
do
|
||||||
@@ -30,6 +35,26 @@ feature {GW_NINO_CONNECTOR, GW_APPLICATION} -- Nino
|
|||||||
|
|
||||||
nino_output: HTTP_OUTPUT_STREAM
|
nino_output: HTTP_OUTPUT_STREAM
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
feature -- Basic operation
|
feature -- Basic operation
|
||||||
|
|
||||||
put_string (s: STRING_8)
|
put_string (s: STRING_8)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="ewsgi" uuid="D924DBE1-1231-434A-80EF-234BA09D1E30" library_target="ewsgi">
|
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-8-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-8-0 http://www.eiffel.com/developers/xml/configuration-1-8-0.xsd" name="ewsgi-full" uuid="D924DBE1-1231-434A-80EF-234BA09D1E30" library_target="ewsgi-full">
|
||||||
<target name="ewsgi">
|
<target name="ewsgi-full">
|
||||||
<root all_classes="true"/>
|
<root all_classes="true"/>
|
||||||
<file_rule>
|
<file_rule>
|
||||||
<exclude>/EIFGENs$</exclude>
|
<exclude>/EIFGENs$</exclude>
|
||||||
@@ -10,9 +10,10 @@
|
|||||||
<option warning="true" full_class_checking="true" is_attached_by_default="false" void_safety="none" syntax="provisional">
|
<option warning="true" full_class_checking="true" is_attached_by_default="false" void_safety="none" syntax="provisional">
|
||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
|
<library name="ewsgi_spec" location="ewsgi_specification.ecf"/>
|
||||||
<library name="error" location="..\..\error\error.ecf"/>
|
<library name="error" location="..\..\error\error.ecf"/>
|
||||||
<library name="http" location="..\..\protocol\http\http.ecf"/>
|
<library name="http" location="..\..\protocol\http\http.ecf"/>
|
||||||
<library name="encoder" location="..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
<library name="encoder" location="..\..\text\encoder\encoder.ecf" readonly="false"/>
|
||||||
<library name="libfcgi" location="..\libfcgi\libfcgi.ecf"/>
|
<library name="libfcgi" location="..\libfcgi\libfcgi.ecf"/>
|
||||||
<library name="nino" location="..\..\..\ext\server\nino\nino.ecf" readonly="false">
|
<library name="nino" location="..\..\..\ext\server\nino\nino.ecf" readonly="false">
|
||||||
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
<renaming old_name="HTTP_CONSTANTS" new_name="NINO_HTTP_CONSTANTS"/>
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
||||||
<library name="ewsgi_spec" location="ewsgi_specification.ecf"/>
|
<library name="ewsgi_spec" location="ewsgi_specification.ecf"/>
|
||||||
<library name="error" location="..\..\error\error-safe.ecf"/>
|
<library name="error" location="..\..\error\error.ecf"/>
|
||||||
<library name="http" location="..\..\protocol\http\http.ecf"/>
|
<library name="http" location="..\..\protocol\http\http.ecf"/>
|
||||||
<library name="encoder" location="..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
<library name="encoder" location="..\..\text\encoder\encoder.ecf" readonly="false"/>
|
||||||
<cluster name="interface" location="src\" recursive="true" />
|
<cluster name="interface" location="src\" recursive="true" />
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -11,8 +11,6 @@
|
|||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||||
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
<library name="time" location="$ISE_LIBRARY\library\time\time-safe.ecf"/>
|
||||||
<library name="http" location="..\..\protocol\http\http-safe.ecf"/>
|
|
||||||
<library name="encoder" location="..\..\text\encoder\encoder-safe.ecf" readonly="false"/>
|
|
||||||
<cluster name="specification" location="specification\" recursive="true"/>
|
<cluster name="specification" location="specification\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -11,8 +11,6 @@
|
|||||||
</option>
|
</option>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
|
||||||
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
||||||
<library name="http" location="..\..\protocol\http\http.ecf"/>
|
|
||||||
<library name="encoder" location="..\..\text\encoder\encoder.ecf" readonly="false"/>
|
|
||||||
<cluster name="specification" location="specification\" recursive="true"/>
|
<cluster name="specification" location="specification\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<setting name="concurrency" value="thread"/>
|
<setting name="concurrency" value="thread"/>
|
||||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||||
<library name="connector_nino" location="..\..\connectors\nino\nino-safe.ecf" readonly="false"/>
|
<library name="connector_nino" location="..\..\connectors\nino\nino-safe.ecf" readonly="false"/>
|
||||||
|
<library name="ewsgi_spec" location="..\..\ewsgi_specification-safe.ecf" readonly="false"/>
|
||||||
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
|
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
|
||||||
<cluster name="src" location="src\" recursive="true"/>
|
<cluster name="src" location="src\" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ feature {NONE} -- Initialization
|
|||||||
(create {GW_NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number)
|
(create {GW_NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number)
|
||||||
end
|
end
|
||||||
|
|
||||||
execute (req: GW_REQUEST; res: GW_RESPONSE)
|
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE)
|
||||||
do
|
do
|
||||||
res.write_header (200, <<["Content-Type", "text/plain"]>>)
|
res.write_header (200, <<["Content-Type", "text/plain"]>>)
|
||||||
res.write_string ("Hello World!%N")
|
res.write_string ("Hello World!%N")
|
||||||
|
|||||||
66
library/server/ewsgi/specification/ewsgi_agent_application.e
Normal file
66
library/server/ewsgi/specification/ewsgi_agent_application.e
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
note
|
||||||
|
description: "Summary description for {EWSGI_AGENT_APPLICATION}."
|
||||||
|
author: ""
|
||||||
|
date: "$Date$"
|
||||||
|
revision: "$Revision$"
|
||||||
|
|
||||||
|
class
|
||||||
|
EWSGI_AGENT_APPLICATION
|
||||||
|
|
||||||
|
inherit
|
||||||
|
EWSGI_APPLICATION
|
||||||
|
|
||||||
|
create
|
||||||
|
make
|
||||||
|
|
||||||
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
|
make (a_callback: like callback; a_request_creator: like request_creator; a_response_creator: like response_creator)
|
||||||
|
-- Initialize `Current'.
|
||||||
|
do
|
||||||
|
callback := a_callback
|
||||||
|
request_creator := a_request_creator
|
||||||
|
response_creator := a_response_creator
|
||||||
|
end
|
||||||
|
|
||||||
|
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]
|
||||||
|
|
||||||
|
callback: PROCEDURE [ANY, TUPLE [req: like new_request; res: like new_response]]
|
||||||
|
-- Procedure called on `execute'
|
||||||
|
|
||||||
|
execute (req: like new_request; res: like new_response)
|
||||||
|
-- Execute the request
|
||||||
|
do
|
||||||
|
callback.call ([req, res])
|
||||||
|
end
|
||||||
|
|
||||||
|
feature -- Factory
|
||||||
|
|
||||||
|
new_request (env: EWSGI_ENVIRONMENT; a_input: EWSGI_INPUT_STREAM): EWSGI_REQUEST
|
||||||
|
do
|
||||||
|
Result := request_creator.item ([env, a_input])
|
||||||
|
end
|
||||||
|
|
||||||
|
new_response (req: EWSGI_REQUEST; a_output: EWSGI_OUTPUT_STREAM): EWSGI_RESPONSE
|
||||||
|
do
|
||||||
|
Result := response_creator.item ([req, a_output])
|
||||||
|
end
|
||||||
|
|
||||||
|
invariant
|
||||||
|
callback_attached: callback /= Void
|
||||||
|
|
||||||
|
note
|
||||||
|
copyright: "2011-2011, Eiffel Software and others"
|
||||||
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
|
source: "[
|
||||||
|
Eiffel Software
|
||||||
|
5949 Hollister Ave., Goleta, CA 93117 USA
|
||||||
|
Telephone 805-685-1006, Fax 805-685-6869
|
||||||
|
Website http://www.eiffel.com
|
||||||
|
Customer support http://support.eiffel.com
|
||||||
|
]"
|
||||||
|
end
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {GW_ENVIRONMENT_VARIABLES}."
|
description: "Summary description for {EWSGI_ENVIRONMENT_VARIABLES}."
|
||||||
legal: "See notice at end of class."
|
legal: "See notice at end of class."
|
||||||
status: "See notice at end of class."
|
status: "See notice at end of class."
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
class
|
class
|
||||||
GW_ENVIRONMENT_VARIABLES
|
EWSGI_ENVIRONMENT_VARIABLES
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_ENVIRONMENT
|
EWSGI_ENVIRONMENT
|
||||||
@@ -10,14 +10,6 @@ note
|
|||||||
deferred class
|
deferred class
|
||||||
EWSGI_OUTPUT_STREAM
|
EWSGI_OUTPUT_STREAM
|
||||||
|
|
||||||
inherit
|
|
||||||
ANY
|
|
||||||
|
|
||||||
HTTP_STATUS_CODE_MESSAGES
|
|
||||||
export
|
|
||||||
{NONE} all
|
|
||||||
end
|
|
||||||
|
|
||||||
feature -- Core operation
|
feature -- Core operation
|
||||||
|
|
||||||
put_string (s: STRING_8)
|
put_string (s: STRING_8)
|
||||||
@@ -38,18 +30,7 @@ feature -- Status writing
|
|||||||
-- Put status code line for `a_code'
|
-- Put status code line for `a_code'
|
||||||
--| Note this is a default implementation, and could be redefined
|
--| Note this is a default implementation, and could be redefined
|
||||||
--| for instance in relation to NPH CGI script
|
--| for instance in relation to NPH CGI script
|
||||||
local
|
deferred
|
||||||
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
|
end
|
||||||
|
|
||||||
feature -- Basic operation
|
feature -- Basic operation
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {GW_AGENT_APPLICATION}."
|
description: "Summary description for {EWSGI_AGENT_APPLICATION}."
|
||||||
author: ""
|
author: ""
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
Reference in New Issue
Block a user