From 6a581f6d624c46ee51c9e68d11f3e4645afe0826 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Tue, 30 Aug 2011 19:20:42 +0200 Subject: [PATCH] Changed prefix from EWSGI_ to WGI_ Changed meta variable type to READABLE_STRING_32 --- doc/wiki | 2 +- .../src/framework/routed_application_helper.e | 4 +- .../src/hello_routed_world.e | 12 +- .../connectors/cgi/src/ewf_cgi_connector.e | 6 +- .../connectors/cgi/src/ewf_cgi_input_stream.e | 4 +- .../cgi/src/ewf_cgi_output_stream.e | 4 +- .../libfcgi/src/ewf_libfcgi_connector.e | 10 +- .../libfcgi/src/ewf_libfcgi_input_stream.e | 4 +- .../libfcgi/src/ewf_libfcgi_output_stream.e | 2 +- .../connectors/nino/src/ewf_nino_connector.e | 6 +- .../nino/src/ewf_nino_input_stream.e | 4 +- .../nino/src/ewf_nino_output_stream.e | 4 +- ...pplication.e => default_wgi_application.e} | 8 +- ...pplication.e => default_wgi_application.e} | 13 +- .../ewsgi/default/nino/nino_application.e | 6 +- .../examples/hello_world/src/hello_world.e | 2 +- .../src/hello_world.e | 10 +- .../src/hello_world_response.e | 2 +- .../{ewsgi_connector.e => wgi_connector.e} | 6 +- .../obsolete/{ewsgi_cookie.e => wgi_cookie.e} | 2 +- .../{ewsgi_variables.e => wgi_variables.e} | 4 +- .../{ewsgi_meta_names.e => wgi_meta_names.e} | 4 +- .../{ewsgi_request.e => wgi_request.e} | 74 ++++---- ...d_file_data.e => wgi_uploaded_file_data.e} | 4 +- ...esponse_buffer.e => wgi_response_buffer.e} | 8 +- ...wsgi_input_stream.e => wgi_input_stream.e} | 2 +- ...gi_output_stream.e => wgi_output_stream.e} | 2 +- ...{ewsgi_application.e => wgi_application.e} | 6 +- ..._application.e => wgi_agent_application.e} | 10 +- ...{ewsgi_application.e => wgi_application.e} | 14 +- .../{ewsgi_connector.e => wgi_connector.e} | 6 +- .../ewsgi/src/extra/ewf_buffered_response.e | 8 +- .../extra/in_memory/ewf_in_memory_response.e | 10 +- .../ewf_in_memory_response_application.e | 8 +- .../{ewsgi_response.e => wgi_response.e} | 12 +- ...plication.e => wgi_response_application.e} | 12 +- ..._from_table.e => wgi_request_from_table.e} | 158 +++++++++--------- ..._buffer.e => wgi_response_stream_buffer.e} | 8 +- ...wsgi_input_stream.e => wgi_input_stream.e} | 2 +- ...gi_output_stream.e => wgi_output_stream.e} | 2 +- library/server/ewsgi/tests/ewsgi-full.ecf | 4 +- .../src/application/routed_application.e | 4 +- .../src/context/request_handler_context.e | 49 +++--- .../src/context/request_uri_handler_context.e | 2 +- .../request_uri_template_handler_context.e | 2 +- .../src/handler/request_agent_handler.e | 4 +- .../router/src/handler/request_handler.e | 20 +-- .../router/src/router/request_router.e | 4 +- .../router/src/router/request_uri_router.e | 18 +- .../src/router/request_uri_template_router.e | 4 +- .../src/utility/request_format_utility.e | 8 +- 51 files changed, 294 insertions(+), 290 deletions(-) rename library/server/ewsgi/default/cgi/{default_ewsgi_application.e => default_wgi_application.e} (78%) rename library/server/ewsgi/default/nino/{default_ewsgi_application.e => default_wgi_application.e} (75%) rename library/server/ewsgi/specification/connector/{ewsgi_connector.e => wgi_connector.e} (86%) rename library/server/ewsgi/specification/request/obsolete/{ewsgi_cookie.e => wgi_cookie.e} (99%) rename library/server/ewsgi/specification/request/obsolete/{ewsgi_variables.e => wgi_variables.e} (94%) rename library/server/ewsgi/specification/request/{ewsgi_meta_names.e => wgi_meta_names.e} (95%) rename library/server/ewsgi/specification/request/{ewsgi_request.e => wgi_request.e} (93%) rename library/server/ewsgi/specification/request/{ewsgi_uploaded_file_data.e => wgi_uploaded_file_data.e} (95%) rename library/server/ewsgi/specification/response/{ewsgi_response_buffer.e => wgi_response_buffer.e} (93%) rename library/server/ewsgi/specification/stream/{ewsgi_input_stream.e => wgi_input_stream.e} (97%) rename library/server/ewsgi/specification/stream/{ewsgi_output_stream.e => wgi_output_stream.e} (98%) rename library/server/ewsgi/specification/{ewsgi_application.e => wgi_application.e} (85%) rename library/server/ewsgi/src/application/{ewsgi_agent_application.e => wgi_agent_application.e} (75%) rename library/server/ewsgi/src/application/{ewsgi_application.e => wgi_application.e} (84%) rename library/server/ewsgi/src/connector/{ewsgi_connector.e => wgi_connector.e} (88%) rename library/server/ewsgi/src/extra/response_as_result/{ewsgi_response.e => wgi_response.e} (95%) rename library/server/ewsgi/src/extra/response_as_result/{ewsgi_response_application.e => wgi_response_application.e} (82%) rename library/server/ewsgi/src/request/{ewsgi_request_from_table.e => wgi_request_from_table.e} (85%) rename library/server/ewsgi/src/response/{ewsgi_response_stream_buffer.e => wgi_response_stream_buffer.e} (95%) rename library/server/ewsgi/src/stream/{ewsgi_input_stream.e => wgi_input_stream.e} (97%) rename library/server/ewsgi/src/stream/{ewsgi_output_stream.e => wgi_output_stream.e} (98%) diff --git a/doc/wiki b/doc/wiki index d14e65fd..060f1482 160000 --- a/doc/wiki +++ b/doc/wiki @@ -1 +1 @@ -Subproject commit d14e65fdc09686fd15b37f6ce23eb7c8e92fb6bf +Subproject commit 060f1482fe4d9bcb82b3207bd27b47fcff5a3073 diff --git a/examples/hello_routed_world/src/framework/routed_application_helper.e b/examples/hello_routed_world/src/framework/routed_application_helper.e index 14a25899..4d1c730a 100644 --- a/examples/hello_routed_world/src/framework/routed_application_helper.e +++ b/examples/hello_routed_world/src/framework/routed_application_helper.e @@ -17,7 +17,7 @@ inherit 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 s, uri_s: detachable STRING i, n: INTEGER @@ -68,7 +68,7 @@ feature -- Helper 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 s: STRING i, n: INTEGER diff --git a/examples/hello_routed_world/src/hello_routed_world.e b/examples/hello_routed_world/src/hello_routed_world.e index 48f3d2f1..2cba0ce3 100644 --- a/examples/hello_routed_world/src/hello_routed_world.e +++ b/examples/hello_routed_world/src/hello_routed_world.e @@ -14,7 +14,7 @@ inherit ROUTED_APPLICATION_HELPER - DEFAULT_EWSGI_APPLICATION + DEFAULT_WGI_APPLICATION create make @@ -51,7 +51,7 @@ feature {NONE} -- Initialization feature -- Execution - execute_default (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute_default (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) local h: EWF_HEADER l_url: STRING @@ -96,7 +96,7 @@ feature -- Execution res.flush 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 res.write_header (200, <<["Content-Type", "text/html"]>>) res.write_string ("Hello World ?!%N") @@ -116,7 +116,7 @@ feature -- Execution res.write_string ("%N") 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 l_response_content_type: detachable STRING msg: STRING @@ -160,12 +160,12 @@ feature -- Execution 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 execute_hello (req, res, Void, ctx) 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 execute_hello (req, res, ctx.parameter ("name"), ctx) end diff --git a/library/server/ewsgi/connectors/cgi/src/ewf_cgi_connector.e b/library/server/ewsgi/connectors/cgi/src/ewf_cgi_connector.e index e8150ead..3a665d43 100644 --- a/library/server/ewsgi/connectors/cgi/src/ewf_cgi_connector.e +++ b/library/server/ewsgi/connectors/cgi/src/ewf_cgi_connector.e @@ -8,7 +8,7 @@ class EWF_CGI_CONNECTOR inherit - EWSGI_CONNECTOR + WGI_CONNECTOR create make @@ -17,8 +17,8 @@ feature -- Execution launch local - req: EWSGI_REQUEST_FROM_TABLE - res: EWSGI_RESPONSE_STREAM_BUFFER + req: WGI_REQUEST_FROM_TABLE + res: WGI_RESPONSE_STREAM_BUFFER do create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {EWF_CGI_INPUT_STREAM}.make) create res.make (create {EWF_CGI_OUTPUT_STREAM}.make) diff --git a/library/server/ewsgi/connectors/cgi/src/ewf_cgi_input_stream.e b/library/server/ewsgi/connectors/cgi/src/ewf_cgi_input_stream.e index 415703e5..7d09236b 100644 --- a/library/server/ewsgi/connectors/cgi/src/ewf_cgi_input_stream.e +++ b/library/server/ewsgi/connectors/cgi/src/ewf_cgi_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for GW_CGI_INPUT_STREAM." + description: "Summary description for EWF_CGI_INPUT_STREAM." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" @@ -9,7 +9,7 @@ class EWF_CGI_INPUT_STREAM inherit - EWSGI_INPUT_STREAM + WGI_INPUT_STREAM CONSOLE rename diff --git a/library/server/ewsgi/connectors/cgi/src/ewf_cgi_output_stream.e b/library/server/ewsgi/connectors/cgi/src/ewf_cgi_output_stream.e index 6239e9e4..f586a548 100644 --- a/library/server/ewsgi/connectors/cgi/src/ewf_cgi_output_stream.e +++ b/library/server/ewsgi/connectors/cgi/src/ewf_cgi_output_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for GW_CGI_OUTPUT_STREAM." + description: "Summary description for EWF_CGI_OUTPUT_STREAM." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" @@ -9,7 +9,7 @@ class EWF_CGI_OUTPUT_STREAM inherit - EWSGI_OUTPUT_STREAM + WGI_OUTPUT_STREAM undefine flush end diff --git a/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_connector.e b/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_connector.e index f58f5c72..7354ad6d 100644 --- a/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_connector.e +++ b/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_connector.e @@ -9,7 +9,7 @@ class EWF_LIBFCGI_CONNECTOR inherit - EWSGI_CONNECTOR + WGI_CONNECTOR redefine initialize end @@ -46,8 +46,8 @@ feature -- Execution process_fcgi_request (vars: HASH_TABLE [STRING, STRING]; a_input: like input; a_output: like output) local - req: EWSGI_REQUEST_FROM_TABLE - res: EWSGI_RESPONSE_STREAM_BUFFER + req: WGI_REQUEST_FROM_TABLE + res: WGI_RESPONSE_STREAM_BUFFER do create req.make (vars, a_input) create res.make (a_output) @@ -56,10 +56,10 @@ feature -- Execution feature -- Input/Output - input: EWSGI_INPUT_STREAM + input: WGI_INPUT_STREAM -- Input from client (from httpd server via FCGI) - output: EWSGI_OUTPUT_STREAM + output: WGI_OUTPUT_STREAM -- Output to client (via httpd server/fcgi) feature {NONE} -- Implementation diff --git a/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_input_stream.e b/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_input_stream.e index 75eec7ce..494ff28e 100644 --- a/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_input_stream.e +++ b/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for GW_LIBFCGI_INPUT_STREAM." + description: "Summary description for EWF_LIBFCGI_INPUT_STREAM." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" @@ -9,7 +9,7 @@ class EWF_LIBFCGI_INPUT_STREAM inherit - EWSGI_INPUT_STREAM + WGI_INPUT_STREAM STRING_HANDLER diff --git a/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_output_stream.e b/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_output_stream.e index 38d6c65a..9a5c5a7c 100644 --- a/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_output_stream.e +++ b/library/server/ewsgi/connectors/libfcgi/src/ewf_libfcgi_output_stream.e @@ -9,7 +9,7 @@ class EWF_LIBFCGI_OUTPUT_STREAM inherit - EWSGI_OUTPUT_STREAM + WGI_OUTPUT_STREAM HTTP_STATUS_CODE_MESSAGES export diff --git a/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e b/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e index 7d2a5218..29e2acbe 100644 --- a/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e +++ b/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e @@ -8,7 +8,7 @@ class EWF_NINO_CONNECTOR inherit - EWSGI_CONNECTOR + WGI_CONNECTOR redefine initialize 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) local - req: EWSGI_REQUEST_FROM_TABLE - res: EWSGI_RESPONSE_STREAM_BUFFER + req: WGI_REQUEST_FROM_TABLE + res: WGI_RESPONSE_STREAM_BUFFER do create req.make (env, create {EWF_NINO_INPUT_STREAM}.make (a_input)) create res.make (create {EWF_NINO_OUTPUT_STREAM}.make (a_output)) diff --git a/library/server/ewsgi/connectors/nino/src/ewf_nino_input_stream.e b/library/server/ewsgi/connectors/nino/src/ewf_nino_input_stream.e index 66d71062..9cc0d4ec 100644 --- a/library/server/ewsgi/connectors/nino/src/ewf_nino_input_stream.e +++ b/library/server/ewsgi/connectors/nino/src/ewf_nino_input_stream.e @@ -9,7 +9,7 @@ class EWF_NINO_INPUT_STREAM inherit - EWSGI_INPUT_STREAM + WGI_INPUT_STREAM create make @@ -22,7 +22,7 @@ feature {NONE} -- Initialization set_nino_input (a_nino_input) end -feature {EWF_NINO_CONNECTOR, EWSGI_APPLICATION} -- Nino +feature {EWF_NINO_CONNECTOR, WGI_APPLICATION} -- Nino set_nino_input (i: like nino_input) do diff --git a/library/server/ewsgi/connectors/nino/src/ewf_nino_output_stream.e b/library/server/ewsgi/connectors/nino/src/ewf_nino_output_stream.e index d772c514..b3b9488d 100644 --- a/library/server/ewsgi/connectors/nino/src/ewf_nino_output_stream.e +++ b/library/server/ewsgi/connectors/nino/src/ewf_nino_output_stream.e @@ -9,7 +9,7 @@ class EWF_NINO_OUTPUT_STREAM inherit - EWSGI_OUTPUT_STREAM + WGI_OUTPUT_STREAM HTTP_STATUS_CODE_MESSAGES export @@ -26,7 +26,7 @@ feature {NONE} -- Initialization set_nino_output (a_nino_output) end -feature {EWF_NINO_CONNECTOR, EWSGI_APPLICATION} -- Nino +feature {EWF_NINO_CONNECTOR, WGI_APPLICATION} -- Nino set_nino_output (o: like nino_output) do diff --git a/library/server/ewsgi/default/cgi/default_ewsgi_application.e b/library/server/ewsgi/default/cgi/default_wgi_application.e similarity index 78% rename from library/server/ewsgi/default/cgi/default_ewsgi_application.e rename to library/server/ewsgi/default/cgi/default_wgi_application.e index a4860978..e42f84ae 100644 --- a/library/server/ewsgi/default/cgi/default_ewsgi_application.e +++ b/library/server/ewsgi/default/cgi/default_wgi_application.e @@ -1,19 +1,19 @@ note - description: "Summary description for {DEFAULT_EWSGI_APPLICATION}." + description: "Summary description for {DEFAULT_WGI_APPLICATION}." date: "$Date$" revision: "$Revision$" deferred class - DEFAULT_EWSGI_APPLICATION + DEFAULT_WGI_APPLICATION inherit - EWSGI_APPLICATION + WGI_APPLICATION feature {NONE} -- Initialization make_and_launch local - cgi: GW_CGI_CONNECTOR + cgi: EWF_CGI_CONNECTOR do create cgi.make (Current) cgi.launch diff --git a/library/server/ewsgi/default/nino/default_ewsgi_application.e b/library/server/ewsgi/default/nino/default_wgi_application.e similarity index 75% rename from library/server/ewsgi/default/nino/default_ewsgi_application.e rename to library/server/ewsgi/default/nino/default_wgi_application.e index 25f59486..f396a0fb 100644 --- a/library/server/ewsgi/default/nino/default_ewsgi_application.e +++ b/library/server/ewsgi/default/nino/default_wgi_application.e @@ -1,21 +1,24 @@ note - description: "Summary description for {DEFAULT_EWSGI_APPLICATION}." + description: "Summary description for {DEFAULT_WGI_APPLICATION}." date: "$Date$" revision: "$Revision$" deferred class - DEFAULT_EWSGI_APPLICATION + DEFAULT_WGI_APPLICATION inherit - EWSGI_APPLICATION + WGI_APPLICATION feature {NONE} -- Initialization make_and_launch + local + app: NINO_APPLICATION 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") - (create {NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number) + create app.make_custom (agent execute, "") + app.listen (port_number) end port_number: INTEGER diff --git a/library/server/ewsgi/default/nino/nino_application.e b/library/server/ewsgi/default/nino/nino_application.e index a1e63d2f..278fc990 100644 --- a/library/server/ewsgi/default/nino/nino_application.e +++ b/library/server/ewsgi/default/nino/nino_application.e @@ -12,16 +12,16 @@ create feature {NONE} -- Implementation - make (a_callback: like {EWSGI_AGENT_APPLICATION}.callback) + make (a_callback: like {WGI_AGENT_APPLICATION}.callback) -- Initialize `Current'. do make_custom (a_callback, Void) 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'. local - app: EWSGI_AGENT_APPLICATION + app: WGI_AGENT_APPLICATION do create app.make (a_callback) create connector.make_with_base (app, a_base_url) diff --git a/library/server/ewsgi/examples/hello_world/src/hello_world.e b/library/server/ewsgi/examples/hello_world/src/hello_world.e index 957c10a0..522c0b48 100644 --- a/library/server/ewsgi/examples/hello_world/src/hello_world.e +++ b/library/server/ewsgi/examples/hello_world/src/hello_world.e @@ -18,7 +18,7 @@ feature {NONE} -- Initialization (create {NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number) end - execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) do res.write_header (200, <<["Content-Type", "text/plain"]>>) res.write_string ("Hello World!%N") diff --git a/library/server/ewsgi/examples/hello_world_with_response/src/hello_world.e b/library/server/ewsgi/examples/hello_world_with_response/src/hello_world.e index 0e1344c6..910a9f5d 100644 --- a/library/server/ewsgi/examples/hello_world_with_response/src/hello_world.e +++ b/library/server/ewsgi/examples/hello_world_with_response/src/hello_world.e @@ -8,18 +8,18 @@ class HELLO_WORLD inherit - EWSGI_RESPONSE_APPLICATION + WGI_RESPONSE_APPLICATION - DEFAULT_EWSGI_APPLICATION + DEFAULT_WGI_APPLICATION create make_and_launch feature -- Response - response (request: EWSGI_REQUEST): EWSGI_RESPONSE + response (request: WGI_REQUEST): WGI_RESPONSE do - if request.environment.path_info.starts_with ("/streaming/") then + if request.path_info.starts_with ("/streaming/") then Result := streaming_response (request) else create Result.make @@ -29,7 +29,7 @@ feature -- Response end end - streaming_response (request: EWSGI_REQUEST): EWSGI_RESPONSE + streaming_response (request: WGI_REQUEST): WGI_RESPONSE do create {HELLO_WORLD_RESPONSE} Result.make Result.set_status (200) diff --git a/library/server/ewsgi/examples/hello_world_with_response/src/hello_world_response.e b/library/server/ewsgi/examples/hello_world_with_response/src/hello_world_response.e index fad48337..09fde7f2 100644 --- a/library/server/ewsgi/examples/hello_world_with_response/src/hello_world_response.e +++ b/library/server/ewsgi/examples/hello_world_with_response/src/hello_world_response.e @@ -6,7 +6,7 @@ note class HELLO_WORLD_RESPONSE inherit - EWSGI_RESPONSE + WGI_RESPONSE redefine make, read_block diff --git a/library/server/ewsgi/specification/connector/ewsgi_connector.e b/library/server/ewsgi/specification/connector/wgi_connector.e similarity index 86% rename from library/server/ewsgi/specification/connector/ewsgi_connector.e rename to library/server/ewsgi/specification/connector/wgi_connector.e index ef2a666c..cfd400d3 100644 --- a/library/server/ewsgi/specification/connector/ewsgi_connector.e +++ b/library/server/ewsgi/specification/connector/wgi_connector.e @@ -1,11 +1,11 @@ note - description: "Summary description for {EWSGI_CONNECTOR}." + description: "Summary description for {WGI_CONNECTOR}." author: "" date: "$Date$" revision: "$Revision$" deferred class - EWSGI_CONNECTOR + WGI_CONNECTOR feature {NONE} -- Initialization @@ -22,7 +22,7 @@ feature {NONE} -- Initialization feature {NONE} -- Access - application: EWSGI_APPLICATION + application: WGI_APPLICATION -- Gateway Application feature -- Server diff --git a/library/server/ewsgi/specification/request/obsolete/ewsgi_cookie.e b/library/server/ewsgi/specification/request/obsolete/wgi_cookie.e similarity index 99% rename from library/server/ewsgi/specification/request/obsolete/ewsgi_cookie.e rename to library/server/ewsgi/specification/request/obsolete/wgi_cookie.e index 262ef4b6..d76edbbc 100644 --- a/library/server/ewsgi/specification/request/obsolete/ewsgi_cookie.e +++ b/library/server/ewsgi/specification/request/obsolete/wgi_cookie.e @@ -8,7 +8,7 @@ note revision: "$Revision$" class - EWSGI_COOKIE + WGI_COOKIE create make diff --git a/library/server/ewsgi/specification/request/obsolete/ewsgi_variables.e b/library/server/ewsgi/specification/request/obsolete/wgi_variables.e similarity index 94% rename from library/server/ewsgi/specification/request/obsolete/ewsgi_variables.e rename to library/server/ewsgi/specification/request/obsolete/wgi_variables.e index 048270e7..f3da8079 100644 --- a/library/server/ewsgi/specification/request/obsolete/ewsgi_variables.e +++ b/library/server/ewsgi/specification/request/obsolete/wgi_variables.e @@ -8,7 +8,7 @@ note revision: "$Revision$" deferred class - EWSGI_VARIABLES [G -> STRING_GENERAL] + WGI_VARIABLES [G -> STRING_GENERAL] inherit ITERABLE [G] @@ -49,7 +49,7 @@ feature -- Access 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) require diff --git a/library/server/ewsgi/specification/request/ewsgi_meta_names.e b/library/server/ewsgi/specification/request/wgi_meta_names.e similarity index 95% rename from library/server/ewsgi/specification/request/ewsgi_meta_names.e rename to library/server/ewsgi/specification/request/wgi_meta_names.e index 217e81bd..8b10840e 100644 --- a/library/server/ewsgi/specification/request/ewsgi_meta_names.e +++ b/library/server/ewsgi/specification/request/wgi_meta_names.e @@ -1,12 +1,12 @@ note - description: "Summary description for {EWSGI_META_NAMES}." + description: "Summary description for {WGI_META_NAMES}." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" class - EWSGI_META_NAMES + WGI_META_NAMES feature -- Access diff --git a/library/server/ewsgi/specification/request/ewsgi_request.e b/library/server/ewsgi/specification/request/wgi_request.e similarity index 93% rename from library/server/ewsgi/specification/request/ewsgi_request.e rename to library/server/ewsgi/specification/request/wgi_request.e index fc7ffd67..da041511 100644 --- a/library/server/ewsgi/specification/request/ewsgi_request.e +++ b/library/server/ewsgi/specification/request/wgi_request.e @@ -71,11 +71,11 @@ note revision: "$Revision$" deferred class - EWSGI_REQUEST + WGI_REQUEST feature -- Access: Input - input: EWSGI_INPUT_STREAM + input: WGI_INPUT_STREAM -- Server input channel deferred end @@ -87,16 +87,16 @@ feature -- Access: extra values deferred 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' require a_name_valid: a_name /= Void and then not a_name.is_empty deferred 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. -- Interpretation of these variables may depend on the value of -- SERVER_PROTOCOL. @@ -128,7 +128,7 @@ feature -- Access: CGI environment variables 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" -- scheme. -- @@ -150,7 +150,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - content_length: detachable READABLE_STRING_8 + content_length: detachable READABLE_STRING_32 -- This metavariable is set to the size of the message-body -- entity attached to the request, if any, in decimal number of -- octets. If no data are attached, then this metavariable is @@ -170,7 +170,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred 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 -- the Internet Media Type [9] of the attached entity if the type -- 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 end - gateway_interface: READABLE_STRING_8 + gateway_interface: READABLE_STRING_32 -- This metavariable is set to the dialect of CGI being used by -- the server to communicate with the script. Syntax: -- @@ -246,7 +246,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - path_info: READABLE_STRING_8 + path_info: READABLE_STRING_32 -- The PATH_INFO metavariable specifies a path to be interpreted -- by the CGI script. It identifies the resource or sub-resource -- 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 end - path_translated: detachable READABLE_STRING_8 + path_translated: detachable READABLE_STRING_32 -- PATH_TRANSLATED is derived by taking any path-info component -- 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 @@ -323,7 +323,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - query_string: READABLE_STRING_8 + query_string: READABLE_STRING_32 -- A URL-encoded string; the part of the Script-URI. (See -- section 3.2.) -- @@ -340,7 +340,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - remote_addr: READABLE_STRING_8 + remote_addr: READABLE_STRING_32 -- The IP address of the client sending the request to the -- server. This is not necessarily that of the user agent (such -- as if the request came through a proxy). @@ -355,7 +355,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - remote_host: detachable READABLE_STRING_8 + remote_host: detachable READABLE_STRING_32 -- The fully qualified domain name of the client sending the -- request to the server, if available, otherwise NULL. (See -- 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 end - remote_ident: detachable READABLE_STRING_8 + remote_ident: detachable READABLE_STRING_32 -- The identity information reported about the connection by a -- RFC 1413 [11] request to the remote agent, if available. -- 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 end - remote_user: detachable READABLE_STRING_8 + remote_user: detachable READABLE_STRING_32 -- If the request required authentication using the "Basic" -- mechanism (i.e., the AUTH_TYPE metavariable is set to -- "Basic"), then the value of the REMOTE_USER metavariable is @@ -398,7 +398,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - request_method: READABLE_STRING_8 + request_method: READABLE_STRING_32 -- The REQUEST_METHOD metavariable is set to the method with -- 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 @@ -419,7 +419,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - script_name: READABLE_STRING_8 + script_name: READABLE_STRING_32 -- The SCRIPT_NAME metavariable is set to a URL path that could -- identify the CGI script (rather than the script's output). The -- syntax and semantics are identical to a decoded HTTP URL @@ -437,7 +437,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - server_name: READABLE_STRING_8 + server_name: READABLE_STRING_32 -- The SERVER_NAME metavariable is set to the name of the server, -- as derived from the part of the Script-URI (see section -- 3.2). @@ -463,7 +463,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - server_protocol: READABLE_STRING_8 + server_protocol: READABLE_STRING_32 -- The SERVER_PROTOCOL metavariable is set to the name and -- revision of the information protocol with which the request -- arrived. This is not necessarily the same as the protocol @@ -491,7 +491,7 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 deferred end - server_software: READABLE_STRING_8 + server_software: READABLE_STRING_32 -- The SERVER_SOFTWARE metavariable is set to the name and -- version of the information server software answering the -- request (and running the gateway). @@ -506,42 +506,42 @@ feature -- Common Gateway Interface - 1.1 8 January 1996 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. -- Example: 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' deferred 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. -- Example: 'iso-8859-1,*,utf-8'. deferred 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. -- Example: 'gzip'. deferred 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. -- Example: 'en'. deferred 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. -- Example: 'Keep-Alive'. deferred 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. deferred 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. -- 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. @@ -549,7 +549,7 @@ feature -- HTTP_* deferred 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. -- 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). @@ -558,26 +558,26 @@ feature -- HTTP_* deferred 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. deferred end 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'. deferred 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 deferred end --feature -- Access: execution variables --- execution_variables: EWSGI_VARIABLES [STRING_32] +-- execution_variables: WGI_VARIABLES [STRING_32] -- -- Execution variables set by the application -- deferred -- end @@ -617,7 +617,7 @@ feature -- Form fields and related deferred 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 --| name: original path from the user --| type: content type @@ -689,10 +689,10 @@ invariant query_string_attached: query_string /= Void remote_addr_attached: remote_addr /= Void - same_orig_path_info: orig_path_info ~ meta_variable ({EWSGI_META_NAMES}.orig_path_info) - same_path_info: path_info ~ meta_variable ({EWSGI_META_NAMES}.path_info) + same_orig_path_info: orig_path_info ~ meta_variable ({WGI_META_NAMES}.orig_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 copyright: "2011-2011, Eiffel Software and others" diff --git a/library/server/ewsgi/specification/request/ewsgi_uploaded_file_data.e b/library/server/ewsgi/specification/request/wgi_uploaded_file_data.e similarity index 95% rename from library/server/ewsgi/specification/request/ewsgi_uploaded_file_data.e rename to library/server/ewsgi/specification/request/wgi_uploaded_file_data.e index a8f2ea36..339febae 100644 --- a/library/server/ewsgi/specification/request/ewsgi_uploaded_file_data.e +++ b/library/server/ewsgi/specification/request/wgi_uploaded_file_data.e @@ -1,11 +1,11 @@ note - description: "Summary description for {GW_UPLOADED_FILE}." + description: "Summary description for {WGI_UPLOADED_FILE_DATA}." author: "" date: "$Date$" revision: "$Revision$" class - EWSGI_UPLOADED_FILE_DATA + WGI_UPLOADED_FILE_DATA create make diff --git a/library/server/ewsgi/specification/response/ewsgi_response_buffer.e b/library/server/ewsgi/specification/response/wgi_response_buffer.e similarity index 93% rename from library/server/ewsgi/specification/response/ewsgi_response_buffer.e rename to library/server/ewsgi/specification/response/wgi_response_buffer.e index f79da815..7cf4e9fa 100644 --- a/library/server/ewsgi/specification/response/ewsgi_response_buffer.e +++ b/library/server/ewsgi/specification/response/wgi_response_buffer.e @@ -1,13 +1,13 @@ note - description: "Summary description for {EWSGI_RESPONSE_BUFFER}." + description: "Summary description for {WGI_RESPONSE_BUFFER}." author: "" date: "$Date$" revision: "$Revision$" deferred class - EWSGI_RESPONSE_BUFFER + WGI_RESPONSE_BUFFER -feature {EWSGI_APPLICATION} -- Commit +feature {WGI_APPLICATION} -- Commit commit -- Commit the current response @@ -35,7 +35,7 @@ feature -- Status report deferred end -feature {EWSGI_RESPONSE_BUFFER} -- Core output operation +feature {WGI_RESPONSE_BUFFER} -- Core output operation write (s: STRING) -- Send the string `s' diff --git a/library/server/ewsgi/specification/stream/ewsgi_input_stream.e b/library/server/ewsgi/specification/stream/wgi_input_stream.e similarity index 97% rename from library/server/ewsgi/specification/stream/ewsgi_input_stream.e rename to library/server/ewsgi/specification/stream/wgi_input_stream.e index 60b49623..940c2367 100644 --- a/library/server/ewsgi/specification/stream/ewsgi_input_stream.e +++ b/library/server/ewsgi/specification/stream/wgi_input_stream.e @@ -8,7 +8,7 @@ note revision: "$Revision$" deferred class - EWSGI_INPUT_STREAM + WGI_INPUT_STREAM feature -- Access diff --git a/library/server/ewsgi/specification/stream/ewsgi_output_stream.e b/library/server/ewsgi/specification/stream/wgi_output_stream.e similarity index 98% rename from library/server/ewsgi/specification/stream/ewsgi_output_stream.e rename to library/server/ewsgi/specification/stream/wgi_output_stream.e index 1f7c6fce..de11fcb1 100644 --- a/library/server/ewsgi/specification/stream/ewsgi_output_stream.e +++ b/library/server/ewsgi/specification/stream/wgi_output_stream.e @@ -8,7 +8,7 @@ note revision: "$Revision$" deferred class - EWSGI_OUTPUT_STREAM + WGI_OUTPUT_STREAM feature -- Core operation diff --git a/library/server/ewsgi/specification/ewsgi_application.e b/library/server/ewsgi/specification/wgi_application.e similarity index 85% rename from library/server/ewsgi/specification/ewsgi_application.e rename to library/server/ewsgi/specification/wgi_application.e index 244a832c..121dd7e5 100644 --- a/library/server/ewsgi/specification/ewsgi_application.e +++ b/library/server/ewsgi/specification/wgi_application.e @@ -1,16 +1,16 @@ note - description: "Summary description for {EWSGI_APPLICATION}." + description: "Summary description for {WGI_APPLICATION}." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" deferred class - EWSGI_APPLICATION + WGI_APPLICATION feature {NONE} -- Execution - execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Execute the request -- See `req.input' for input stream -- `req.environment' for the Gateway environment diff --git a/library/server/ewsgi/src/application/ewsgi_agent_application.e b/library/server/ewsgi/src/application/wgi_agent_application.e similarity index 75% rename from library/server/ewsgi/src/application/ewsgi_agent_application.e rename to library/server/ewsgi/src/application/wgi_agent_application.e index 2f3c1c1b..6a5785a8 100644 --- a/library/server/ewsgi/src/application/ewsgi_agent_application.e +++ b/library/server/ewsgi/src/application/wgi_agent_application.e @@ -1,14 +1,14 @@ note - description: "Summary description for {EWSGI_AGENT_APPLICATION}." + description: "Summary description for {WGI_AGENT_APPLICATION}." author: "" date: "$Date$" revision: "$Revision$" class - EWSGI_AGENT_APPLICATION + WGI_AGENT_APPLICATION inherit - EWSGI_APPLICATION + WGI_APPLICATION create make @@ -23,10 +23,10 @@ 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' - execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Execute the request do callback.call ([req, res]) diff --git a/library/server/ewsgi/src/application/ewsgi_application.e b/library/server/ewsgi/src/application/wgi_application.e similarity index 84% rename from library/server/ewsgi/src/application/ewsgi_application.e rename to library/server/ewsgi/src/application/wgi_application.e index 5ec1ad7b..4c5a8d22 100644 --- a/library/server/ewsgi/src/application/ewsgi_application.e +++ b/library/server/ewsgi/src/application/wgi_application.e @@ -1,6 +1,6 @@ note description: "[ - EWSGI_APPLICATION + WGI_APPLICATION ]" specification: "EWSGI specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/EWSGI-specification" legal: "See notice at end of class." @@ -9,11 +9,11 @@ note revision: "$Revision$" deferred class - EWSGI_APPLICATION + WGI_APPLICATION feature -- Execution - execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Execute the request -- See `req.input' for input stream -- `req.environment' for the Gateway environment @@ -28,7 +28,7 @@ feature -- Execution 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' local rescued: BOOLEAN @@ -53,17 +53,17 @@ feature -- Access feature {NONE} -- Execution - pre_execute (req: EWSGI_REQUEST) + pre_execute (req: WGI_REQUEST) -- Operation processed before `execute' do 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' do 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' do if diff --git a/library/server/ewsgi/src/connector/ewsgi_connector.e b/library/server/ewsgi/src/connector/wgi_connector.e similarity index 88% rename from library/server/ewsgi/src/connector/ewsgi_connector.e rename to library/server/ewsgi/src/connector/wgi_connector.e index 1207ee9d..eac74fbe 100644 --- a/library/server/ewsgi/src/connector/ewsgi_connector.e +++ b/library/server/ewsgi/src/connector/wgi_connector.e @@ -1,11 +1,11 @@ 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" date: "$Date$" revision: "$Revision$" deferred class - EWSGI_CONNECTOR + WGI_CONNECTOR feature {NONE} -- Initialization @@ -22,7 +22,7 @@ feature {NONE} -- Initialization feature {NONE} -- Access - application: EWSGI_APPLICATION + application: WGI_APPLICATION -- Gateway Application feature -- Server diff --git a/library/server/ewsgi/src/extra/ewf_buffered_response.e b/library/server/ewsgi/src/extra/ewf_buffered_response.e index 62d34562..123dd75a 100644 --- a/library/server/ewsgi/src/extra/ewf_buffered_response.e +++ b/library/server/ewsgi/src/extra/ewf_buffered_response.e @@ -8,9 +8,9 @@ class EWF_BUFFERED_RESPONSE inherit - EWSGI_RESPONSE_BUFFER + WGI_RESPONSE_BUFFER -create {EWSGI_APPLICATION} +create {WGI_APPLICATION} make feature {NONE} -- Initialization @@ -22,7 +22,7 @@ feature {NONE} -- Initialization create buffer.make (a_buffer_size) end - response_buffer: EWSGI_RESPONSE_BUFFER + response_buffer: WGI_RESPONSE_BUFFER buffer: STRING_8 @@ -79,7 +79,7 @@ feature {NONE} -- Implementation buffer_flushed: buffer_count = 0 and buffer.count = 0 end -feature {EWSGI_APPLICATION} -- Commit +feature {WGI_APPLICATION} -- Commit commit do diff --git a/library/server/ewsgi/src/extra/in_memory/ewf_in_memory_response.e b/library/server/ewsgi/src/extra/in_memory/ewf_in_memory_response.e index eede32e4..d6688b0b 100644 --- a/library/server/ewsgi/src/extra/in_memory/ewf_in_memory_response.e +++ b/library/server/ewsgi/src/extra/in_memory/ewf_in_memory_response.e @@ -7,27 +7,27 @@ class EWF_IN_MEMORY_RESPONSE inherit - EWSGI_RESPONSE_BUFFER + WGI_RESPONSE_BUFFER -create {EWSGI_APPLICATION} +create {WGI_APPLICATION} make feature {NONE} -- Initialization - make (res: EWSGI_RESPONSE_BUFFER) + make (res: WGI_RESPONSE_BUFFER) do response_buffer := res create header.make create body.make (100) end - response_buffer: EWSGI_RESPONSE_BUFFER + response_buffer: WGI_RESPONSE_BUFFER header: EWF_HEADER body: STRING_8 -feature {EWSGI_APPLICATION} -- Commit +feature {WGI_APPLICATION} -- Commit commit local diff --git a/library/server/ewsgi/src/extra/in_memory/ewf_in_memory_response_application.e b/library/server/ewsgi/src/extra/in_memory/ewf_in_memory_response_application.e index 36adbd4c..c1528e0c 100644 --- a/library/server/ewsgi/src/extra/in_memory/ewf_in_memory_response_application.e +++ b/library/server/ewsgi/src/extra/in_memory/ewf_in_memory_response_application.e @@ -8,7 +8,7 @@ deferred class EWF_IN_MEMORY_RESPONSE_APPLICATION inherit - EWSGI_APPLICATION + WGI_APPLICATION rename execute as app_execute end @@ -16,7 +16,7 @@ inherit feature -- Execution - app_execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + app_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Execute the request -- See `req.input' for input stream -- `req.environment' for the Gateway environment @@ -27,7 +27,7 @@ feature -- Execution feature -- Execute - execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Execute the request -- See `req.input' for input stream -- `req.environment' for the Gateway environment @@ -41,7 +41,7 @@ feature -- Execute 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 create {EWF_IN_MEMORY_RESPONSE} Result.make (a_res) end diff --git a/library/server/ewsgi/src/extra/response_as_result/ewsgi_response.e b/library/server/ewsgi/src/extra/response_as_result/wgi_response.e similarity index 95% rename from library/server/ewsgi/src/extra/response_as_result/ewsgi_response.e rename to library/server/ewsgi/src/extra/response_as_result/wgi_response.e index d55b214e..62cce845 100644 --- a/library/server/ewsgi/src/extra/response_as_result/ewsgi_response.e +++ b/library/server/ewsgi/src/extra/response_as_result/wgi_response.e @@ -8,7 +8,7 @@ note author: "Paul Cohen " status: "Draft" -class EWSGI_RESPONSE +class WGI_RESPONSE create make @@ -26,9 +26,9 @@ feature {NONE} -- Initialization create headers_table.make (10) 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 res.set_status_code (status) res.write_headers_string (headers) @@ -64,7 +64,7 @@ feature {EWSGI_RESPONSE_APPLICATION} -- Response status ready_to_transmit end -feature {EWSGI_RESPONSE_APPLICATION} -- Message start line and status +feature {WGI_RESPONSE_APPLICATION} -- Message start line and status status: INTEGER -- HTTP status code @@ -88,7 +88,7 @@ feature {EWSGI_RESPONSE_APPLICATION} -- Message start line and status end end -feature {EWSGI_RESPONSE_APPLICATION} -- Message headers +feature {WGI_RESPONSE_APPLICATION} -- Message headers headers: STRING -- 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 end -feature {EWSGI_RESPONSE_APPLICATION} -- Message body +feature {WGI_RESPONSE_APPLICATION} -- Message body read_block -- Read a message body block. diff --git a/library/server/ewsgi/src/extra/response_as_result/ewsgi_response_application.e b/library/server/ewsgi/src/extra/response_as_result/wgi_response_application.e similarity index 82% rename from library/server/ewsgi/src/extra/response_as_result/ewsgi_response_application.e rename to library/server/ewsgi/src/extra/response_as_result/wgi_response_application.e index 2be15d32..aad8bf91 100644 --- a/library/server/ewsgi/src/extra/response_as_result/ewsgi_response_application.e +++ b/library/server/ewsgi/src/extra/response_as_result/wgi_response_application.e @@ -1,22 +1,22 @@ note - description: "Summary description for {EWSGI_RESPONSE_APPLICATION} " + description: "Summary description for {WGI_RESPONSE_APPLICATION} " legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" deferred class - EWSGI_RESPONSE_APPLICATION + WGI_RESPONSE_APPLICATION feature -- Execution - execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Execute the request -- See `req.input' for input stream -- `req.environment' for the Gateway environment -- and `res.output' for output stream local - rs: EWSGI_RESPONSE + rs: WGI_RESPONSE do rs := response (req) if rs.ready_to_transmit then @@ -24,7 +24,7 @@ feature -- Execution else -- Report internal server error. -- 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 rs.set_status (500) rs.set_header ("Content-Type", "text/plain") @@ -35,7 +35,7 @@ feature -- Execution feature -- Response - response (request: EWSGI_REQUEST): EWSGI_RESPONSE + response (request: WGI_REQUEST): WGI_RESPONSE -- HTTP response for given 'request'. deferred ensure diff --git a/library/server/ewsgi/src/request/ewsgi_request_from_table.e b/library/server/ewsgi/src/request/wgi_request_from_table.e similarity index 85% rename from library/server/ewsgi/src/request/ewsgi_request_from_table.e rename to library/server/ewsgi/src/request/wgi_request_from_table.e index 028f44ed..da33dfa4 100644 --- a/library/server/ewsgi/src/request/ewsgi_request_from_table.e +++ b/library/server/ewsgi/src/request/wgi_request_from_table.e @@ -9,17 +9,17 @@ note revision: "$Revision$" class - EWSGI_REQUEST_FROM_TABLE + WGI_REQUEST_FROM_TABLE inherit - EWSGI_REQUEST + WGI_REQUEST create make 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 vars_attached: a_vars /= Void do @@ -34,11 +34,11 @@ feature {NONE} -- Initialization analyze 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' local - s: detachable READABLE_STRING_8 - table: HASH_TABLE [STRING, STRING] + s: like meta_variable + table: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] do create empty_string.make_empty @@ -54,13 +54,13 @@ feature {NONE} -- Initialization end --| 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 := 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 - 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 content_type := s else @@ -68,7 +68,7 @@ feature {NONE} -- Initialization end --| CONTENT_LENGTH - s := meta_variable ({EWSGI_META_NAMES}.content_length) + s := meta_variable ({WGI_META_NAMES}.content_length) content_length := s if s /= Void and then s.is_natural_64 then content_length_value := s.to_natural_64 @@ -77,13 +77,13 @@ feature {NONE} -- Initialization end --| 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 := 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 - 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 server_port := s.to_integer else @@ -91,16 +91,16 @@ feature {NONE} -- Initialization end --| 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 := 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 := 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 := 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 initialize @@ -114,13 +114,13 @@ feature {NONE} -- Initialization if attached request_uri as rq_uri then p := rq_uri.index_of ('?', 1) 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 - set_meta_parameter (rq_uri, {EWSGI_META_NAMES}.self) + set_meta_parameter (rq_uri, {WGI_META_NAMES}.self) end end - if meta_variable ({EWSGI_META_NAMES}.request_time) = Void then - set_meta_parameter (date_time_utilities.unix_time_stamp (Void).out, {EWSGI_META_NAMES}.request_time) + if meta_variable ({WGI_META_NAMES}.request_time) = Void then + set_meta_parameter (date_time_utilities.unix_time_stamp (Void).out, {WGI_META_NAMES}.request_time) end end @@ -151,7 +151,7 @@ feature -- Error handling feature -- Access: Input - input: EWSGI_INPUT_STREAM + input: WGI_INPUT_STREAM -- Server input channel feature -- Access extra information @@ -160,7 +160,7 @@ feature -- Access extra information -- Request time (UTC) do 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 then 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 - meta_variables: HASH_TABLE [READABLE_STRING_8, READABLE_STRING_GENERAL] + meta_variables: HASH_TABLE [READABLE_STRING_32, READABLE_STRING_GENERAL] -- 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' do Result := meta_variables.item (a_name) 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' -- If not found, return `a_default' require @@ -195,7 +195,7 @@ feature -- Access: CGI meta parameters 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 meta_variables.force (a_value, a_name) ensure @@ -211,20 +211,20 @@ feature -- Access: CGI meta parameters 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_type: detachable READABLE_STRING_8 + content_type: detachable READABLE_STRING_32 - gateway_interface: READABLE_STRING_8 + gateway_interface: READABLE_STRING_32 do - Result := meta_parameter_or_default ({EWSGI_META_NAMES}.gateway_interface, "", False) + Result := meta_parameter_or_default ({WGI_META_NAMES}.gateway_interface, "", False) end - path_info: READABLE_STRING_8 + path_info: READABLE_STRING_32 -- -- --| 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 - path_translated: detachable READABLE_STRING_8 + path_translated: detachable READABLE_STRING_32 do - Result := meta_variable ({EWSGI_META_NAMES}.path_translated) + Result := meta_variable ({WGI_META_NAMES}.path_translated) 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 - Result := meta_variable ({EWSGI_META_NAMES}.remote_ident) + Result := meta_variable ({WGI_META_NAMES}.remote_ident) end - remote_user: detachable READABLE_STRING_8 + remote_user: detachable READABLE_STRING_32 do - Result := meta_variable ({EWSGI_META_NAMES}.remote_user) + Result := meta_variable ({WGI_META_NAMES}.remote_user) 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_protocol: READABLE_STRING_8 + server_protocol: READABLE_STRING_32 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 - server_software: READABLE_STRING_8 + server_software: READABLE_STRING_32 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 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. do - Result := meta_variable ({EWSGI_META_NAMES}.http_accept) + Result := meta_variable ({WGI_META_NAMES}.http_accept) 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. -- Example: 'iso-8859-1,*,utf-8'. do - Result := meta_variable ({EWSGI_META_NAMES}.http_accept_charset) + Result := meta_variable ({WGI_META_NAMES}.http_accept_charset) 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. -- Example: 'gzip'. do - Result := meta_variable ({EWSGI_META_NAMES}.http_accept_encoding) + Result := meta_variable ({WGI_META_NAMES}.http_accept_encoding) 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. -- Example: 'en'. do - Result := meta_variable ({EWSGI_META_NAMES}.http_accept_language) + Result := meta_variable ({WGI_META_NAMES}.http_accept_language) 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. -- Example: 'Keep-Alive'. do - Result := meta_variable ({EWSGI_META_NAMES}.http_connection) + Result := meta_variable ({WGI_META_NAMES}.http_connection) 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. do - Result := meta_variable ({EWSGI_META_NAMES}.http_host) + Result := meta_variable ({WGI_META_NAMES}.http_host) 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. -- 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. -- In short, it cannot really be trusted. do - Result := meta_variable ({EWSGI_META_NAMES}.http_referer) + Result := meta_variable ({WGI_META_NAMES}.http_referer) 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. -- 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). -- Among other things, you can use this value to tailor your page's -- output to the capabilities of the user agent. do - Result := meta_variable ({EWSGI_META_NAMES}.http_user_agent) + Result := meta_variable ({WGI_META_NAMES}.http_user_agent) 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. do - Result := meta_variable ({EWSGI_META_NAMES}.http_authorization) + Result := meta_variable ({WGI_META_NAMES}.http_authorization) end 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'. - orig_path_info: detachable STRING + orig_path_info: detachable READABLE_STRING_32 -- Original version of `path_info' before processed by Current environment 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' require s_attached: s /= Void do 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 unset_orig_path_info -- Unset ORIG_PATH_INFO do orig_path_info := Void - unset_meta_parameter ({EWSGI_META_NAMES}.orig_path_info) + unset_meta_parameter ({WGI_META_NAMES}.orig_path_info) ensure - unset: attached meta_variable ({EWSGI_META_NAMES}.orig_path_info) + unset: attached meta_variable ({WGI_META_NAMES}.orig_path_info) end update_path_info @@ -518,7 +518,7 @@ feature -- Form fields and related Result := form_data_parameters.item (a_name) end - uploaded_files: HASH_TABLE [EWSGI_UPLOADED_FILE_DATA, STRING] + uploaded_files: HASH_TABLE [WGI_UPLOADED_FILE_DATA, STRING] -- Table of uploaded files information --| name: original path from the user --| type: content type @@ -538,7 +538,7 @@ feature -- Cookies do l_cookies := internal_cookies 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) from n := s.count @@ -748,7 +748,7 @@ feature -- Element change 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' require uf_valid: uf /= Void @@ -771,7 +771,7 @@ feature {NONE} -- Temporary File handling 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' local bn: STRING @@ -938,7 +938,7 @@ feature {NONE} -- Implementation: Form analyzer l_header: detachable STRING l_content: detachable STRING l_line: detachable STRING - l_up_file_info: EWSGI_UPLOADED_FILE_DATA + l_up_file_info: WGI_UPLOADED_FILE_DATA do from p := 1 @@ -1115,7 +1115,7 @@ feature {NONE} -- Implementation extract_variables -- Extract relevant meta parameters local - s: detachable READABLE_STRING_8 + s: detachable READABLE_STRING_32 do s := request_uri if s.is_empty then diff --git a/library/server/ewsgi/src/response/ewsgi_response_stream_buffer.e b/library/server/ewsgi/src/response/wgi_response_stream_buffer.e similarity index 95% rename from library/server/ewsgi/src/response/ewsgi_response_stream_buffer.e rename to library/server/ewsgi/src/response/wgi_response_stream_buffer.e index a5f263e8..b8dcd245 100644 --- a/library/server/ewsgi/src/response/ewsgi_response_stream_buffer.e +++ b/library/server/ewsgi/src/response/wgi_response_stream_buffer.e @@ -8,10 +8,10 @@ note revision: "$Revision$" class - EWSGI_RESPONSE_STREAM_BUFFER + WGI_RESPONSE_STREAM_BUFFER inherit - EWSGI_RESPONSE_BUFFER + WGI_RESPONSE_BUFFER create make @@ -23,7 +23,7 @@ feature {NONE} -- Initialization output := a_output end -feature {EWSGI_APPLICATION} -- Commit +feature {WGI_APPLICATION} -- Commit commit -- Commit the current response @@ -133,7 +133,7 @@ feature -- Output operation feature {NONE} -- Implementation: Access - output: EWSGI_OUTPUT_STREAM + output: WGI_OUTPUT_STREAM -- Server output channel ;note diff --git a/library/server/ewsgi/src/stream/ewsgi_input_stream.e b/library/server/ewsgi/src/stream/wgi_input_stream.e similarity index 97% rename from library/server/ewsgi/src/stream/ewsgi_input_stream.e rename to library/server/ewsgi/src/stream/wgi_input_stream.e index 7affe82f..bde896d6 100644 --- a/library/server/ewsgi/src/stream/ewsgi_input_stream.e +++ b/library/server/ewsgi/src/stream/wgi_input_stream.e @@ -9,7 +9,7 @@ note revision: "$Revision$" deferred class - EWSGI_INPUT_STREAM + WGI_INPUT_STREAM feature -- Access diff --git a/library/server/ewsgi/src/stream/ewsgi_output_stream.e b/library/server/ewsgi/src/stream/wgi_output_stream.e similarity index 98% rename from library/server/ewsgi/src/stream/ewsgi_output_stream.e rename to library/server/ewsgi/src/stream/wgi_output_stream.e index ac2127ff..fe1b677d 100644 --- a/library/server/ewsgi/src/stream/ewsgi_output_stream.e +++ b/library/server/ewsgi/src/stream/wgi_output_stream.e @@ -9,7 +9,7 @@ note revision: "$Revision$" deferred class - EWSGI_OUTPUT_STREAM + WGI_OUTPUT_STREAM feature -- Core operation diff --git a/library/server/ewsgi/tests/ewsgi-full.ecf b/library/server/ewsgi/tests/ewsgi-full.ecf index 0d27bb90..64e31420 100644 --- a/library/server/ewsgi/tests/ewsgi-full.ecf +++ b/library/server/ewsgi/tests/ewsgi-full.ecf @@ -10,9 +10,9 @@ + - @@ -20,5 +20,7 @@ + + diff --git a/library/server/request/router/src/application/routed_application.e b/library/server/request/router/src/application/routed_application.e index ffba0738..c22e6080 100644 --- a/library/server/request/router/src/application/routed_application.e +++ b/library/server/request/router/src/application/routed_application.e @@ -35,7 +35,7 @@ feature -- Setup feature -- Execution - execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) do if attached router.dispatch (req, res) as r then --| done @@ -44,7 +44,7 @@ feature -- Execution end end - execute_default (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + execute_default (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) deferred end diff --git a/library/server/request/router/src/context/request_handler_context.e b/library/server/request/router/src/context/request_handler_context.e index 5ce81c50..c249e281 100644 --- a/library/server/request/router/src/context/request_handler_context.e +++ b/library/server/request/router/src/context/request_handler_context.e @@ -17,7 +17,7 @@ inherit feature -- Access - request: EWSGI_REQUEST + request: WGI_REQUEST -- Associated request path: STRING @@ -25,35 +25,34 @@ feature -- Access request_content_type (content_type_supported: detachable ARRAY [STRING]): detachable READABLE_STRING_8 local - s: detachable READABLE_STRING_8 + s: detachable READABLE_STRING_32 i,n: INTEGER do - Result := request.content_type - if Result = Void then - s := request.http_accept - if s /= Void then - if attached accepted_content_types (request) as l_accept_lst then - from - l_accept_lst.start - until - l_accept_lst.after or Result /= Void - loop - s := l_accept_lst.item - if content_type_supported /= Void then - from - i := content_type_supported.lower - n := content_type_supported.upper - until - i > n or Result /= Void - loop - if content_type_supported[i].same_string (s) then - Result := s - end - i := i + 1 + s := request.content_type + if s /= Void then + Result := s + else + if attached accepted_content_types (request) as l_accept_lst then + from + l_accept_lst.start + until + l_accept_lst.after or Result /= Void + loop + s := l_accept_lst.item + if content_type_supported /= Void then + from + i := content_type_supported.lower + n := content_type_supported.upper + until + i > n or Result /= Void + loop + if content_type_supported[i].same_string (s) then + Result := s end + i := i + 1 end - l_accept_lst.forth end + l_accept_lst.forth end end end diff --git a/library/server/request/router/src/context/request_uri_handler_context.e b/library/server/request/router/src/context/request_uri_handler_context.e index 32204107..c6884918 100644 --- a/library/server/request/router/src/context/request_uri_handler_context.e +++ b/library/server/request/router/src/context/request_uri_handler_context.e @@ -15,7 +15,7 @@ create feature {NONE} -- Initialization - make (req: EWSGI_REQUEST; p: like path) + make (req: WGI_REQUEST; p: like path) do request := req path := p diff --git a/library/server/request/router/src/context/request_uri_template_handler_context.e b/library/server/request/router/src/context/request_uri_template_handler_context.e index c7895a2a..1d8aa5c8 100644 --- a/library/server/request/router/src/context/request_uri_template_handler_context.e +++ b/library/server/request/router/src/context/request_uri_template_handler_context.e @@ -15,7 +15,7 @@ create 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 request := req uri_template := tpl diff --git a/library/server/request/router/src/handler/request_agent_handler.e b/library/server/request/router/src/handler/request_agent_handler.e index bcf9e475..545df575 100644 --- a/library/server/request/router/src/handler/request_agent_handler.e +++ b/library/server/request/router/src/handler/request_agent_handler.e @@ -23,11 +23,11 @@ feature -- Initialization 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 - 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 action.call ([ctx, req, res]) end diff --git a/library/server/request/router/src/handler/request_handler.e b/library/server/request/router/src/handler/request_handler.e index 9174d004..7c4cd294 100644 --- a/library/server/request/router/src/handler/request_handler.e +++ b/library/server/request/router/src/handler/request_handler.e @@ -21,7 +21,7 @@ feature -- Access feature -- Status report - is_valid_context (req: EWSGI_REQUEST): BOOLEAN + is_valid_context (req: WGI_REQUEST): BOOLEAN -- Is `req' valid context for current handler? do Result := request_method_name_supported (req.request_method) @@ -29,7 +29,7 @@ feature -- Status report 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 require is_valid_context: is_valid_context (req) @@ -52,7 +52,7 @@ feature -- Execution retry 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 s: STRING lst: LIST [STRING] @@ -75,24 +75,24 @@ feature -- Execution res.write_header ({HTTP_STATUS_CODE}.method_not_allowed, <<["Allow", s]>>) 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 deferred end - pre_execute (req: EWSGI_REQUEST) + pre_execute (req: WGI_REQUEST) -- Operation processed before `execute' do --| To be redefined if needed end - post_execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + post_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Operation processed after `execute' do --| To be redefined if needed end - rescue_execute (req: EWSGI_REQUEST; res: EWSGI_RESPONSE_BUFFER) + rescue_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER) -- Operation processed after a rescue do --| To be redefined if needed @@ -101,7 +101,7 @@ feature -- Execution 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 -- do -- if attached path_information (req, req.environment.path_info) as info then @@ -109,7 +109,7 @@ feature -- Execution: report -- 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' -- local -- l_rq_path: STRING @@ -156,7 +156,7 @@ feature -- Execution: report -- 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' -- if `abs' then return absolute url local diff --git a/library/server/request/router/src/router/request_router.e b/library/server/request/router/src/router/request_router.e index 4f7f8c45..6617023a 100644 --- a/library/server/request/router/src/router/request_router.e +++ b/library/server/request/router/src/router/request_router.e @@ -32,7 +32,7 @@ feature -- Registration 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 -- And return this handler -- If Result is Void, this means no handler was found. @@ -60,7 +60,7 @@ feature -- Execution 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' require req_valid: req /= Void and then req.path_info /= Void diff --git a/library/server/request/router/src/router/request_uri_router.e b/library/server/request/router/src/router/request_uri_router.e index b4080739..c12f82af 100644 --- a/library/server/request/router/src/router/request_uri_router.e +++ b/library/server/request/router/src/router/request_uri_router.e @@ -35,14 +35,14 @@ feature -- Registration 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 h: detachable REQUEST_HANDLER ctx: detachable REQUEST_HANDLER_CONTEXT do - h := handler_by_path (req.environment.path_info) + h := handler_by_path (req.path_info) 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 ctx := handler_context (info.path, req) end @@ -59,13 +59,13 @@ feature {NONE} -- Access: Implementation 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 - req_valid: req /= Void and then req.environment.path_info /= Void + req_valid: req /= Void and then req.path_info /= Void do - Result := smart_handler_by_path (req.environment.path_info) + Result := smart_handler_by_path (req.path_info) 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 handler_by_path (a_path: STRING): detachable REQUEST_HANDLER @@ -107,12 +107,12 @@ feature {NONE} -- Access: Implementation 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 if p /= Void then create Result.make (req, p) else - create Result.make (req, req.environment.path_info) + create Result.make (req, req.path_info) end end diff --git a/library/server/request/router/src/router/request_uri_template_router.e b/library/server/request/router/src/router/request_uri_template_router.e index 94d9ba45..91e56b82 100644 --- a/library/server/request/router/src/router/request_uri_template_router.e +++ b/library/server/request/router/src/router/request_uri_template_router.e @@ -45,7 +45,7 @@ feature -- Registration 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 ctx: detachable REQUEST_URI_TEMPLATE_HANDLER_CONTEXT l_handlers: like handlers @@ -72,7 +72,7 @@ feature {NONE} -- Access: Implementation 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 if p /= Void then create Result.make (req, tpl, tpl_res, p) diff --git a/library/server/request/router/src/utility/request_format_utility.e b/library/server/request/router/src/utility/request_format_utility.e index b0e18850..b5914a49 100644 --- a/library/server/request/router/src/utility/request_format_utility.e +++ b/library/server/request/router/src/utility/request_format_utility.e @@ -9,9 +9,9 @@ class 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 - l_accept: detachable READABLE_STRING_8 + l_accept: detachable READABLE_STRING_32 s: STRING_8 q: READABLE_STRING_8 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" if l_accept /= Void then - lst := l_accept.split (',') + lst := l_accept.as_string_8.split (',') create Result.make (lst.count) from lst.start @@ -41,7 +41,7 @@ feature -- Access lst.forth end - create qs.make (create {COMPARABLE_COMPARATOR [STRING]}) + create qs.make (create {COMPARABLE_COMPARATOR [READABLE_STRING_8]}) qs.reverse_sort (Result) from Result.start