diff --git a/library/server/ewsgi/connectors/cgi/cgi-safe.ecf b/library/server/ewsgi/connectors/cgi/cgi-safe.ecf
index 8d0eaded..cdeca882 100644
--- a/library/server/ewsgi/connectors/cgi/cgi-safe.ecf
+++ b/library/server/ewsgi/connectors/cgi/cgi-safe.ecf
@@ -1,5 +1,5 @@
-
")
- res.put_string (l_trace)
- res.put_string ("")
- end
- res.push
- end
- end
+ process_rescue (res)
if exec /= Void then
exec.clean
end
@@ -59,6 +50,23 @@ feature -- Execution
end
end
+ process_rescue (res: detachable WGI_RESPONSE)
+ do
+ if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.trace as l_trace then
+ if res /= Void then
+ if not res.status_is_set then
+ res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
+ end
+ if res.message_writable then
+ res.put_string ("")
+ res.put_string (html_encoder.encoded_string (l_trace))
+ res.put_string ("")
+ end
+ res.push
+ end
+ end
+ end
+
note
copyright: "2011-2013, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
diff --git a/library/server/ewsgi/connectors/httpd/httpd-safe.ecf b/library/server/ewsgi/connectors/httpd/httpd-safe.ecf
index cd28afb9..0213ebef 100644
--- a/library/server/ewsgi/connectors/httpd/httpd-safe.ecf
+++ b/library/server/ewsgi/connectors/httpd/httpd-safe.ecf
@@ -16,55 +16,7 @@
")
- res.put_string (l_trace)
- res.put_string ("")
- end
- res.push
- end
- end
+ process_rescue (res)
if exec /= Void then
exec.clean
end
@@ -81,10 +84,21 @@ feature -- Request processing
end
end
- base: detachable READABLE_STRING_8
+ process_rescue (res: detachable WGI_RESPONSE)
do
- --TODO
- to_implement ("Base url support")
+ if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.trace as l_trace then
+ if res /= Void then
+ if not res.status_is_set then
+ res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
+ end
+ if res.message_writable then
+ res.put_string ("")
+ res.put_string (html_encoder.encoded_string (l_trace))
+ res.put_string ("")
+ end
+ res.push
+ end
+ end
end
httpd_environment (a_socket: HTTPD_STREAM_SOCKET): STRING_TABLE [READABLE_STRING_8]
@@ -93,6 +107,7 @@ feature -- Request processing
l_request_uri, l_script_name, l_query_string, l_path_info: STRING
l_server_name, l_server_port: detachable STRING
l_headers_map: HASH_TABLE [STRING, STRING]
+ l_base: detachable READABLE_STRING_8
vn: STRING
e: EXECUTION_ENVIRONMENT
@@ -189,7 +204,11 @@ feature -- Request processing
set_environment_variable ({HTTPD_CONFIGURATION}.Server_details, "SERVER_SOFTWARE", Result)
--| Apply `base' value
- if attached base as l_base and then l_request_uri /= Void then
+ l_base := base
+ if l_base = Void then
+ l_base := ""
+ end
+ if l_request_uri /= Void then
if l_request_uri.starts_with (l_base) then
l_path_info := l_request_uri.substring (l_base.count + 1, l_request_uri.count)
p := l_path_info.index_of ('?', 1)
diff --git a/library/server/ewsgi/connectors/httpd/src/wgi_httpd_request_handler_factory.e b/library/server/ewsgi/connectors/httpd/src/wgi_httpd_request_handler_factory.e
index c2b2d5ef..f69d0893 100644
--- a/library/server/ewsgi/connectors/httpd/src/wgi_httpd_request_handler_factory.e
+++ b/library/server/ewsgi/connectors/httpd/src/wgi_httpd_request_handler_factory.e
@@ -12,7 +12,7 @@ inherit
feature -- Access
- connector: detachable separate WGI_CONNECTOR
+ connector: detachable separate WGI_HTTPD_CONNECTOR [G]
feature -- Element change
diff --git a/library/server/ewsgi/connectors/libfcgi/libfcgi-safe.ecf b/library/server/ewsgi/connectors/libfcgi/libfcgi-safe.ecf
index 689dcbf5..7cc2a211 100644
--- a/library/server/ewsgi/connectors/libfcgi/libfcgi-safe.ecf
+++ b/library/server/ewsgi/connectors/libfcgi/libfcgi-safe.ecf
@@ -1,5 +1,5 @@
-")
- res.put_string (l_trace)
- res.put_string ("")
- end
- res.push
- end
- end
+ process_rescue (res)
if exec /= Void then
exec.clean
end
@@ -90,6 +82,23 @@ feature -- Execution
retry
end
end
+
+ process_rescue (res: detachable WGI_RESPONSE)
+ do
+ if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.trace as l_trace then
+ if res /= Void then
+ if not res.status_is_set then
+ res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
+ end
+ if res.message_writable then
+ res.put_string ("")
+ res.put_string (html_encoder.encoded_string (l_trace))
+ res.put_string ("")
+ end
+ res.push
+ end
+ end
+ end
feature -- Input/Output
diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e
index 7543a0df..524659ac 100644
--- a/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e
+++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e
@@ -9,18 +9,18 @@ class
inherit
WGI_CONNECTOR
+ SHARED_HTML_ENCODER
+
create
make,
make_with_base
feature {NONE} -- Initialization
- make --(a_service: like service)
+ make
local
cfg: HTTP_SERVER_CONFIGURATION
do
--- service := a_service
-
create cfg.make
create server.make (cfg)
@@ -45,11 +45,6 @@ feature -- Access
version: STRING_8 = "0.1"
-- Version of Current connector
---feature {NONE} -- Access
-
--- service: WGI_SERVICE
--- -- Gateway Service
-
feature -- Access
server: HTTP_SERVER
@@ -142,23 +137,10 @@ feature -- Server
create {G} exec.make (req, res)
exec.execute
- res.flush
res.push
exec.clean
else
- if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
- if res /= Void then
- if not res.status_is_set then
- res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
- end
- if res.message_writable then
- res.put_string ("")
- res.put_string (l_trace)
- res.put_string ("")
- end
- res.push
- end
- end
+ process_rescue (res)
if exec /= Void then
exec.clean
end
@@ -170,6 +152,23 @@ feature -- Server
end
end
+ process_rescue (res: detachable WGI_RESPONSE)
+ do
+ if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.trace as l_trace then
+ if res /= Void then
+ if not res.status_is_set then
+ res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error, Void)
+ end
+ if res.message_writable then
+ res.put_string ("")
+ res.put_string (html_encoder.encoded_string (l_trace))
+ res.put_string ("")
+ end
+ res.push
+ end
+ end
+ end
+
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
diff --git a/library/server/ewsgi/specification/connector/wgi_execution.e b/library/server/ewsgi/specification/connector/wgi_execution.e
index 204be494..deb0734c 100644
--- a/library/server/ewsgi/specification/connector/wgi_execution.e
+++ b/library/server/ewsgi/specification/connector/wgi_execution.e
@@ -30,7 +30,15 @@ feature -- Execution
-- Execute the request based on `request' and `response'.
deferred
ensure
- status_is_set: response.status_is_set
+ is_valid_end_of_execution: is_valid_end_of_execution
+ end
+
+feature -- Status report
+
+ is_valid_end_of_execution: BOOLEAN
+ -- Last `execute' completed in valid state?
+ do
+ Result := True
end
feature -- Cleaning
@@ -40,6 +48,11 @@ feature -- Cleaning
do
end
+invariant
+
+ wgi_request_set: request /= Void
+ wgi_response_set: response /= Void
+
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
diff --git a/library/server/wsf/connector/httpd/wsf_httpd_service_launcher.e b/library/server/wsf/connector/httpd/wsf_httpd_service_launcher.e
index 4644ae61..6738c80f 100644
--- a/library/server/wsf/connector/httpd/wsf_httpd_service_launcher.e
+++ b/library/server/wsf/connector/httpd/wsf_httpd_service_launcher.e
@@ -79,7 +79,7 @@ feature {NONE} -- Initialization
feature -- Execution
- update_configuration (cfg: separate HTTPD_CONFIGURATION)
+ update_configuration (cfg: like connector.configuration)
do
if single_threaded then
cfg.set_force_single_threaded (True)
diff --git a/library/server/wsf/router/support/uri/helpers/wsf_uri_routed_service.e b/library/server/wsf/router/support/uri/helpers/wsf_uri_routed_service.e
deleted file mode 100644
index 4575190a..00000000
--- a/library/server/wsf/router/support/uri/helpers/wsf_uri_routed_service.e
+++ /dev/null
@@ -1,27 +0,0 @@
-note
- description: "Summary description for {WSF_URI_ROUTED_SERVICE}."
- author: ""
- date: "$Date$"
- revision: "$Revision$"
-
-deferred class
- WSF_URI_ROUTED_SERVICE
-
-obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_HELPER_FOR_ROUTED_SERVICE [2013-mar-19]"
-
-inherit
- WSF_ROUTED_SERVICE
-
- WSF_URI_HELPER_FOR_ROUTED_SERVICE
-
-note
- copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
- license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
- source: "[
- Eiffel Software
- 5949 Hollister Ave., Goleta, CA 93117 USA
- Telephone 805-685-1006, Fax 805-685-6869
- Website http://www.eiffel.com
- Customer support http://support.eiffel.com
- ]"
-end
diff --git a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_routed_service.e b/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_routed_service.e
deleted file mode 100644
index 91052448..00000000
--- a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_routed_service.e
+++ /dev/null
@@ -1,27 +0,0 @@
-note
- description: "Summary description for {WSF_URI_TEMPLATE_ROUTED_SERVICE}."
- author: ""
- date: "$Date$"
- revision: "$Revision$"
-
-deferred class
- WSF_URI_TEMPLATE_ROUTED_SERVICE
-
-obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE [2013-mar-19]"
-
-inherit
- WSF_ROUTED_SERVICE
-
- WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE
-
-note
- copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
- license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
- source: "[
- Eiffel Software
- 5949 Hollister Ave., Goleta, CA 93117 USA
- Telephone 805-685-1006, Fax 805-685-6869
- Website http://www.eiffel.com
- Customer support http://support.eiffel.com
- ]"
-end
diff --git a/library/server/wsf/src/service/wsf_response_service.e b/library/server/wsf/src/service/wsf_response_service.e
index 383d9cdd..5b375e19 100644
--- a/library/server/wsf/src/service/wsf_response_service.e
+++ b/library/server/wsf/src/service/wsf_response_service.e
@@ -8,7 +8,7 @@ note
revision: "$Revision$"
deferred class
- WSF_RESPONSE_SERVICE
+ WSF_RESPONSE_SERVICE [G -> WSF_EXECUTION create make end]
inherit
WSF_SERVICE
@@ -29,7 +29,7 @@ feature -- Execution
end
note
- copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
+ copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Colin Adams, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
diff --git a/library/server/wsf/src/service/wsf_service_launcher.e b/library/server/wsf/src/service/wsf_service_launcher.e
index 5ac1ed97..2568a5e0 100644
--- a/library/server/wsf/src/service/wsf_service_launcher.e
+++ b/library/server/wsf/src/service/wsf_service_launcher.e
@@ -34,9 +34,6 @@ note
deferred class
WSF_SERVICE_LAUNCHER [G -> WSF_EXECUTION create make end]
-inherit
- WSF_TO_WGI_SERVICE
-
feature {NONE} -- Initialization
frozen make (a_options: like options)
diff --git a/library/server/wsf/src/wsf_execution.e b/library/server/wsf/src/wsf_execution.e
index 9af7db08..ea559543 100644
--- a/library/server/wsf/src/wsf_execution.e
+++ b/library/server/wsf/src/wsf_execution.e
@@ -15,7 +15,8 @@ inherit
redefine
make,
execute,
- clean
+ clean,
+ is_valid_end_of_execution
end
--create
@@ -47,8 +48,24 @@ feature {NONE} -- Access
response: WSF_RESPONSE
-- Access to output stream, back to the client.
+feature -- Execution
+
+ execute
+ -- Execute Current `request',
+ -- getting data from `request'
+ -- and response to client via `response'.
+ deferred
+ end
+
feature -- Status report
+ is_valid_end_of_execution: BOOLEAN
+ --