Simplified EWSGI interfaces

Renamed WGI_RESPONSE_BUFFER as WGI_RESPONSE to avoid confusion
Removed EWF_HEADER and removed related caller from WGI implementation,
   now this is only part of WSF library
Added wgi_version, wgi_implementation and wgi_connector to the WGI_REQUEST interface
   to give more information to the user
Added back WGI_CONNECTOR to WGI specification, mainly because of `{WGI_REQUEST}.wgi_connector'
   simplified WGI_CONNECTOR to contain for now only `name' and `version'
   if the implementation of connector inherit from WGI_CONNECTOR (recommended)
   this might gives more access to the user using a reverse assignment for specific needs
   (but this usage is not recommended due to portability issue on other connector)
Removed useless connector.ecf since now EWF/WGI library provides the helper classes
This commit is contained in:
Jocelyn Fiat
2011-11-25 14:39:48 +01:00
parent 3032b91ff7
commit fd0912904c
24 changed files with 553 additions and 627 deletions

View File

@@ -10,7 +10,6 @@
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="connector" location="..\connector-safe.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>
<cluster name="src" location=".\src\" recursive="true"/>

View File

@@ -10,7 +10,6 @@
<option warning="true" full_class_checking="true">
</option>
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="connector" location="..\connector.ecf" readonly="false"/>
<library name="ewsgi" location="..\..\ewsgi.ecf" readonly="false"/>
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/>
<cluster name="src" location=".\src\" recursive="true"/>

View File

@@ -1,6 +1,5 @@
note
description: "Summary description for {WGI_CGI_CONNECTOR}."
author: ""
date: "$Date$"
revision: "$Revision$"
@@ -13,23 +12,43 @@ inherit
create
make
feature {NONE} -- Initialization
make (a_app: like application)
do
application := a_app
end
feature -- Access
Name: STRING_8 = "CGI"
-- Name of Current connector
Version: STRING_8 = "0.1"
-- Version of Current connector
feature {NONE} -- Access
application: WGI_SERVICE
-- Gateway Service
feature -- Execution
launch
local
req: WGI_REQUEST_FROM_TABLE
res: detachable WGI_RESPONSE_STREAM_BUFFER
res: detachable WGI_RESPONSE_STREAM
rescued: BOOLEAN
do
if not rescued then
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {WGI_CGI_INPUT_STREAM}.make)
create req.make ((create {EXECUTION_ENVIRONMENT}).starting_environment_variables, create {WGI_CGI_INPUT_STREAM}.make, Current)
create res.make (create {WGI_CGI_OUTPUT_STREAM}.make)
application.execute (req, res)
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.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
res.set_status_code ({HTTP_STATUS_CODE}.internal_server_error)
end
if res.message_writable then
res.write_string ("<pre>" + l_trace + "</pre>")
@@ -41,7 +60,7 @@ feature -- Execution
rescued := True
retry
end
note
copyright: "2011-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"