diff --git a/library/ewsgi/src/gw_application.e b/library/ewsgi/src/gw_application.e index 3f49b571..334d3456 100644 --- a/library/ewsgi/src/gw_application.e +++ b/library/ewsgi/src/gw_application.e @@ -10,11 +10,22 @@ deferred class feature -- Execution + process (env: GW_ENVIRONMENT; a_input: GW_INPUT_STREAM; a_output: GW_OUTPUT_STREAM) + do + execute (new_request_context (env, a_input, a_output)) + end + execute (ctx: GW_REQUEST_CONTEXT) -- Execute the request deferred end +feature -- Factory + + new_request_context (env: GW_ENVIRONMENT; a_input: GW_INPUT_STREAM; a_output: GW_OUTPUT_STREAM): GW_REQUEST_CONTEXT + deferred + end + note copyright: "2011-2011, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/ewsgi/src/gw_input_stream.e b/library/ewsgi/src/gw_input_stream.e index ef5ddb30..58a52361 100644 --- a/library/ewsgi/src/gw_input_stream.e +++ b/library/ewsgi/src/gw_input_stream.e @@ -14,6 +14,8 @@ feature -- Access last_string: STRING_8 -- Last read string from stream + deferred + end feature -- Basic operation diff --git a/library/ewsgi/src/gw_output_stream.e b/library/ewsgi/src/gw_output_stream.e index 5c906761..cb87ee46 100644 --- a/library/ewsgi/src/gw_output_stream.e +++ b/library/ewsgi/src/gw_output_stream.e @@ -13,11 +13,17 @@ deferred class feature -- Basic operation put_string (s: STRING_8) + -- Write `s' into the output stream require s_not_empty: s /= Void and then not s.is_empty deferred end + flush + -- Flush the output stream + deferred + end + note copyright: "2011-2011, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" diff --git a/library/ewsgi/src/gw_variables.e b/library/ewsgi/src/gw_variables.e index 69f32e07..9aac05a8 100644 --- a/library/ewsgi/src/gw_variables.e +++ b/library/ewsgi/src/gw_variables.e @@ -6,7 +6,7 @@ note status: "See notice at end of class." date: "$Date$" revision: "$Revision$" - + deferred class GW_VARIABLES [G -> STRING_GENERAL] @@ -29,14 +29,18 @@ feature -- Access deferred end - variable_or_default (a_name: STRING; a_default: G): G + variable_or_default (a_name: STRING; a_default: G; use_default_when_empty: BOOLEAN): G -- Value for variable `a_name' -- If not found, return `a_default' require a_name_not_empty: a_name /= Void and then not a_name.is_empty do if attached variable (a_name) as s then - Result := s + if use_default_when_empty and then s.is_empty then + Result := a_default + else + Result := s + end else Result := a_default end