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"/>
<library name="ewsgi" location="..\..\ewsgi-safe.ecf"/>
<library name="libfcgi" location="..\..\..\libfcgi\libfcgi-safe.ecf"/>
<library name="http" location="..\..\..\..\protocol\http\http-safe.ecf"/>

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="libfcgi" location="..\..\..\libfcgi\libfcgi.ecf" />
<library name="http" location="..\..\..\..\protocol\http\http.ecf"/>

View File

@@ -10,22 +10,33 @@ class
inherit
WGI_CONNECTOR
redefine
initialize
end
create
make
feature {NONE} -- Initialization
initialize
make (a_app: like application)
do
application := a_app
create fcgi.make
create {WGI_LIBFCGI_INPUT_STREAM} input.make (fcgi)
create {WGI_LIBFCGI_OUTPUT_STREAM} output.make (fcgi)
end
feature -- Access
Name: STRING_8 = "libFCGI"
-- Name of Current connector
Version: STRING_8 = "0.1"
-- Version of Current connector
feature {NONE} -- Access
application: WGI_SERVICE
-- Gateway Service
feature -- Server
launch
@@ -47,18 +58,18 @@ feature -- Execution
process_fcgi_request (vars: HASH_TABLE [STRING, STRING]; a_input: like input; a_output: like output)
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 (vars, a_input)
create req.make (vars, a_input, Current)
create res.make (a_output)
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>")