Changed prefix from EWSGI_ to WGI_
Changed meta variable type to READABLE_STRING_32
This commit is contained in:
2
doc/wiki
2
doc/wiki
Submodule doc/wiki updated: d14e65fdc0...060f1482fe
@@ -17,7 +17,7 @@ inherit
|
|||||||
|
|
||||||
feature -- Helper
|
feature -- Helper
|
||||||
|
|
||||||
execute_content_type_not_allowed (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER; a_content_types: detachable ARRAY [STRING]; a_uri_formats: detachable ARRAY [STRING])
|
execute_content_type_not_allowed (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER; a_content_types: detachable ARRAY [STRING]; a_uri_formats: detachable ARRAY [STRING])
|
||||||
local
|
local
|
||||||
s, uri_s: detachable STRING
|
s, uri_s: detachable STRING
|
||||||
i, n: INTEGER
|
i, n: INTEGER
|
||||||
@@ -68,7 +68,7 @@ feature -- Helper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_method_not_allowed (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER; a_methods: ARRAY [STRING])
|
execute_method_not_allowed (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER; a_methods: ARRAY [STRING])
|
||||||
local
|
local
|
||||||
s: STRING
|
s: STRING
|
||||||
i, n: INTEGER
|
i, n: INTEGER
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ inherit
|
|||||||
|
|
||||||
ROUTED_APPLICATION_HELPER
|
ROUTED_APPLICATION_HELPER
|
||||||
|
|
||||||
DEFAULT_EWSGI_APPLICATION
|
DEFAULT_WGI_APPLICATION
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -51,7 +51,7 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute_default (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute_default (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
local
|
local
|
||||||
h: EWF_HEADER
|
h: EWF_HEADER
|
||||||
l_url: STRING
|
l_url: STRING
|
||||||
@@ -96,7 +96,7 @@ feature -- Execution
|
|||||||
res.flush
|
res.flush
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_home (ctx: REQUEST_HANDLER_CONTEXT; req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute_home (ctx: REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
do
|
do
|
||||||
res.write_header (200, <<["Content-Type", "text/html"]>>)
|
res.write_header (200, <<["Content-Type", "text/html"]>>)
|
||||||
res.write_string ("<html><body>Hello World ?!%N")
|
res.write_string ("<html><body>Hello World ?!%N")
|
||||||
@@ -116,7 +116,7 @@ feature -- Execution
|
|||||||
res.write_string ("</body></html>%N")
|
res.write_string ("</body></html>%N")
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_hello (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER; a_name: detachable READABLE_STRING_32; ctx: REQUEST_HANDLER_CONTEXT)
|
execute_hello (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER; a_name: detachable READABLE_STRING_32; ctx: REQUEST_HANDLER_CONTEXT)
|
||||||
local
|
local
|
||||||
l_response_content_type: detachable STRING
|
l_response_content_type: detachable STRING
|
||||||
msg: STRING
|
msg: STRING
|
||||||
@@ -160,12 +160,12 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
handle_hello (ctx: REQUEST_HANDLER_CONTEXT; req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
handle_hello (ctx: REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
do
|
do
|
||||||
execute_hello (req, res, Void, ctx)
|
execute_hello (req, res, Void, ctx)
|
||||||
end
|
end
|
||||||
|
|
||||||
handle_anonymous_hello (ctx: REQUEST_HANDLER_CONTEXT; req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
handle_anonymous_hello (ctx: REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
do
|
do
|
||||||
execute_hello (req, res, ctx.parameter ("name"), ctx)
|
execute_hello (req, res, ctx.parameter ("name"), ctx)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class
|
|||||||
EWF_CGI_CONNECTOR
|
EWF_CGI_CONNECTOR
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_CONNECTOR
|
WGI_CONNECTOR
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -17,8 +17,8 @@ feature -- Execution
|
|||||||
|
|
||||||
launch
|
launch
|
||||||
local
|
local
|
||||||
req: EWSGI_REQUEST_FROM_TABLE
|
req: WGI_REQUEST_FROM_TABLE
|
||||||
res: EWSGI_RESPONSE_STREAM_BUFFER
|
res: WGI_RESPONSE_STREAM_BUFFER
|
||||||
do
|
do
|
||||||
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {EWF_CGI_INPUT_STREAM}.make)
|
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {EWF_CGI_INPUT_STREAM}.make)
|
||||||
create res.make (create {EWF_CGI_OUTPUT_STREAM}.make)
|
create res.make (create {EWF_CGI_OUTPUT_STREAM}.make)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for GW_CGI_INPUT_STREAM."
|
description: "Summary description for EWF_CGI_INPUT_STREAM."
|
||||||
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$"
|
||||||
@@ -9,7 +9,7 @@ class
|
|||||||
EWF_CGI_INPUT_STREAM
|
EWF_CGI_INPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_INPUT_STREAM
|
WGI_INPUT_STREAM
|
||||||
|
|
||||||
CONSOLE
|
CONSOLE
|
||||||
rename
|
rename
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for GW_CGI_OUTPUT_STREAM."
|
description: "Summary description for EWF_CGI_OUTPUT_STREAM."
|
||||||
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$"
|
||||||
@@ -9,7 +9,7 @@ class
|
|||||||
EWF_CGI_OUTPUT_STREAM
|
EWF_CGI_OUTPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_OUTPUT_STREAM
|
WGI_OUTPUT_STREAM
|
||||||
undefine
|
undefine
|
||||||
flush
|
flush
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
EWF_LIBFCGI_CONNECTOR
|
EWF_LIBFCGI_CONNECTOR
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_CONNECTOR
|
WGI_CONNECTOR
|
||||||
redefine
|
redefine
|
||||||
initialize
|
initialize
|
||||||
end
|
end
|
||||||
@@ -46,8 +46,8 @@ 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
|
||||||
req: EWSGI_REQUEST_FROM_TABLE
|
req: WGI_REQUEST_FROM_TABLE
|
||||||
res: EWSGI_RESPONSE_STREAM_BUFFER
|
res: WGI_RESPONSE_STREAM_BUFFER
|
||||||
do
|
do
|
||||||
create req.make (vars, a_input)
|
create req.make (vars, a_input)
|
||||||
create res.make (a_output)
|
create res.make (a_output)
|
||||||
@@ -56,10 +56,10 @@ feature -- Execution
|
|||||||
|
|
||||||
feature -- Input/Output
|
feature -- Input/Output
|
||||||
|
|
||||||
input: EWSGI_INPUT_STREAM
|
input: WGI_INPUT_STREAM
|
||||||
-- Input from client (from httpd server via FCGI)
|
-- Input from client (from httpd server via FCGI)
|
||||||
|
|
||||||
output: EWSGI_OUTPUT_STREAM
|
output: WGI_OUTPUT_STREAM
|
||||||
-- Output to client (via httpd server/fcgi)
|
-- Output to client (via httpd server/fcgi)
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for GW_LIBFCGI_INPUT_STREAM."
|
description: "Summary description for EWF_LIBFCGI_INPUT_STREAM."
|
||||||
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$"
|
||||||
@@ -9,7 +9,7 @@ class
|
|||||||
EWF_LIBFCGI_INPUT_STREAM
|
EWF_LIBFCGI_INPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_INPUT_STREAM
|
WGI_INPUT_STREAM
|
||||||
|
|
||||||
STRING_HANDLER
|
STRING_HANDLER
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
EWF_LIBFCGI_OUTPUT_STREAM
|
EWF_LIBFCGI_OUTPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_OUTPUT_STREAM
|
WGI_OUTPUT_STREAM
|
||||||
|
|
||||||
HTTP_STATUS_CODE_MESSAGES
|
HTTP_STATUS_CODE_MESSAGES
|
||||||
export
|
export
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class
|
|||||||
EWF_NINO_CONNECTOR
|
EWF_NINO_CONNECTOR
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_CONNECTOR
|
WGI_CONNECTOR
|
||||||
redefine
|
redefine
|
||||||
initialize
|
initialize
|
||||||
end
|
end
|
||||||
@@ -73,8 +73,8 @@ 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
|
||||||
req: EWSGI_REQUEST_FROM_TABLE
|
req: WGI_REQUEST_FROM_TABLE
|
||||||
res: EWSGI_RESPONSE_STREAM_BUFFER
|
res: WGI_RESPONSE_STREAM_BUFFER
|
||||||
do
|
do
|
||||||
create req.make (env, create {EWF_NINO_INPUT_STREAM}.make (a_input))
|
create req.make (env, create {EWF_NINO_INPUT_STREAM}.make (a_input))
|
||||||
create res.make (create {EWF_NINO_OUTPUT_STREAM}.make (a_output))
|
create res.make (create {EWF_NINO_OUTPUT_STREAM}.make (a_output))
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
EWF_NINO_INPUT_STREAM
|
EWF_NINO_INPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_INPUT_STREAM
|
WGI_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 {EWF_NINO_CONNECTOR, EWSGI_APPLICATION} -- Nino
|
feature {EWF_NINO_CONNECTOR, WGI_APPLICATION} -- Nino
|
||||||
|
|
||||||
set_nino_input (i: like nino_input)
|
set_nino_input (i: like nino_input)
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class
|
|||||||
EWF_NINO_OUTPUT_STREAM
|
EWF_NINO_OUTPUT_STREAM
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_OUTPUT_STREAM
|
WGI_OUTPUT_STREAM
|
||||||
|
|
||||||
HTTP_STATUS_CODE_MESSAGES
|
HTTP_STATUS_CODE_MESSAGES
|
||||||
export
|
export
|
||||||
@@ -26,7 +26,7 @@ feature {NONE} -- Initialization
|
|||||||
set_nino_output (a_nino_output)
|
set_nino_output (a_nino_output)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWF_NINO_CONNECTOR, EWSGI_APPLICATION} -- Nino
|
feature {EWF_NINO_CONNECTOR, WGI_APPLICATION} -- Nino
|
||||||
|
|
||||||
set_nino_output (o: like nino_output)
|
set_nino_output (o: like nino_output)
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {DEFAULT_EWSGI_APPLICATION}."
|
description: "Summary description for {DEFAULT_WGI_APPLICATION}."
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
DEFAULT_EWSGI_APPLICATION
|
DEFAULT_WGI_APPLICATION
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_APPLICATION
|
WGI_APPLICATION
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make_and_launch
|
make_and_launch
|
||||||
local
|
local
|
||||||
cgi: GW_CGI_CONNECTOR
|
cgi: EWF_CGI_CONNECTOR
|
||||||
do
|
do
|
||||||
create cgi.make (Current)
|
create cgi.make (Current)
|
||||||
cgi.launch
|
cgi.launch
|
||||||
@@ -1,21 +1,24 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {DEFAULT_EWSGI_APPLICATION}."
|
description: "Summary description for {DEFAULT_WGI_APPLICATION}."
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
DEFAULT_EWSGI_APPLICATION
|
DEFAULT_WGI_APPLICATION
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_APPLICATION
|
WGI_APPLICATION
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make_and_launch
|
make_and_launch
|
||||||
|
local
|
||||||
|
app: NINO_APPLICATION
|
||||||
do
|
do
|
||||||
port_number := 80
|
port_number := 8123
|
||||||
print ("Example: start a Nino web server on port " + port_number.out + ", %Nand reply Hello World for any request such as http://localhost:" + port_number.out + "/%N")
|
print ("Example: start a Nino web server on port " + port_number.out + ", %Nand reply Hello World for any request such as http://localhost:" + port_number.out + "/%N")
|
||||||
(create {NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number)
|
create app.make_custom (agent execute, "")
|
||||||
|
app.listen (port_number)
|
||||||
end
|
end
|
||||||
|
|
||||||
port_number: INTEGER
|
port_number: INTEGER
|
||||||
@@ -12,16 +12,16 @@ create
|
|||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
make (a_callback: like {EWSGI_AGENT_APPLICATION}.callback)
|
make (a_callback: like {WGI_AGENT_APPLICATION}.callback)
|
||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
do
|
do
|
||||||
make_custom (a_callback, Void)
|
make_custom (a_callback, Void)
|
||||||
end
|
end
|
||||||
|
|
||||||
make_custom (a_callback: like {EWSGI_AGENT_APPLICATION}.callback; a_base_url: detachable STRING)
|
make_custom (a_callback: like {WGI_AGENT_APPLICATION}.callback; a_base_url: detachable STRING)
|
||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
local
|
local
|
||||||
app: EWSGI_AGENT_APPLICATION
|
app: WGI_AGENT_APPLICATION
|
||||||
do
|
do
|
||||||
create app.make (a_callback)
|
create app.make (a_callback)
|
||||||
create connector.make_with_base (app, a_base_url)
|
create connector.make_with_base (app, a_base_url)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ feature {NONE} -- Initialization
|
|||||||
(create {NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number)
|
(create {NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number)
|
||||||
end
|
end
|
||||||
|
|
||||||
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
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")
|
||||||
|
|||||||
@@ -8,18 +8,18 @@ class
|
|||||||
HELLO_WORLD
|
HELLO_WORLD
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_RESPONSE_APPLICATION
|
WGI_RESPONSE_APPLICATION
|
||||||
|
|
||||||
DEFAULT_EWSGI_APPLICATION
|
DEFAULT_WGI_APPLICATION
|
||||||
|
|
||||||
create
|
create
|
||||||
make_and_launch
|
make_and_launch
|
||||||
|
|
||||||
feature -- Response
|
feature -- Response
|
||||||
|
|
||||||
response (request: EWSGI_REQUEST): EWSGI_RESPONSE
|
response (request: WGI_REQUEST): WGI_RESPONSE
|
||||||
do
|
do
|
||||||
if request.environment.path_info.starts_with ("/streaming/") then
|
if request.path_info.starts_with ("/streaming/") then
|
||||||
Result := streaming_response (request)
|
Result := streaming_response (request)
|
||||||
else
|
else
|
||||||
create Result.make
|
create Result.make
|
||||||
@@ -29,7 +29,7 @@ feature -- Response
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
streaming_response (request: EWSGI_REQUEST): EWSGI_RESPONSE
|
streaming_response (request: WGI_REQUEST): WGI_RESPONSE
|
||||||
do
|
do
|
||||||
create {HELLO_WORLD_RESPONSE} Result.make
|
create {HELLO_WORLD_RESPONSE} Result.make
|
||||||
Result.set_status (200)
|
Result.set_status (200)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ note
|
|||||||
class HELLO_WORLD_RESPONSE
|
class HELLO_WORLD_RESPONSE
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_RESPONSE
|
WGI_RESPONSE
|
||||||
redefine
|
redefine
|
||||||
make,
|
make,
|
||||||
read_block
|
read_block
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {EWSGI_CONNECTOR}."
|
description: "Summary description for {WGI_CONNECTOR}."
|
||||||
author: ""
|
author: ""
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_CONNECTOR
|
WGI_CONNECTOR
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
feature {NONE} -- Access
|
feature {NONE} -- Access
|
||||||
|
|
||||||
application: EWSGI_APPLICATION
|
application: WGI_APPLICATION
|
||||||
-- Gateway Application
|
-- Gateway Application
|
||||||
|
|
||||||
feature -- Server
|
feature -- Server
|
||||||
@@ -8,7 +8,7 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
class
|
class
|
||||||
EWSGI_COOKIE
|
WGI_COOKIE
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -8,7 +8,7 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_VARIABLES [G -> STRING_GENERAL]
|
WGI_VARIABLES [G -> STRING_GENERAL]
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
ITERABLE [G]
|
ITERABLE [G]
|
||||||
@@ -49,7 +49,7 @@ feature -- Access
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWSGI_REQUEST, EWSGI_APPLICATION, EWSGI_CONNECTOR} -- Element change
|
feature {WGI_REQUEST, WGI_APPLICATION, WGI_CONNECTOR} -- Element change
|
||||||
|
|
||||||
set_variable (a_name: STRING; a_value: G)
|
set_variable (a_name: STRING; a_value: G)
|
||||||
require
|
require
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {EWSGI_META_NAMES}."
|
description: "Summary description for {WGI_META_NAMES}."
|
||||||
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
|
||||||
EWSGI_META_NAMES
|
WGI_META_NAMES
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
@@ -71,11 +71,11 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_REQUEST
|
WGI_REQUEST
|
||||||
|
|
||||||
feature -- Access: Input
|
feature -- Access: Input
|
||||||
|
|
||||||
input: EWSGI_INPUT_STREAM
|
input: WGI_INPUT_STREAM
|
||||||
-- Server input channel
|
-- Server input channel
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
@@ -87,16 +87,16 @@ feature -- Access: extra values
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Access: CGI environment variables
|
feature -- Access: CGI meta variables
|
||||||
|
|
||||||
meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_8
|
meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||||
-- Environment variable related to `a_name'
|
-- Environment variable related to `a_name'
|
||||||
require
|
require
|
||||||
a_name_valid: a_name /= Void and then not a_name.is_empty
|
a_name_valid: a_name /= Void and then not a_name.is_empty
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
meta_variables: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_GENERAL]
|
meta_variables: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL]
|
||||||
-- These variables are specific to requests made with HTTP.
|
-- These variables are specific to requests made with HTTP.
|
||||||
-- Interpretation of these variables may depend on the value of
|
-- Interpretation of these variables may depend on the value of
|
||||||
-- SERVER_PROTOCOL.
|
-- SERVER_PROTOCOL.
|
||||||
@@ -128,7 +128,7 @@ feature -- Access: CGI environment variables
|
|||||||
|
|
||||||
feature -- Common Gateway Interface - 1.1 8 January 1996
|
feature -- Common Gateway Interface - 1.1 8 January 1996
|
||||||
|
|
||||||
auth_type: detachable READABLE_STRING_8
|
auth_type: detachable READABLE_STRING_32
|
||||||
-- This variable is specific to requests made via the "http"
|
-- This variable is specific to requests made via the "http"
|
||||||
-- scheme.
|
-- scheme.
|
||||||
--
|
--
|
||||||
@@ -150,7 +150,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
content_length: detachable READABLE_STRING_8
|
content_length: detachable READABLE_STRING_32
|
||||||
-- This metavariable is set to the size of the message-body
|
-- This metavariable is set to the size of the message-body
|
||||||
-- entity attached to the request, if any, in decimal number of
|
-- entity attached to the request, if any, in decimal number of
|
||||||
-- octets. If no data are attached, then this metavariable is
|
-- octets. If no data are attached, then this metavariable is
|
||||||
@@ -170,7 +170,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
content_type: detachable READABLE_STRING_8
|
content_type: detachable READABLE_STRING_32
|
||||||
-- If the request includes a message-body, CONTENT_TYPE is set to
|
-- If the request includes a message-body, CONTENT_TYPE is set to
|
||||||
-- the Internet Media Type [9] of the attached entity if the type
|
-- the Internet Media Type [9] of the attached entity if the type
|
||||||
-- was provided via a "Content-type" field in the request header,
|
-- was provided via a "Content-type" field in the request header,
|
||||||
@@ -213,7 +213,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
gateway_interface: READABLE_STRING_8
|
gateway_interface: READABLE_STRING_32
|
||||||
-- This metavariable is set to the dialect of CGI being used by
|
-- This metavariable is set to the dialect of CGI being used by
|
||||||
-- the server to communicate with the script. Syntax:
|
-- the server to communicate with the script. Syntax:
|
||||||
--
|
--
|
||||||
@@ -246,7 +246,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
path_info: READABLE_STRING_8
|
path_info: READABLE_STRING_32
|
||||||
-- The PATH_INFO metavariable specifies a path to be interpreted
|
-- The PATH_INFO metavariable specifies a path to be interpreted
|
||||||
-- by the CGI script. It identifies the resource or sub-resource
|
-- by the CGI script. It identifies the resource or sub-resource
|
||||||
-- to be returned by the CGI script, and it is derived from the
|
-- to be returned by the CGI script, and it is derived from the
|
||||||
@@ -277,7 +277,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
path_translated: detachable READABLE_STRING_8
|
path_translated: detachable READABLE_STRING_32
|
||||||
-- PATH_TRANSLATED is derived by taking any path-info component
|
-- PATH_TRANSLATED is derived by taking any path-info component
|
||||||
-- of the request URI (see section 6.1.6), decoding it (see
|
-- of the request URI (see section 6.1.6), decoding it (see
|
||||||
-- section 3.1), parsing it as a URI in its own right, and
|
-- section 3.1), parsing it as a URI in its own right, and
|
||||||
@@ -323,7 +323,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
query_string: READABLE_STRING_8
|
query_string: READABLE_STRING_32
|
||||||
-- A URL-encoded string; the <query> part of the Script-URI. (See
|
-- A URL-encoded string; the <query> part of the Script-URI. (See
|
||||||
-- section 3.2.)
|
-- section 3.2.)
|
||||||
--
|
--
|
||||||
@@ -340,7 +340,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
remote_addr: READABLE_STRING_8
|
remote_addr: READABLE_STRING_32
|
||||||
-- The IP address of the client sending the request to the
|
-- The IP address of the client sending the request to the
|
||||||
-- server. This is not necessarily that of the user agent (such
|
-- server. This is not necessarily that of the user agent (such
|
||||||
-- as if the request came through a proxy).
|
-- as if the request came through a proxy).
|
||||||
@@ -355,7 +355,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
remote_host: detachable READABLE_STRING_8
|
remote_host: detachable READABLE_STRING_32
|
||||||
-- The fully qualified domain name of the client sending the
|
-- The fully qualified domain name of the client sending the
|
||||||
-- request to the server, if available, otherwise NULL. (See
|
-- request to the server, if available, otherwise NULL. (See
|
||||||
-- section 6.1.9.) Fully qualified domain names take the form as
|
-- section 6.1.9.) Fully qualified domain names take the form as
|
||||||
@@ -366,7 +366,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
remote_ident: detachable READABLE_STRING_8
|
remote_ident: detachable READABLE_STRING_32
|
||||||
-- The identity information reported about the connection by a
|
-- The identity information reported about the connection by a
|
||||||
-- RFC 1413 [11] request to the remote agent, if available.
|
-- RFC 1413 [11] request to the remote agent, if available.
|
||||||
-- Servers MAY choose not to support this feature, or not to
|
-- Servers MAY choose not to support this feature, or not to
|
||||||
@@ -382,7 +382,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
remote_user: detachable READABLE_STRING_8
|
remote_user: detachable READABLE_STRING_32
|
||||||
-- If the request required authentication using the "Basic"
|
-- If the request required authentication using the "Basic"
|
||||||
-- mechanism (i.e., the AUTH_TYPE metavariable is set to
|
-- mechanism (i.e., the AUTH_TYPE metavariable is set to
|
||||||
-- "Basic"), then the value of the REMOTE_USER metavariable is
|
-- "Basic"), then the value of the REMOTE_USER metavariable is
|
||||||
@@ -398,7 +398,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
request_method: READABLE_STRING_8
|
request_method: READABLE_STRING_32
|
||||||
-- The REQUEST_METHOD metavariable is set to the method with
|
-- The REQUEST_METHOD metavariable is set to the method with
|
||||||
-- which the request was made, as described in section 5.1.1 of
|
-- which the request was made, as described in section 5.1.1 of
|
||||||
-- the HTTP/1.0 specification [3] and section 5.1.1 of the
|
-- the HTTP/1.0 specification [3] and section 5.1.1 of the
|
||||||
@@ -419,7 +419,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
script_name: READABLE_STRING_8
|
script_name: READABLE_STRING_32
|
||||||
-- The SCRIPT_NAME metavariable is set to a URL path that could
|
-- The SCRIPT_NAME metavariable is set to a URL path that could
|
||||||
-- identify the CGI script (rather than the script's output). The
|
-- identify the CGI script (rather than the script's output). The
|
||||||
-- syntax and semantics are identical to a decoded HTTP URL
|
-- syntax and semantics are identical to a decoded HTTP URL
|
||||||
@@ -437,7 +437,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
server_name: READABLE_STRING_8
|
server_name: READABLE_STRING_32
|
||||||
-- The SERVER_NAME metavariable is set to the name of the server,
|
-- The SERVER_NAME metavariable is set to the name of the server,
|
||||||
-- as derived from the <host> part of the Script-URI (see section
|
-- as derived from the <host> part of the Script-URI (see section
|
||||||
-- 3.2).
|
-- 3.2).
|
||||||
@@ -463,7 +463,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
server_protocol: READABLE_STRING_8
|
server_protocol: READABLE_STRING_32
|
||||||
-- The SERVER_PROTOCOL metavariable is set to the name and
|
-- The SERVER_PROTOCOL metavariable is set to the name and
|
||||||
-- revision of the information protocol with which the request
|
-- revision of the information protocol with which the request
|
||||||
-- arrived. This is not necessarily the same as the protocol
|
-- arrived. This is not necessarily the same as the protocol
|
||||||
@@ -491,7 +491,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
server_software: READABLE_STRING_8
|
server_software: READABLE_STRING_32
|
||||||
-- The SERVER_SOFTWARE metavariable is set to the name and
|
-- The SERVER_SOFTWARE metavariable is set to the name and
|
||||||
-- version of the information server software answering the
|
-- version of the information server software answering the
|
||||||
-- request (and running the gateway).
|
-- request (and running the gateway).
|
||||||
@@ -506,42 +506,42 @@ feature -- Common Gateway Interface - 1.1 8 January 1996
|
|||||||
|
|
||||||
feature -- HTTP_*
|
feature -- HTTP_*
|
||||||
|
|
||||||
http_accept: detachable READABLE_STRING_8
|
http_accept: detachable READABLE_STRING_32
|
||||||
-- Contents of the Accept: header from the current request, if there is one.
|
-- Contents of the Accept: header from the current request, if there is one.
|
||||||
-- Example: 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
|
-- Example: 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
http_accept_charset: detachable READABLE_STRING_8
|
http_accept_charset: detachable READABLE_STRING_32
|
||||||
-- Contents of the Accept-Charset: header from the current request, if there is one.
|
-- Contents of the Accept-Charset: header from the current request, if there is one.
|
||||||
-- Example: 'iso-8859-1,*,utf-8'.
|
-- Example: 'iso-8859-1,*,utf-8'.
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
http_accept_encoding: detachable READABLE_STRING_8
|
http_accept_encoding: detachable READABLE_STRING_32
|
||||||
-- Contents of the Accept-Encoding: header from the current request, if there is one.
|
-- Contents of the Accept-Encoding: header from the current request, if there is one.
|
||||||
-- Example: 'gzip'.
|
-- Example: 'gzip'.
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
http_accept_language: detachable READABLE_STRING_8
|
http_accept_language: detachable READABLE_STRING_32
|
||||||
-- Contents of the Accept-Language: header from the current request, if there is one.
|
-- Contents of the Accept-Language: header from the current request, if there is one.
|
||||||
-- Example: 'en'.
|
-- Example: 'en'.
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
http_connection: detachable READABLE_STRING_8
|
http_connection: detachable READABLE_STRING_32
|
||||||
-- Contents of the Connection: header from the current request, if there is one.
|
-- Contents of the Connection: header from the current request, if there is one.
|
||||||
-- Example: 'Keep-Alive'.
|
-- Example: 'Keep-Alive'.
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
http_host: detachable READABLE_STRING_8
|
http_host: detachable READABLE_STRING_32
|
||||||
-- Contents of the Host: header from the current request, if there is one.
|
-- Contents of the Host: header from the current request, if there is one.
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
http_referer: detachable READABLE_STRING_8
|
http_referer: detachable READABLE_STRING_32
|
||||||
-- The address of the page (if any) which referred the user agent to the current page.
|
-- The address of the page (if any) which referred the user agent to the current page.
|
||||||
-- This is set by the user agent.
|
-- This is set by the user agent.
|
||||||
-- Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature.
|
-- Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature.
|
||||||
@@ -549,7 +549,7 @@ feature -- HTTP_*
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
http_user_agent: detachable READABLE_STRING_8
|
http_user_agent: detachable READABLE_STRING_32
|
||||||
-- Contents of the User-Agent: header from the current request, if there is one.
|
-- Contents of the User-Agent: header from the current request, if there is one.
|
||||||
-- This is a string denoting the user agent being which is accessing the page.
|
-- This is a string denoting the user agent being which is accessing the page.
|
||||||
-- A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586).
|
-- A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586).
|
||||||
@@ -558,26 +558,26 @@ feature -- HTTP_*
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
http_authorization: detachable READABLE_STRING_8
|
http_authorization: detachable READABLE_STRING_32
|
||||||
-- Contents of the Authorization: header from the current request, if there is one.
|
-- Contents of the Authorization: header from the current request, if there is one.
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Extra CGI environment variables
|
feature -- Extra CGI environment variables
|
||||||
|
|
||||||
request_uri: READABLE_STRING_8
|
request_uri: READABLE_STRING_32
|
||||||
-- The URI which was given in order to access this page; for instance, '/index.html'.
|
-- The URI which was given in order to access this page; for instance, '/index.html'.
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
orig_path_info: detachable READABLE_STRING_8
|
orig_path_info: detachable READABLE_STRING_32
|
||||||
-- Original version of `path_info' before processed by Current environment
|
-- Original version of `path_info' before processed by Current environment
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
--feature -- Access: execution variables
|
--feature -- Access: execution variables
|
||||||
|
|
||||||
-- execution_variables: EWSGI_VARIABLES [STRING_32]
|
-- execution_variables: WGI_VARIABLES [STRING_32]
|
||||||
-- -- Execution variables set by the application
|
-- -- Execution variables set by the application
|
||||||
-- deferred
|
-- deferred
|
||||||
-- end
|
-- end
|
||||||
@@ -617,7 +617,7 @@ feature -- Form fields and related
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
uploaded_files: HASH_TABLE [EWSGI_UPLOADED_FILE_DATA, READABLE_STRING_GENERAL]
|
uploaded_files: HASH_TABLE [WGI_UPLOADED_FILE_DATA, READABLE_STRING_GENERAL]
|
||||||
-- Table of uploaded files information
|
-- Table of uploaded files information
|
||||||
--| name: original path from the user
|
--| name: original path from the user
|
||||||
--| type: content type
|
--| type: content type
|
||||||
@@ -689,10 +689,10 @@ invariant
|
|||||||
query_string_attached: query_string /= Void
|
query_string_attached: query_string /= Void
|
||||||
remote_addr_attached: remote_addr /= Void
|
remote_addr_attached: remote_addr /= Void
|
||||||
|
|
||||||
same_orig_path_info: orig_path_info ~ meta_variable ({EWSGI_META_NAMES}.orig_path_info)
|
same_orig_path_info: orig_path_info ~ meta_variable ({WGI_META_NAMES}.orig_path_info)
|
||||||
same_path_info: path_info ~ meta_variable ({EWSGI_META_NAMES}.path_info)
|
same_path_info: path_info ~ meta_variable ({WGI_META_NAMES}.path_info)
|
||||||
|
|
||||||
path_info_identical: path_info ~ meta_variable ({EWSGI_META_NAMES}.path_info)
|
path_info_identical: path_info ~ meta_variable ({WGI_META_NAMES}.path_info)
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2011, Eiffel Software and others"
|
copyright: "2011-2011, Eiffel Software and others"
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {GW_UPLOADED_FILE}."
|
description: "Summary description for {WGI_UPLOADED_FILE_DATA}."
|
||||||
author: ""
|
author: ""
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
class
|
class
|
||||||
EWSGI_UPLOADED_FILE_DATA
|
WGI_UPLOADED_FILE_DATA
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {EWSGI_RESPONSE_BUFFER}."
|
description: "Summary description for {WGI_RESPONSE_BUFFER}."
|
||||||
author: ""
|
author: ""
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_RESPONSE_BUFFER
|
WGI_RESPONSE_BUFFER
|
||||||
|
|
||||||
feature {EWSGI_APPLICATION} -- Commit
|
feature {WGI_APPLICATION} -- Commit
|
||||||
|
|
||||||
commit
|
commit
|
||||||
-- Commit the current response
|
-- Commit the current response
|
||||||
@@ -35,7 +35,7 @@ feature -- Status report
|
|||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWSGI_RESPONSE_BUFFER} -- Core output operation
|
feature {WGI_RESPONSE_BUFFER} -- Core output operation
|
||||||
|
|
||||||
write (s: STRING)
|
write (s: STRING)
|
||||||
-- Send the string `s'
|
-- Send the string `s'
|
||||||
@@ -8,7 +8,7 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_INPUT_STREAM
|
WGI_INPUT_STREAM
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_OUTPUT_STREAM
|
WGI_OUTPUT_STREAM
|
||||||
|
|
||||||
feature -- Core operation
|
feature -- Core operation
|
||||||
|
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {EWSGI_APPLICATION}."
|
description: "Summary description for {WGI_APPLICATION}."
|
||||||
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$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_APPLICATION
|
WGI_APPLICATION
|
||||||
|
|
||||||
feature {NONE} -- Execution
|
feature {NONE} -- Execution
|
||||||
|
|
||||||
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Execute the request
|
-- Execute the request
|
||||||
-- See `req.input' for input stream
|
-- See `req.input' for input stream
|
||||||
-- `req.environment' for the Gateway environment
|
-- `req.environment' for the Gateway environment
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {EWSGI_AGENT_APPLICATION}."
|
description: "Summary description for {WGI_AGENT_APPLICATION}."
|
||||||
author: ""
|
author: ""
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
class
|
class
|
||||||
EWSGI_AGENT_APPLICATION
|
WGI_AGENT_APPLICATION
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_APPLICATION
|
WGI_APPLICATION
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -23,10 +23,10 @@ feature {NONE} -- Implementation
|
|||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
callback: PROCEDURE [ANY, TUPLE [req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER]]
|
callback: PROCEDURE [ANY, TUPLE [req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]]
|
||||||
-- Procedure called on `execute'
|
-- Procedure called on `execute'
|
||||||
|
|
||||||
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Execute the request
|
-- Execute the request
|
||||||
do
|
do
|
||||||
callback.call ([req, res])
|
callback.call ([req, res])
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
note
|
note
|
||||||
description: "[
|
description: "[
|
||||||
EWSGI_APPLICATION
|
WGI_APPLICATION
|
||||||
]"
|
]"
|
||||||
specification: "EWSGI specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification"
|
specification: "EWSGI specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification"
|
||||||
legal: "See notice at end of class."
|
legal: "See notice at end of class."
|
||||||
@@ -9,11 +9,11 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_APPLICATION
|
WGI_APPLICATION
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Execute the request
|
-- Execute the request
|
||||||
-- See `req.input' for input stream
|
-- See `req.input' for input stream
|
||||||
-- `req.environment' for the Gateway environment
|
-- `req.environment' for the Gateway environment
|
||||||
@@ -28,7 +28,7 @@ feature -- Execution
|
|||||||
|
|
||||||
feature -- Process request
|
feature -- Process request
|
||||||
|
|
||||||
process (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
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
|
||||||
@@ -53,17 +53,17 @@ feature -- Access
|
|||||||
|
|
||||||
feature {NONE} -- Execution
|
feature {NONE} -- Execution
|
||||||
|
|
||||||
pre_execute (req: EWSGI_REQUEST)
|
pre_execute (req: WGI_REQUEST)
|
||||||
-- Operation processed before `execute'
|
-- Operation processed before `execute'
|
||||||
do
|
do
|
||||||
end
|
end
|
||||||
|
|
||||||
post_execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
post_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Operation processed after `execute', or after `rescue_execute'
|
-- Operation processed after `execute', or after `rescue_execute'
|
||||||
do
|
do
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue_execute (req: EWSGI_REQUEST; res: EWSGI_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
|
||||||
if
|
if
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {EWSGI_CONNECTOR}."
|
description: "Summary description for {WGI_CONNECTOR}."
|
||||||
specification: "EWSGI/connector specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification"
|
specification: "EWSGI/connector specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification"
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_CONNECTOR
|
WGI_CONNECTOR
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
feature {NONE} -- Access
|
feature {NONE} -- Access
|
||||||
|
|
||||||
application: EWSGI_APPLICATION
|
application: WGI_APPLICATION
|
||||||
-- Gateway Application
|
-- Gateway Application
|
||||||
|
|
||||||
feature -- Server
|
feature -- Server
|
||||||
@@ -8,9 +8,9 @@ class
|
|||||||
EWF_BUFFERED_RESPONSE
|
EWF_BUFFERED_RESPONSE
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_RESPONSE_BUFFER
|
WGI_RESPONSE_BUFFER
|
||||||
|
|
||||||
create {EWSGI_APPLICATION}
|
create {WGI_APPLICATION}
|
||||||
make
|
make
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
@@ -22,7 +22,7 @@ feature {NONE} -- Initialization
|
|||||||
create buffer.make (a_buffer_size)
|
create buffer.make (a_buffer_size)
|
||||||
end
|
end
|
||||||
|
|
||||||
response_buffer: EWSGI_RESPONSE_BUFFER
|
response_buffer: WGI_RESPONSE_BUFFER
|
||||||
|
|
||||||
buffer: STRING_8
|
buffer: STRING_8
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ feature {NONE} -- Implementation
|
|||||||
buffer_flushed: buffer_count = 0 and buffer.count = 0
|
buffer_flushed: buffer_count = 0 and buffer.count = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWSGI_APPLICATION} -- Commit
|
feature {WGI_APPLICATION} -- Commit
|
||||||
|
|
||||||
commit
|
commit
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -7,27 +7,27 @@ class
|
|||||||
EWF_IN_MEMORY_RESPONSE
|
EWF_IN_MEMORY_RESPONSE
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_RESPONSE_BUFFER
|
WGI_RESPONSE_BUFFER
|
||||||
|
|
||||||
create {EWSGI_APPLICATION}
|
create {WGI_APPLICATION}
|
||||||
make
|
make
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make (res: EWSGI_RESPONSE_BUFFER)
|
make (res: WGI_RESPONSE_BUFFER)
|
||||||
do
|
do
|
||||||
response_buffer := res
|
response_buffer := res
|
||||||
create header.make
|
create header.make
|
||||||
create body.make (100)
|
create body.make (100)
|
||||||
end
|
end
|
||||||
|
|
||||||
response_buffer: EWSGI_RESPONSE_BUFFER
|
response_buffer: WGI_RESPONSE_BUFFER
|
||||||
|
|
||||||
header: EWF_HEADER
|
header: EWF_HEADER
|
||||||
|
|
||||||
body: STRING_8
|
body: STRING_8
|
||||||
|
|
||||||
feature {EWSGI_APPLICATION} -- Commit
|
feature {WGI_APPLICATION} -- Commit
|
||||||
|
|
||||||
commit
|
commit
|
||||||
local
|
local
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ deferred class
|
|||||||
EWF_IN_MEMORY_RESPONSE_APPLICATION
|
EWF_IN_MEMORY_RESPONSE_APPLICATION
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_APPLICATION
|
WGI_APPLICATION
|
||||||
rename
|
rename
|
||||||
execute as app_execute
|
execute as app_execute
|
||||||
end
|
end
|
||||||
@@ -16,7 +16,7 @@ inherit
|
|||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
app_execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
app_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Execute the request
|
-- Execute the request
|
||||||
-- See `req.input' for input stream
|
-- See `req.input' for input stream
|
||||||
-- `req.environment' for the Gateway environment
|
-- `req.environment' for the Gateway environment
|
||||||
@@ -27,7 +27,7 @@ feature -- Execution
|
|||||||
|
|
||||||
feature -- Execute
|
feature -- Execute
|
||||||
|
|
||||||
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Execute the request
|
-- Execute the request
|
||||||
-- See `req.input' for input stream
|
-- See `req.input' for input stream
|
||||||
-- `req.environment' for the Gateway environment
|
-- `req.environment' for the Gateway environment
|
||||||
@@ -41,7 +41,7 @@ feature -- Execute
|
|||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
new_response (req: EWSGI_REQUEST; a_res: EWSGI_RESPONSE_BUFFER): EWF_IN_MEMORY_RESPONSE
|
new_response (req: WGI_REQUEST; a_res: WGI_RESPONSE_BUFFER): EWF_IN_MEMORY_RESPONSE
|
||||||
do
|
do
|
||||||
create {EWF_IN_MEMORY_RESPONSE} Result.make (a_res)
|
create {EWF_IN_MEMORY_RESPONSE} Result.make (a_res)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ note
|
|||||||
author: "Paul Cohen <paul.cohen@seibostudio.se>"
|
author: "Paul Cohen <paul.cohen@seibostudio.se>"
|
||||||
status: "Draft"
|
status: "Draft"
|
||||||
|
|
||||||
class EWSGI_RESPONSE
|
class WGI_RESPONSE
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -26,9 +26,9 @@ feature {NONE} -- Initialization
|
|||||||
create headers_table.make (10)
|
create headers_table.make (10)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWSGI_RESPONSE_APPLICATION} -- Response status
|
feature {WGI_RESPONSE_APPLICATION} -- Response status
|
||||||
|
|
||||||
transmit_to (res: EWSGI_RESPONSE_BUFFER)
|
transmit_to (res: WGI_RESPONSE_BUFFER)
|
||||||
do
|
do
|
||||||
res.set_status_code (status)
|
res.set_status_code (status)
|
||||||
res.write_headers_string (headers)
|
res.write_headers_string (headers)
|
||||||
@@ -64,7 +64,7 @@ feature {EWSGI_RESPONSE_APPLICATION} -- Response status
|
|||||||
ready_to_transmit
|
ready_to_transmit
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWSGI_RESPONSE_APPLICATION} -- Message start line and status
|
feature {WGI_RESPONSE_APPLICATION} -- Message start line and status
|
||||||
|
|
||||||
status: INTEGER
|
status: INTEGER
|
||||||
-- HTTP status code
|
-- HTTP status code
|
||||||
@@ -88,7 +88,7 @@ feature {EWSGI_RESPONSE_APPLICATION} -- Message start line and status
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWSGI_RESPONSE_APPLICATION} -- Message headers
|
feature {WGI_RESPONSE_APPLICATION} -- Message headers
|
||||||
|
|
||||||
headers: STRING
|
headers: STRING
|
||||||
-- HTTP message headers including trailing empty line.
|
-- HTTP message headers including trailing empty line.
|
||||||
@@ -119,7 +119,7 @@ feature {EWSGI_RESPONSE_APPLICATION} -- Message headers
|
|||||||
headers_table.has (key) and headers_table @ key = value
|
headers_table.has (key) and headers_table @ key = value
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWSGI_RESPONSE_APPLICATION} -- Message body
|
feature {WGI_RESPONSE_APPLICATION} -- Message body
|
||||||
|
|
||||||
read_block
|
read_block
|
||||||
-- Read a message body block.
|
-- Read a message body block.
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {EWSGI_RESPONSE_APPLICATION} "
|
description: "Summary description for {WGI_RESPONSE_APPLICATION} "
|
||||||
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$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_RESPONSE_APPLICATION
|
WGI_RESPONSE_APPLICATION
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Execute the request
|
-- Execute the request
|
||||||
-- See `req.input' for input stream
|
-- See `req.input' for input stream
|
||||||
-- `req.environment' for the Gateway environment
|
-- `req.environment' for the Gateway environment
|
||||||
-- and `res.output' for output stream
|
-- and `res.output' for output stream
|
||||||
local
|
local
|
||||||
rs: EWSGI_RESPONSE
|
rs: WGI_RESPONSE
|
||||||
do
|
do
|
||||||
rs := response (req)
|
rs := response (req)
|
||||||
if rs.ready_to_transmit then
|
if rs.ready_to_transmit then
|
||||||
@@ -24,7 +24,7 @@ feature -- Execution
|
|||||||
else
|
else
|
||||||
-- Report internal server error.
|
-- Report internal server error.
|
||||||
-- Response not ready to transmit!
|
-- Response not ready to transmit!
|
||||||
-- Implementor of EWSGI_APPLICATION has not done his job!
|
-- Implementor of WGI_APPLICATION has not done his job!
|
||||||
create rs.make
|
create rs.make
|
||||||
rs.set_status (500)
|
rs.set_status (500)
|
||||||
rs.set_header ("Content-Type", "text/plain")
|
rs.set_header ("Content-Type", "text/plain")
|
||||||
@@ -35,7 +35,7 @@ feature -- Execution
|
|||||||
|
|
||||||
feature -- Response
|
feature -- Response
|
||||||
|
|
||||||
response (request: EWSGI_REQUEST): EWSGI_RESPONSE
|
response (request: WGI_REQUEST): WGI_RESPONSE
|
||||||
-- HTTP response for given 'request'.
|
-- HTTP response for given 'request'.
|
||||||
deferred
|
deferred
|
||||||
ensure
|
ensure
|
||||||
@@ -9,17 +9,17 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
class
|
class
|
||||||
EWSGI_REQUEST_FROM_TABLE
|
WGI_REQUEST_FROM_TABLE
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_REQUEST
|
WGI_REQUEST
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make (a_vars: HASH_TABLE [STRING, STRING]; a_input: like input)
|
make (a_vars: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8]; a_input: like input)
|
||||||
require
|
require
|
||||||
vars_attached: a_vars /= Void
|
vars_attached: a_vars /= Void
|
||||||
do
|
do
|
||||||
@@ -34,11 +34,11 @@ feature {NONE} -- Initialization
|
|||||||
analyze
|
analyze
|
||||||
end
|
end
|
||||||
|
|
||||||
set_meta_parameters (a_vars: HASH_TABLE [STRING, STRING])
|
set_meta_parameters (a_vars: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_8])
|
||||||
-- Fill with variable from `a_vars'
|
-- Fill with variable from `a_vars'
|
||||||
local
|
local
|
||||||
s: detachable READABLE_STRING_8
|
s: like meta_variable
|
||||||
table: HASH_TABLE [STRING, STRING]
|
table: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL]
|
||||||
do
|
do
|
||||||
create empty_string.make_empty
|
create empty_string.make_empty
|
||||||
|
|
||||||
@@ -54,13 +54,13 @@ feature {NONE} -- Initialization
|
|||||||
end
|
end
|
||||||
|
|
||||||
--| QUERY_STRING
|
--| QUERY_STRING
|
||||||
query_string := meta_parameter_or_default ({EWSGI_META_NAMES}.query_string, empty_string, False)
|
query_string := meta_parameter_or_default ({WGI_META_NAMES}.query_string, empty_string, False)
|
||||||
|
|
||||||
--| REQUEST_METHOD
|
--| REQUEST_METHOD
|
||||||
request_method := meta_parameter_or_default ({EWSGI_META_NAMES}.request_method, empty_string, False)
|
request_method := meta_parameter_or_default ({WGI_META_NAMES}.request_method, empty_string, False)
|
||||||
|
|
||||||
--| CONTENT_TYPE
|
--| CONTENT_TYPE
|
||||||
s := meta_variable ({EWSGI_META_NAMES}.content_type)
|
s := meta_variable ({WGI_META_NAMES}.content_type)
|
||||||
if s /= Void and then not s.is_empty then
|
if s /= Void and then not s.is_empty then
|
||||||
content_type := s
|
content_type := s
|
||||||
else
|
else
|
||||||
@@ -68,7 +68,7 @@ feature {NONE} -- Initialization
|
|||||||
end
|
end
|
||||||
|
|
||||||
--| CONTENT_LENGTH
|
--| CONTENT_LENGTH
|
||||||
s := meta_variable ({EWSGI_META_NAMES}.content_length)
|
s := meta_variable ({WGI_META_NAMES}.content_length)
|
||||||
content_length := s
|
content_length := s
|
||||||
if s /= Void and then s.is_natural_64 then
|
if s /= Void and then s.is_natural_64 then
|
||||||
content_length_value := s.to_natural_64
|
content_length_value := s.to_natural_64
|
||||||
@@ -77,13 +77,13 @@ feature {NONE} -- Initialization
|
|||||||
end
|
end
|
||||||
|
|
||||||
--| PATH_INFO
|
--| PATH_INFO
|
||||||
path_info := meta_parameter_or_default ({EWSGI_META_NAMES}.path_info, empty_string, False)
|
path_info := meta_parameter_or_default ({WGI_META_NAMES}.path_info, empty_string, False)
|
||||||
|
|
||||||
--| SERVER_NAME
|
--| SERVER_NAME
|
||||||
server_name := meta_parameter_or_default ({EWSGI_META_NAMES}.server_name, empty_string, False)
|
server_name := meta_parameter_or_default ({WGI_META_NAMES}.server_name, empty_string, False)
|
||||||
|
|
||||||
--| SERVER_PORT
|
--| SERVER_PORT
|
||||||
s := meta_variable ({EWSGI_META_NAMES}.server_port)
|
s := meta_variable ({WGI_META_NAMES}.server_port)
|
||||||
if s /= Void and then s.is_integer then
|
if s /= Void and then s.is_integer then
|
||||||
server_port := s.to_integer
|
server_port := s.to_integer
|
||||||
else
|
else
|
||||||
@@ -91,16 +91,16 @@ feature {NONE} -- Initialization
|
|||||||
end
|
end
|
||||||
|
|
||||||
--| SCRIPT_NAME
|
--| SCRIPT_NAME
|
||||||
script_name := meta_parameter_or_default ({EWSGI_META_NAMES}.script_name, empty_string, False)
|
script_name := meta_parameter_or_default ({WGI_META_NAMES}.script_name, empty_string, False)
|
||||||
|
|
||||||
--| REMOTE_ADDR
|
--| REMOTE_ADDR
|
||||||
remote_addr := meta_parameter_or_default ({EWSGI_META_NAMES}.remote_addr, empty_string, False)
|
remote_addr := meta_parameter_or_default ({WGI_META_NAMES}.remote_addr, empty_string, False)
|
||||||
|
|
||||||
--| REMOTE_HOST
|
--| REMOTE_HOST
|
||||||
remote_host := meta_parameter_or_default ({EWSGI_META_NAMES}.remote_host, empty_string, False)
|
remote_host := meta_parameter_or_default ({WGI_META_NAMES}.remote_host, empty_string, False)
|
||||||
|
|
||||||
--| REQUEST_URI
|
--| REQUEST_URI
|
||||||
request_uri := meta_parameter_or_default ({EWSGI_META_NAMES}.request_uri, empty_string, False)
|
request_uri := meta_parameter_or_default ({WGI_META_NAMES}.request_uri, empty_string, False)
|
||||||
end
|
end
|
||||||
|
|
||||||
initialize
|
initialize
|
||||||
@@ -114,13 +114,13 @@ feature {NONE} -- Initialization
|
|||||||
if attached request_uri as rq_uri then
|
if attached request_uri as rq_uri then
|
||||||
p := rq_uri.index_of ('?', 1)
|
p := rq_uri.index_of ('?', 1)
|
||||||
if p > 0 then
|
if p > 0 then
|
||||||
set_meta_parameter (rq_uri.substring (1, p-1), {EWSGI_META_NAMES}.self)
|
set_meta_parameter (rq_uri.substring (1, p-1), {WGI_META_NAMES}.self)
|
||||||
else
|
else
|
||||||
set_meta_parameter (rq_uri, {EWSGI_META_NAMES}.self)
|
set_meta_parameter (rq_uri, {WGI_META_NAMES}.self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if meta_variable ({EWSGI_META_NAMES}.request_time) = Void then
|
if meta_variable ({WGI_META_NAMES}.request_time) = Void then
|
||||||
set_meta_parameter (date_time_utilities.unix_time_stamp (Void).out, {EWSGI_META_NAMES}.request_time)
|
set_meta_parameter (date_time_utilities.unix_time_stamp (Void).out, {WGI_META_NAMES}.request_time)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ feature -- Error handling
|
|||||||
|
|
||||||
feature -- Access: Input
|
feature -- Access: Input
|
||||||
|
|
||||||
input: EWSGI_INPUT_STREAM
|
input: WGI_INPUT_STREAM
|
||||||
-- Server input channel
|
-- Server input channel
|
||||||
|
|
||||||
feature -- Access extra information
|
feature -- Access extra information
|
||||||
@@ -160,7 +160,7 @@ feature -- Access extra information
|
|||||||
-- Request time (UTC)
|
-- Request time (UTC)
|
||||||
do
|
do
|
||||||
if
|
if
|
||||||
attached meta_variable ({EWSGI_META_NAMES}.request_time) as t and then
|
attached meta_variable ({WGI_META_NAMES}.request_time) as t and then
|
||||||
t.is_integer_64
|
t.is_integer_64
|
||||||
then
|
then
|
||||||
Result := date_time_utilities.unix_time_stamp_to_date_time (t.to_integer_64)
|
Result := date_time_utilities.unix_time_stamp_to_date_time (t.to_integer_64)
|
||||||
@@ -169,16 +169,16 @@ feature -- Access extra information
|
|||||||
|
|
||||||
feature -- Access: CGI meta parameters
|
feature -- Access: CGI meta parameters
|
||||||
|
|
||||||
meta_variables: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_GENERAL]
|
meta_variables: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL]
|
||||||
-- CGI Environment parameters
|
-- CGI Environment parameters
|
||||||
|
|
||||||
meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_8
|
meta_variable (a_name: READABLE_STRING_GENERAL): detachable READABLE_STRING_32
|
||||||
-- CGI meta variable related to `a_name'
|
-- CGI meta variable related to `a_name'
|
||||||
do
|
do
|
||||||
Result := meta_variables.item (a_name)
|
Result := meta_variables.item (a_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
meta_parameter_or_default (a_name: READABLE_STRING_GENERAL; a_default: READABLE_STRING_8; use_default_when_empty: BOOLEAN): READABLE_STRING_8
|
meta_parameter_or_default (a_name: READABLE_STRING_GENERAL; a_default: READABLE_STRING_32; use_default_when_empty: BOOLEAN): READABLE_STRING_32
|
||||||
-- Value for meta parameter `a_name'
|
-- Value for meta parameter `a_name'
|
||||||
-- If not found, return `a_default'
|
-- If not found, return `a_default'
|
||||||
require
|
require
|
||||||
@@ -195,7 +195,7 @@ feature -- Access: CGI meta parameters
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
set_meta_parameter (a_name: READABLE_STRING_GENERAL; a_value: STRING)
|
set_meta_parameter (a_name: READABLE_STRING_GENERAL; a_value: READABLE_STRING_32)
|
||||||
do
|
do
|
||||||
meta_variables.force (a_value, a_name)
|
meta_variables.force (a_value, a_name)
|
||||||
ensure
|
ensure
|
||||||
@@ -211,20 +211,20 @@ feature -- Access: CGI meta parameters
|
|||||||
|
|
||||||
feature -- Access: CGI meta parameters - 1.1
|
feature -- Access: CGI meta parameters - 1.1
|
||||||
|
|
||||||
auth_type: detachable READABLE_STRING_8
|
auth_type: detachable READABLE_STRING_32
|
||||||
|
|
||||||
content_length: detachable READABLE_STRING_8
|
content_length: detachable READABLE_STRING_32
|
||||||
|
|
||||||
content_length_value: NATURAL_64
|
content_length_value: NATURAL_64
|
||||||
|
|
||||||
content_type: detachable READABLE_STRING_8
|
content_type: detachable READABLE_STRING_32
|
||||||
|
|
||||||
gateway_interface: READABLE_STRING_8
|
gateway_interface: READABLE_STRING_32
|
||||||
do
|
do
|
||||||
Result := meta_parameter_or_default ({EWSGI_META_NAMES}.gateway_interface, "", False)
|
Result := meta_parameter_or_default ({WGI_META_NAMES}.gateway_interface, "", False)
|
||||||
end
|
end
|
||||||
|
|
||||||
path_info: READABLE_STRING_8
|
path_info: READABLE_STRING_32
|
||||||
-- <Precursor/>
|
-- <Precursor/>
|
||||||
--
|
--
|
||||||
--| For instance, if the current script was accessed via the URL
|
--| For instance, if the current script was accessed via the URL
|
||||||
@@ -232,138 +232,138 @@ feature -- Access: CGI meta parameters - 1.1
|
|||||||
--|
|
--|
|
||||||
--| Note that is the PATH_INFO variable does not exists, the `path_info' value will be empty
|
--| Note that is the PATH_INFO variable does not exists, the `path_info' value will be empty
|
||||||
|
|
||||||
path_translated: detachable READABLE_STRING_8
|
path_translated: detachable READABLE_STRING_32
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.path_translated)
|
Result := meta_variable ({WGI_META_NAMES}.path_translated)
|
||||||
end
|
end
|
||||||
|
|
||||||
query_string: READABLE_STRING_8
|
query_string: READABLE_STRING_32
|
||||||
|
|
||||||
remote_addr: READABLE_STRING_8
|
remote_addr: READABLE_STRING_32
|
||||||
|
|
||||||
remote_host: READABLE_STRING_8
|
remote_host: READABLE_STRING_32
|
||||||
|
|
||||||
remote_ident: detachable READABLE_STRING_8
|
remote_ident: detachable READABLE_STRING_32
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.remote_ident)
|
Result := meta_variable ({WGI_META_NAMES}.remote_ident)
|
||||||
end
|
end
|
||||||
|
|
||||||
remote_user: detachable READABLE_STRING_8
|
remote_user: detachable READABLE_STRING_32
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.remote_user)
|
Result := meta_variable ({WGI_META_NAMES}.remote_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
request_method: READABLE_STRING_8
|
request_method: READABLE_STRING_32
|
||||||
|
|
||||||
script_name: READABLE_STRING_8
|
script_name: READABLE_STRING_32
|
||||||
|
|
||||||
server_name: READABLE_STRING_8
|
server_name: READABLE_STRING_32
|
||||||
|
|
||||||
server_port: INTEGER
|
server_port: INTEGER
|
||||||
|
|
||||||
server_protocol: READABLE_STRING_8
|
server_protocol: READABLE_STRING_32
|
||||||
do
|
do
|
||||||
Result := meta_parameter_or_default ({EWSGI_META_NAMES}.server_protocol, "HTTP/1.0", True)
|
Result := meta_parameter_or_default ({WGI_META_NAMES}.server_protocol, "HTTP/1.0", True)
|
||||||
end
|
end
|
||||||
|
|
||||||
server_software: READABLE_STRING_8
|
server_software: READABLE_STRING_32
|
||||||
do
|
do
|
||||||
Result := meta_parameter_or_default ({EWSGI_META_NAMES}.server_software, "Unknown Server", True)
|
Result := meta_parameter_or_default ({WGI_META_NAMES}.server_software, "Unknown Server", True)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Access: HTTP_* CGI meta parameters - 1.1
|
feature -- Access: HTTP_* CGI meta parameters - 1.1
|
||||||
|
|
||||||
http_accept: detachable READABLE_STRING_8
|
http_accept: detachable READABLE_STRING_32
|
||||||
-- Contents of the Accept: header from the current request, if there is one.
|
-- Contents of the Accept: header from the current request, if there is one.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_accept)
|
Result := meta_variable ({WGI_META_NAMES}.http_accept)
|
||||||
end
|
end
|
||||||
|
|
||||||
http_accept_charset: detachable READABLE_STRING_8
|
http_accept_charset: detachable READABLE_STRING_32
|
||||||
-- Contents of the Accept-Charset: header from the current request, if there is one.
|
-- Contents of the Accept-Charset: header from the current request, if there is one.
|
||||||
-- Example: 'iso-8859-1,*,utf-8'.
|
-- Example: 'iso-8859-1,*,utf-8'.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_accept_charset)
|
Result := meta_variable ({WGI_META_NAMES}.http_accept_charset)
|
||||||
end
|
end
|
||||||
|
|
||||||
http_accept_encoding: detachable READABLE_STRING_8
|
http_accept_encoding: detachable READABLE_STRING_32
|
||||||
-- Contents of the Accept-Encoding: header from the current request, if there is one.
|
-- Contents of the Accept-Encoding: header from the current request, if there is one.
|
||||||
-- Example: 'gzip'.
|
-- Example: 'gzip'.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_accept_encoding)
|
Result := meta_variable ({WGI_META_NAMES}.http_accept_encoding)
|
||||||
end
|
end
|
||||||
|
|
||||||
http_accept_language: detachable READABLE_STRING_8
|
http_accept_language: detachable READABLE_STRING_32
|
||||||
-- Contents of the Accept-Language: header from the current request, if there is one.
|
-- Contents of the Accept-Language: header from the current request, if there is one.
|
||||||
-- Example: 'en'.
|
-- Example: 'en'.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_accept_language)
|
Result := meta_variable ({WGI_META_NAMES}.http_accept_language)
|
||||||
end
|
end
|
||||||
|
|
||||||
http_connection: detachable READABLE_STRING_8
|
http_connection: detachable READABLE_STRING_32
|
||||||
-- Contents of the Connection: header from the current request, if there is one.
|
-- Contents of the Connection: header from the current request, if there is one.
|
||||||
-- Example: 'Keep-Alive'.
|
-- Example: 'Keep-Alive'.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_connection)
|
Result := meta_variable ({WGI_META_NAMES}.http_connection)
|
||||||
end
|
end
|
||||||
|
|
||||||
http_host: detachable READABLE_STRING_8
|
http_host: detachable READABLE_STRING_32
|
||||||
-- Contents of the Host: header from the current request, if there is one.
|
-- Contents of the Host: header from the current request, if there is one.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_host)
|
Result := meta_variable ({WGI_META_NAMES}.http_host)
|
||||||
end
|
end
|
||||||
|
|
||||||
http_referer: detachable READABLE_STRING_8
|
http_referer: detachable READABLE_STRING_32
|
||||||
-- The address of the page (if any) which referred the user agent to the current page.
|
-- The address of the page (if any) which referred the user agent to the current page.
|
||||||
-- This is set by the user agent.
|
-- This is set by the user agent.
|
||||||
-- Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature.
|
-- Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature.
|
||||||
-- In short, it cannot really be trusted.
|
-- In short, it cannot really be trusted.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_referer)
|
Result := meta_variable ({WGI_META_NAMES}.http_referer)
|
||||||
end
|
end
|
||||||
|
|
||||||
http_user_agent: detachable READABLE_STRING_8
|
http_user_agent: detachable READABLE_STRING_32
|
||||||
-- Contents of the User-Agent: header from the current request, if there is one.
|
-- Contents of the User-Agent: header from the current request, if there is one.
|
||||||
-- This is a string denoting the user agent being which is accessing the page.
|
-- This is a string denoting the user agent being which is accessing the page.
|
||||||
-- A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586).
|
-- A typical example is: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586).
|
||||||
-- Among other things, you can use this value to tailor your page's
|
-- Among other things, you can use this value to tailor your page's
|
||||||
-- output to the capabilities of the user agent.
|
-- output to the capabilities of the user agent.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_user_agent)
|
Result := meta_variable ({WGI_META_NAMES}.http_user_agent)
|
||||||
end
|
end
|
||||||
|
|
||||||
http_authorization: detachable READABLE_STRING_8
|
http_authorization: detachable READABLE_STRING_32
|
||||||
-- Contents of the Authorization: header from the current request, if there is one.
|
-- Contents of the Authorization: header from the current request, if there is one.
|
||||||
do
|
do
|
||||||
Result := meta_variable ({EWSGI_META_NAMES}.http_authorization)
|
Result := meta_variable ({WGI_META_NAMES}.http_authorization)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Access: Extension to CGI meta parameters - 1.1
|
feature -- Access: Extension to CGI meta parameters - 1.1
|
||||||
|
|
||||||
request_uri: STRING
|
request_uri: READABLE_STRING_32
|
||||||
-- The URI which was given in order to access this page; for instance, '/index.html'.
|
-- The URI which was given in order to access this page; for instance, '/index.html'.
|
||||||
|
|
||||||
orig_path_info: detachable STRING
|
orig_path_info: detachable READABLE_STRING_32
|
||||||
-- Original version of `path_info' before processed by Current environment
|
-- Original version of `path_info' before processed by Current environment
|
||||||
|
|
||||||
feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO
|
feature {NONE} -- Element change: CGI meta parameter related to PATH_INFO
|
||||||
|
|
||||||
set_orig_path_info (s: STRING)
|
set_orig_path_info (s: READABLE_STRING_32)
|
||||||
-- Set ORIG_PATH_INFO to `s'
|
-- Set ORIG_PATH_INFO to `s'
|
||||||
require
|
require
|
||||||
s_attached: s /= Void
|
s_attached: s /= Void
|
||||||
do
|
do
|
||||||
orig_path_info := s
|
orig_path_info := s
|
||||||
set_meta_parameter ({EWSGI_META_NAMES}.orig_path_info, s)
|
set_meta_parameter ({WGI_META_NAMES}.orig_path_info, s)
|
||||||
end
|
end
|
||||||
|
|
||||||
unset_orig_path_info
|
unset_orig_path_info
|
||||||
-- Unset ORIG_PATH_INFO
|
-- Unset ORIG_PATH_INFO
|
||||||
do
|
do
|
||||||
orig_path_info := Void
|
orig_path_info := Void
|
||||||
unset_meta_parameter ({EWSGI_META_NAMES}.orig_path_info)
|
unset_meta_parameter ({WGI_META_NAMES}.orig_path_info)
|
||||||
ensure
|
ensure
|
||||||
unset: attached meta_variable ({EWSGI_META_NAMES}.orig_path_info)
|
unset: attached meta_variable ({WGI_META_NAMES}.orig_path_info)
|
||||||
end
|
end
|
||||||
|
|
||||||
update_path_info
|
update_path_info
|
||||||
@@ -518,7 +518,7 @@ feature -- Form fields and related
|
|||||||
Result := form_data_parameters.item (a_name)
|
Result := form_data_parameters.item (a_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
uploaded_files: HASH_TABLE [EWSGI_UPLOADED_FILE_DATA, STRING]
|
uploaded_files: HASH_TABLE [WGI_UPLOADED_FILE_DATA, STRING]
|
||||||
-- Table of uploaded files information
|
-- Table of uploaded files information
|
||||||
--| name: original path from the user
|
--| name: original path from the user
|
||||||
--| type: content type
|
--| type: content type
|
||||||
@@ -538,7 +538,7 @@ feature -- Cookies
|
|||||||
do
|
do
|
||||||
l_cookies := internal_cookies
|
l_cookies := internal_cookies
|
||||||
if l_cookies = Void then
|
if l_cookies = Void then
|
||||||
if attached meta_variable ({EWSGI_META_NAMES}.http_cookie) as s then
|
if attached meta_variable ({WGI_META_NAMES}.http_cookie) as s then
|
||||||
create l_cookies.make (5)
|
create l_cookies.make (5)
|
||||||
from
|
from
|
||||||
n := s.count
|
n := s.count
|
||||||
@@ -748,7 +748,7 @@ feature -- Element change
|
|||||||
|
|
||||||
feature {NONE} -- Temporary File handling
|
feature {NONE} -- Temporary File handling
|
||||||
|
|
||||||
delete_uploaded_file (uf: EWSGI_UPLOADED_FILE_DATA)
|
delete_uploaded_file (uf: WGI_UPLOADED_FILE_DATA)
|
||||||
-- Delete file `a_filename'
|
-- Delete file `a_filename'
|
||||||
require
|
require
|
||||||
uf_valid: uf /= Void
|
uf_valid: uf /= Void
|
||||||
@@ -771,7 +771,7 @@ feature {NONE} -- Temporary File handling
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
save_uploaded_file (a_content: STRING; a_up_fn_info: EWSGI_UPLOADED_FILE_DATA)
|
save_uploaded_file (a_content: STRING; a_up_fn_info: WGI_UPLOADED_FILE_DATA)
|
||||||
-- Save uploaded file content to `a_filename'
|
-- Save uploaded file content to `a_filename'
|
||||||
local
|
local
|
||||||
bn: STRING
|
bn: STRING
|
||||||
@@ -938,7 +938,7 @@ feature {NONE} -- Implementation: Form analyzer
|
|||||||
l_header: detachable STRING
|
l_header: detachable STRING
|
||||||
l_content: detachable STRING
|
l_content: detachable STRING
|
||||||
l_line: detachable STRING
|
l_line: detachable STRING
|
||||||
l_up_file_info: EWSGI_UPLOADED_FILE_DATA
|
l_up_file_info: WGI_UPLOADED_FILE_DATA
|
||||||
do
|
do
|
||||||
from
|
from
|
||||||
p := 1
|
p := 1
|
||||||
@@ -1115,7 +1115,7 @@ feature {NONE} -- Implementation
|
|||||||
extract_variables
|
extract_variables
|
||||||
-- Extract relevant meta parameters
|
-- Extract relevant meta parameters
|
||||||
local
|
local
|
||||||
s: detachable READABLE_STRING_8
|
s: detachable READABLE_STRING_32
|
||||||
do
|
do
|
||||||
s := request_uri
|
s := request_uri
|
||||||
if s.is_empty then
|
if s.is_empty then
|
||||||
@@ -8,10 +8,10 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
class
|
class
|
||||||
EWSGI_RESPONSE_STREAM_BUFFER
|
WGI_RESPONSE_STREAM_BUFFER
|
||||||
|
|
||||||
inherit
|
inherit
|
||||||
EWSGI_RESPONSE_BUFFER
|
WGI_RESPONSE_BUFFER
|
||||||
|
|
||||||
create
|
create
|
||||||
make
|
make
|
||||||
@@ -23,7 +23,7 @@ feature {NONE} -- Initialization
|
|||||||
output := a_output
|
output := a_output
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {EWSGI_APPLICATION} -- Commit
|
feature {WGI_APPLICATION} -- Commit
|
||||||
|
|
||||||
commit
|
commit
|
||||||
-- Commit the current response
|
-- Commit the current response
|
||||||
@@ -133,7 +133,7 @@ feature -- Output operation
|
|||||||
|
|
||||||
feature {NONE} -- Implementation: Access
|
feature {NONE} -- Implementation: Access
|
||||||
|
|
||||||
output: EWSGI_OUTPUT_STREAM
|
output: WGI_OUTPUT_STREAM
|
||||||
-- Server output channel
|
-- Server output channel
|
||||||
|
|
||||||
;note
|
;note
|
||||||
@@ -9,7 +9,7 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_INPUT_STREAM
|
WGI_INPUT_STREAM
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ note
|
|||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
|
||||||
deferred class
|
deferred class
|
||||||
EWSGI_OUTPUT_STREAM
|
WGI_OUTPUT_STREAM
|
||||||
|
|
||||||
feature -- Core operation
|
feature -- Core operation
|
||||||
|
|
||||||
@@ -10,9 +10,9 @@
|
|||||||
<option warning="true" full_class_checking="true" syntax="provisional">
|
<option warning="true" full_class_checking="true" 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="encoder" location="..\..\..\text\encoder\encoder.ecf" readonly="false"/>
|
||||||
<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.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"/>
|
||||||
@@ -20,5 +20,7 @@
|
|||||||
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
<library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
|
||||||
<cluster name="connectors" location="..\connectors\" recursive="true"/>
|
<cluster name="connectors" location="..\connectors\" recursive="true"/>
|
||||||
<cluster name="interface" location="..\src\" recursive="true"/>
|
<cluster name="interface" location="..\src\" recursive="true"/>
|
||||||
|
<cluster name="specification_request" location="..\specification\request" recursive="true"/>
|
||||||
|
<cluster name="specification_response" location="..\specification\response" recursive="true"/>
|
||||||
</target>
|
</target>
|
||||||
</system>
|
</system>
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ feature -- Setup
|
|||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
do
|
do
|
||||||
if attached router.dispatch (req, res) as r then
|
if attached router.dispatch (req, res) as r then
|
||||||
--| done
|
--| done
|
||||||
@@ -44,7 +44,7 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_default (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute_default (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ inherit
|
|||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
request: EWSGI_REQUEST
|
request: WGI_REQUEST
|
||||||
-- Associated request
|
-- Associated request
|
||||||
|
|
||||||
path: STRING
|
path: STRING
|
||||||
@@ -25,13 +25,13 @@ feature -- Access
|
|||||||
|
|
||||||
request_content_type (content_type_supported: detachable ARRAY [STRING]): detachable READABLE_STRING_8
|
request_content_type (content_type_supported: detachable ARRAY [STRING]): detachable READABLE_STRING_8
|
||||||
local
|
local
|
||||||
s: detachable READABLE_STRING_8
|
s: detachable READABLE_STRING_32
|
||||||
i,n: INTEGER
|
i,n: INTEGER
|
||||||
do
|
do
|
||||||
Result := request.content_type
|
s := request.content_type
|
||||||
if Result = Void then
|
|
||||||
s := request.http_accept
|
|
||||||
if s /= Void then
|
if s /= Void then
|
||||||
|
Result := s
|
||||||
|
else
|
||||||
if attached accepted_content_types (request) as l_accept_lst then
|
if attached accepted_content_types (request) as l_accept_lst then
|
||||||
from
|
from
|
||||||
l_accept_lst.start
|
l_accept_lst.start
|
||||||
@@ -57,7 +57,6 @@ feature -- Access
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
feature -- Query
|
feature -- Query
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ create
|
|||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make (req: EWSGI_REQUEST; p: like path)
|
make (req: WGI_REQUEST; p: like path)
|
||||||
do
|
do
|
||||||
request := req
|
request := req
|
||||||
path := p
|
path := p
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ create
|
|||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make (req: EWSGI_REQUEST; tpl: URI_TEMPLATE; tpl_res: URI_TEMPLATE_MATCH_RESULT; p: like path)
|
make (req: WGI_REQUEST; tpl: URI_TEMPLATE; tpl_res: URI_TEMPLATE_MATCH_RESULT; p: like path)
|
||||||
do
|
do
|
||||||
request := req
|
request := req
|
||||||
uri_template := tpl
|
uri_template := tpl
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ feature -- Initialization
|
|||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
action: PROCEDURE [ANY, TUPLE [ctx: REQUEST_HANDLER_CONTEXT; req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER]]
|
action: PROCEDURE [ANY, TUPLE [ctx: REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER]]
|
||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute_application (ctx: REQUEST_HANDLER_CONTEXT; req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute_application (ctx: REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
do
|
do
|
||||||
action.call ([ctx, req, res])
|
action.call ([ctx, req, res])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ feature -- Access
|
|||||||
|
|
||||||
feature -- Status report
|
feature -- Status report
|
||||||
|
|
||||||
is_valid_context (req: EWSGI_REQUEST): BOOLEAN
|
is_valid_context (req: WGI_REQUEST): BOOLEAN
|
||||||
-- Is `req' valid context for current handler?
|
-- Is `req' valid context for current handler?
|
||||||
do
|
do
|
||||||
Result := request_method_name_supported (req.request_method)
|
Result := request_method_name_supported (req.request_method)
|
||||||
@@ -29,7 +29,7 @@ feature -- Status report
|
|||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
execute (a_hdl_context: REQUEST_HANDLER_CONTEXT; req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute (a_hdl_context: REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Execute request handler
|
-- Execute request handler
|
||||||
require
|
require
|
||||||
is_valid_context: is_valid_context (req)
|
is_valid_context: is_valid_context (req)
|
||||||
@@ -52,7 +52,7 @@ feature -- Execution
|
|||||||
retry
|
retry
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_method_not_allowed (a_hdl_context: REQUEST_HANDLER_CONTEXT; req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute_method_not_allowed (a_hdl_context: REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
local
|
local
|
||||||
s: STRING
|
s: STRING
|
||||||
lst: LIST [STRING]
|
lst: LIST [STRING]
|
||||||
@@ -75,24 +75,24 @@ feature -- Execution
|
|||||||
res.write_header ({HTTP_STATUS_CODE}.method_not_allowed, <<["Allow", s]>>)
|
res.write_header ({HTTP_STATUS_CODE}.method_not_allowed, <<["Allow", s]>>)
|
||||||
end
|
end
|
||||||
|
|
||||||
execute_application (a_hdl_context: REQUEST_HANDLER_CONTEXT; req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
execute_application (a_hdl_context: REQUEST_HANDLER_CONTEXT; req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Execute request handler
|
-- Execute request handler
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
pre_execute (req: EWSGI_REQUEST)
|
pre_execute (req: WGI_REQUEST)
|
||||||
-- Operation processed before `execute'
|
-- Operation processed before `execute'
|
||||||
do
|
do
|
||||||
--| To be redefined if needed
|
--| To be redefined if needed
|
||||||
end
|
end
|
||||||
|
|
||||||
post_execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
post_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Operation processed after `execute'
|
-- Operation processed after `execute'
|
||||||
do
|
do
|
||||||
--| To be redefined if needed
|
--| To be redefined if needed
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue_execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER)
|
rescue_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
|
||||||
-- Operation processed after a rescue
|
-- Operation processed after a rescue
|
||||||
do
|
do
|
||||||
--| To be redefined if needed
|
--| To be redefined if needed
|
||||||
@@ -101,7 +101,7 @@ feature -- Execution
|
|||||||
|
|
||||||
feature -- Execution: report
|
feature -- Execution: report
|
||||||
|
|
||||||
-- execution_information (req: EWSGI_REQUEST): detachable REQUEST_HANDLER_CONTEXT
|
-- execution_information (req: WGI_REQUEST): detachable REQUEST_HANDLER_CONTEXT
|
||||||
-- -- Execution information related to the request
|
-- -- Execution information related to the request
|
||||||
-- do
|
-- do
|
||||||
-- if attached path_information (req, req.environment.path_info) as info then
|
-- if attached path_information (req, req.environment.path_info) as info then
|
||||||
@@ -109,7 +109,7 @@ feature -- Execution: report
|
|||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
-- path_information (req: EWSGI_REQUEST; a_rq_path: STRING): detachable TUPLE [format: detachable STRING; arguments: detachable STRING]
|
-- path_information (req: WGI_REQUEST; a_rq_path: STRING): detachable TUPLE [format: detachable STRING; arguments: detachable STRING]
|
||||||
-- -- Information related to `a_path'
|
-- -- Information related to `a_path'
|
||||||
-- local
|
-- local
|
||||||
-- l_rq_path: STRING
|
-- l_rq_path: STRING
|
||||||
@@ -156,7 +156,7 @@ feature -- Execution: report
|
|||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
url (req: EWSGI_REQUEST; args: detachable STRING; abs: BOOLEAN): STRING
|
url (req: WGI_REQUEST; args: detachable STRING; abs: BOOLEAN): STRING
|
||||||
-- Associated url based on `path' and `args'
|
-- Associated url based on `path' and `args'
|
||||||
-- if `abs' then return absolute url
|
-- if `abs' then return absolute url
|
||||||
local
|
local
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ feature -- Registration
|
|||||||
|
|
||||||
feature -- Execution
|
feature -- Execution
|
||||||
|
|
||||||
dispatch (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER): detachable REQUEST_HANDLER
|
dispatch (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER): detachable REQUEST_HANDLER
|
||||||
-- Dispatch `req, res' to the associated handler
|
-- Dispatch `req, res' to the associated handler
|
||||||
-- And return this handler
|
-- And return this handler
|
||||||
-- If Result is Void, this means no handler was found.
|
-- If Result is Void, this means no handler was found.
|
||||||
@@ -60,7 +60,7 @@ feature -- Execution
|
|||||||
|
|
||||||
feature {NONE} -- Access: Implementation
|
feature {NONE} -- Access: Implementation
|
||||||
|
|
||||||
handler (req: EWSGI_REQUEST): detachable TUPLE [handler: REQUEST_HANDLER; context: REQUEST_HANDLER_CONTEXT]
|
handler (req: WGI_REQUEST): detachable TUPLE [handler: REQUEST_HANDLER; context: REQUEST_HANDLER_CONTEXT]
|
||||||
-- Handler whose map matched with `req'
|
-- Handler whose map matched with `req'
|
||||||
require
|
require
|
||||||
req_valid: req /= Void and then req.path_info /= Void
|
req_valid: req /= Void and then req.path_info /= Void
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ feature -- Registration
|
|||||||
|
|
||||||
feature {NONE} -- Access: Implementation
|
feature {NONE} -- Access: Implementation
|
||||||
|
|
||||||
handler (req: EWSGI_REQUEST): detachable TUPLE [handler: REQUEST_HANDLER; context: REQUEST_HANDLER_CONTEXT]
|
handler (req: WGI_REQUEST): detachable TUPLE [handler: REQUEST_HANDLER; context: REQUEST_HANDLER_CONTEXT]
|
||||||
local
|
local
|
||||||
h: detachable REQUEST_HANDLER
|
h: detachable REQUEST_HANDLER
|
||||||
ctx: detachable REQUEST_HANDLER_CONTEXT
|
ctx: detachable REQUEST_HANDLER_CONTEXT
|
||||||
do
|
do
|
||||||
h := handler_by_path (req.environment.path_info)
|
h := handler_by_path (req.path_info)
|
||||||
if h = Void then
|
if h = Void then
|
||||||
if attached smart_handler_by_path (req.environment.path_info) as info then
|
if attached smart_handler_by_path (req.path_info) as info then
|
||||||
h := info.handler
|
h := info.handler
|
||||||
ctx := handler_context (info.path, req)
|
ctx := handler_context (info.path, req)
|
||||||
end
|
end
|
||||||
@@ -59,13 +59,13 @@ feature {NONE} -- Access: Implementation
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
smart_handler (req: EWSGI_REQUEST): detachable TUPLE [path: STRING; handler: REQUEST_HANDLER]
|
smart_handler (req: WGI_REQUEST): detachable TUPLE [path: STRING; handler: REQUEST_HANDLER]
|
||||||
require
|
require
|
||||||
req_valid: req /= Void and then req.environment.path_info /= Void
|
req_valid: req /= Void and then req.path_info /= Void
|
||||||
do
|
do
|
||||||
Result := smart_handler_by_path (req.environment.path_info)
|
Result := smart_handler_by_path (req.path_info)
|
||||||
ensure
|
ensure
|
||||||
req_path_info_unchanged: req.environment.path_info.same_string (old req.environment.path_info)
|
req_path_info_unchanged: req.path_info.same_string (old req.path_info)
|
||||||
end
|
end
|
||||||
|
|
||||||
handler_by_path (a_path: STRING): detachable REQUEST_HANDLER
|
handler_by_path (a_path: STRING): detachable REQUEST_HANDLER
|
||||||
@@ -107,12 +107,12 @@ feature {NONE} -- Access: Implementation
|
|||||||
|
|
||||||
feature -- Context factory
|
feature -- Context factory
|
||||||
|
|
||||||
handler_context (p: detachable STRING; req: EWSGI_REQUEST): REQUEST_URI_HANDLER_CONTEXT
|
handler_context (p: detachable STRING; req: WGI_REQUEST): REQUEST_URI_HANDLER_CONTEXT
|
||||||
do
|
do
|
||||||
if p /= Void then
|
if p /= Void then
|
||||||
create Result.make (req, p)
|
create Result.make (req, p)
|
||||||
else
|
else
|
||||||
create Result.make (req, req.environment.path_info)
|
create Result.make (req, req.path_info)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ feature -- Registration
|
|||||||
|
|
||||||
feature {NONE} -- Access: Implementation
|
feature {NONE} -- Access: Implementation
|
||||||
|
|
||||||
handler (req: EWSGI_REQUEST): detachable TUPLE [handler: REQUEST_HANDLER; context: REQUEST_HANDLER_CONTEXT]
|
handler (req: WGI_REQUEST): detachable TUPLE [handler: REQUEST_HANDLER; context: REQUEST_HANDLER_CONTEXT]
|
||||||
local
|
local
|
||||||
ctx: detachable REQUEST_URI_TEMPLATE_HANDLER_CONTEXT
|
ctx: detachable REQUEST_URI_TEMPLATE_HANDLER_CONTEXT
|
||||||
l_handlers: like handlers
|
l_handlers: like handlers
|
||||||
@@ -72,7 +72,7 @@ feature {NONE} -- Access: Implementation
|
|||||||
|
|
||||||
feature -- Context factory
|
feature -- Context factory
|
||||||
|
|
||||||
handler_context (p: detachable STRING; req: EWSGI_REQUEST; tpl: URI_TEMPLATE; tpl_res: URI_TEMPLATE_MATCH_RESULT): REQUEST_URI_TEMPLATE_HANDLER_CONTEXT
|
handler_context (p: detachable STRING; req: WGI_REQUEST; tpl: URI_TEMPLATE; tpl_res: URI_TEMPLATE_MATCH_RESULT): REQUEST_URI_TEMPLATE_HANDLER_CONTEXT
|
||||||
do
|
do
|
||||||
if p /= Void then
|
if p /= Void then
|
||||||
create Result.make (req, tpl, tpl_res, p)
|
create Result.make (req, tpl, tpl_res, p)
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ class
|
|||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
accepted_content_types (req: EWSGI_REQUEST): detachable ARRAYED_LIST [STRING]
|
accepted_content_types (req: WGI_REQUEST): detachable ARRAYED_LIST [READABLE_STRING_8]
|
||||||
local
|
local
|
||||||
l_accept: detachable READABLE_STRING_8
|
l_accept: detachable READABLE_STRING_32
|
||||||
s: STRING_8
|
s: STRING_8
|
||||||
q: READABLE_STRING_8
|
q: READABLE_STRING_8
|
||||||
p: INTEGER
|
p: INTEGER
|
||||||
@@ -22,7 +22,7 @@ feature -- Access
|
|||||||
--TEST l_accept := "text/html,application/xhtml+xml;q=0.6,application/xml;q=0.2,text/plain;q=0.5,*/*;q=0.8"
|
--TEST l_accept := "text/html,application/xhtml+xml;q=0.6,application/xml;q=0.2,text/plain;q=0.5,*/*;q=0.8"
|
||||||
|
|
||||||
if l_accept /= Void then
|
if l_accept /= Void then
|
||||||
lst := l_accept.split (',')
|
lst := l_accept.as_string_8.split (',')
|
||||||
create Result.make (lst.count)
|
create Result.make (lst.count)
|
||||||
from
|
from
|
||||||
lst.start
|
lst.start
|
||||||
@@ -41,7 +41,7 @@ feature -- Access
|
|||||||
|
|
||||||
lst.forth
|
lst.forth
|
||||||
end
|
end
|
||||||
create qs.make (create {COMPARABLE_COMPARATOR [STRING]})
|
create qs.make (create {COMPARABLE_COMPARATOR [READABLE_STRING_8]})
|
||||||
qs.reverse_sort (Result)
|
qs.reverse_sort (Result)
|
||||||
from
|
from
|
||||||
Result.start
|
Result.start
|
||||||
|
|||||||
Reference in New Issue
Block a user