diff --git a/library/network/protocol/http/src/http_cookie.e b/library/network/protocol/http/src/http_cookie.e index e46c07fa..17b3738a 100644 --- a/library/network/protocol/http/src/http_cookie.e +++ b/library/network/protocol/http/src/http_cookie.e @@ -1,23 +1,23 @@ note description: "[ - This class represents the value of a HTTP cookie, transferred in a request. - The class has features to build an HTTP cookie. - - Following a newer RFC standard for Cookies http://tools.ietf.org/html/rfc6265 - - Domain - * WARNING: Some existing user agents treat an absent Domain attribute as if the Domain attribute were present and contained the current host name. - * For example, if example.com returns a Set-Cookie header without a Domain attribute, these user agents will erroneously send the cookie to www.example.com as well. - - Max-Age, Expires - * If a cookie has both the Max-Age and the Expires attribute, the Max-Age attribute has precedence and controls the expiration date of the cookie. - * If a cookie has neither the Max-Age nor the Expires attribute, the user agent will retain the cookie until "the current session is over" (as defined by the user agent). - * You will need to call the feature - - HttpOnly, Secure - * Note that the HttpOnly attribute is independent of the Secure attribute: a cookie can have both the HttpOnly and the Secure attribute. + This class represents the value of a HTTP cookie, transferred in a request. + The class has features to build an HTTP cookie. + + Following a newer RFC standard for Cookies http://tools.ietf.org/html/rfc6265 + + Domain + * WARNING: Some existing user agents treat an absent Domain attribute as if the Domain attribute were present and contained the current host name. + * For example, if example.com returns a Set-Cookie header without a Domain attribute, these user agents will erroneously send the cookie to www.example.com as well. + + Max-Age, Expires + * If a cookie has both the Max-Age and the Expires attribute, the Max-Age attribute has precedence and controls the expiration date of the cookie. + * If a cookie has neither the Max-Age nor the Expires attribute, the user agent will retain the cookie until "the current session is over" (as defined by the user agent). + * You will need to call the feature + + HttpOnly, Secure + * Note that the HttpOnly attribute is independent of the Secure attribute: a cookie can have both the HttpOnly and the Secure attribute. -]" + ]" date: "$Date$" revision: "$Revision$" EIS: "name=HTTP Cookie specification", "src=http://tools.ietf.org/html/rfc6265", "protocol=uri" @@ -48,38 +48,38 @@ feature {NONE} -- Initialization feature -- Access name: STRING_8 - -- name of the cookie. + -- name of the cookie. value: STRING_8 - -- value of the cookie. + -- value of the cookie. expiration: detachable STRING_8 - -- Value of the Expires attribute. + -- Value of the Expires attribute. path: detachable STRING_8 - -- Value of the Path attribute. - -- Path to which the cookie applies. - --| The path "/", specify a cookie that apply to all URLs in your site. + -- Value of the Path attribute. + -- Path to which the cookie applies. + --| The path "/", specify a cookie that apply to all URLs in your site. domain: detachable STRING_8 - -- Value of the Domain attribute. - -- Domain to which the cookies apply. + -- Value of the Domain attribute. + -- Domain to which the cookies apply. secure: BOOLEAN - -- Value of the Secure attribute. - -- By default False. - --| Indicate if the cookie should only be sent over secured(encrypted connections, for example SSL). + -- Value of the Secure attribute. + -- By default False. + --| Indicate if the cookie should only be sent over secured(encrypted connections, for example SSL). http_only: BOOLEAN - -- Value of the http_only attribute. - -- By default false. - --| Limits the scope of the cookie to HTTP requests. + -- Value of the http_only attribute. + -- By default false. + --| Limits the scope of the cookie to HTTP requests. max_age: INTEGER - -- Value of the Max-Age attribute. - --| How much time in seconds should elapsed before the cookie expires. - --| By default max_age < 0 indicate a cookie will last only for the current user-agent (Browser, etc) session. - --| A value of 0 instructs the user-agent to delete the cookie. + -- Value of the Max-Age attribute. + --| How much time in seconds should elapsed before the cookie expires. + --| By default max_age < 0 indicate a cookie will last only for the current user-agent (Browser, etc) session. + --| A value of 0 instructs the user-agent to delete the cookie. has_valid_characters (a_name: READABLE_STRING_8):BOOLEAN -- Has `a_name' valid characters for cookies? @@ -102,12 +102,12 @@ feature -- Access end include_max_age: BOOLEAN - -- Does the Set-Cookie header include Max-Age attribute? - --|By default will include both. + -- Does the Set-Cookie header include Max-Age attribute? + --|By default will include both. include_expires: BOOLEAN - -- Does the Set-Cookie header include Expires attribute? - --|By default will include both. + -- Does the Set-Cookie header include Expires attribute? + --|By default will include both. is_valid_rfc1123_date (a_string: READABLE_STRING_8): BOOLEAN @@ -118,7 +118,7 @@ feature -- Access create d.make_from_string (a_string) Result := not d.has_error and then d.rfc1123_string.same_string (a_string) end - + feature -- Change Element set_name (a_name: READABLE_STRING_8) @@ -323,20 +323,20 @@ feature {NONE} -- Constants -- 0x2D-3A: -./0123456789: -- 0x3C-5B: <=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ -- 0x5D-7E: ]^_`abcdefghijklmnopqrstuvwxyz{|}~ - note - EIS: "name=valid-characters", "src=http://tools.ietf.org/html/rfc6265#section-4.1.1", "protocol=uri" - do - Result := True - inspect c - when 0x21 then - when 0x23 .. 0x2B then - when 0x2D .. 0x3A then - when 0x3C .. 0x5B then - when 0x5D .. 0x7E then - else - Result := False - end + note + EIS: "name=valid-characters", "src=http://tools.ietf.org/html/rfc6265#section-4.1.1", "protocol=uri" + do + Result := True + inspect c + when 0x21 then + when 0x23 .. 0x2B then + when 0x2D .. 0x3A then + when 0x3C .. 0x5B then + when 0x5D .. 0x7E then + else + Result := False end + end note copyright: "2011-2015, Jocelyn Fiat, Eiffel Software and others" diff --git a/library/network/protocol/http/src/http_date_time_utilities.e b/library/network/protocol/http/src/http_date_time_utilities.e index d24c6b09..d8f41fa2 100644 --- a/library/network/protocol/http/src/http_date_time_utilities.e +++ b/library/network/protocol/http/src/http_date_time_utilities.e @@ -1,5 +1,7 @@ note - description: "Summary description for {HTTP_DATE_TIME_UTILITIES}." + description: "[ + Utilities routines to manipulate date + ]" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/network/protocol/http/src/http_format_constants.e b/library/network/protocol/http/src/http_format_constants.e index b5d00397..67b6312c 100644 --- a/library/network/protocol/http/src/http_format_constants.e +++ b/library/network/protocol/http/src/http_format_constants.e @@ -1,5 +1,5 @@ note - description: "Summary description for {HTTP_FORMAT_CONSTANTS}." + description: "Various constants implied in http format." date: "$Date$" revision: "$Revision$" diff --git a/library/network/protocol/http/src/http_request_method_constants.e b/library/network/protocol/http/src/http_request_method_constants.e index 625a7a98..b378dc09 100644 --- a/library/network/protocol/http/src/http_request_method_constants.e +++ b/library/network/protocol/http/src/http_request_method_constants.e @@ -1,5 +1,7 @@ note - description: "Summary description for {HTTP_REQUEST_METHOD_CONSTANTS}." + description: "[ + Constants related to HTTP request method identification + ]" date: "$Date$" revision: "$Revision$" diff --git a/library/runtime/process/notification_email/notification_chain_mailer.e b/library/runtime/process/notification_email/notification_chain_mailer.e index 7c400683..844dc270 100644 --- a/library/runtime/process/notification_email/notification_chain_mailer.e +++ b/library/runtime/process/notification_email/notification_chain_mailer.e @@ -1,6 +1,7 @@ note - description: "Summary description for {NOTIFICATION_CHAIN_MAILER}." - author: "" + description: "[ + Node of a notification mailer chain + ]" date: "$Date$" revision: "$Revision$" diff --git a/library/security/openid/consumer/demo/application.e b/library/security/openid/consumer/demo/application.e index 819fa640..2f4de614 100644 --- a/library/security/openid/consumer/demo/application.e +++ b/library/security/openid/consumer/demo/application.e @@ -7,9 +7,8 @@ class APPLICATION inherit - - WSF_SERVICE - + ANY + SHARED_EXECUTION_ENVIRONMENT export {NONE} all diff --git a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e index c40b7a28..372a20a0 100644 --- a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e +++ b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_connector.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_CGI_CONNECTOR}." + description: "CGI connector, see CGI interface, and CGI scripts." date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_error_stream.e b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_error_stream.e index 1fab40b2..88e84a4d 100644 --- a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_error_stream.e +++ b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_error_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_CGI_ERROR_STREAM." + description: "Error stream for CGI connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_input_stream.e b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_input_stream.e index faa595d5..c23892e7 100644 --- a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_input_stream.e +++ b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_CGI_INPUT_STREAM." + description: "Input stream for CGI connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_output_stream.e b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_output_stream.e index 323927d3..0a5dea0c 100644 --- a/library/server/ewsgi/connectors/cgi/src/wgi_cgi_output_stream.e +++ b/library/server/ewsgi/connectors/cgi/src/wgi_cgi_output_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_CGI_OUTPUT_STREAM." + description: "Output stream for CGI connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e index 2bd68609..ed8209e0 100644 --- a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e +++ b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_connector.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_LIBFCGI_CONNECTOR}." + description: "libFCGI connector, see libfcgi and http://fastcgi.com" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_input_stream.e b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_input_stream.e index ec757d63..590f6c73 100644 --- a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_input_stream.e +++ b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_LIBFCGI_INPUT_STREAM." + description: "Input stream for libFCGI connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_output_stream.e b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_output_stream.e index d3b67676..cbe0f762 100644 --- a/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_output_stream.e +++ b/library/server/ewsgi/connectors/libfcgi/src/wgi_libfcgi_output_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_LIBFCGI_OUTPUT_STREAM}." + description: "Output stream for libFCGI connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" 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 524659ac..b96f4bf3 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_connector.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_NINO_CONNECTOR}." + description: "Standalone Eiffel Web nino server connector." date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_error_stream.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_error_stream.e index facbfb66..f65beaf3 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_error_stream.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_error_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_CGI_ERROR_STREAM." + description: "Error stream for Nino connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_input_stream.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_input_stream.e index 6cddecdd..de13091a 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_input_stream.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_NINO_INPUT_STREAM}." + description: "Input stream for Nino connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/nino/src/wgi_nino_output_stream.e b/library/server/ewsgi/connectors/nino/src/wgi_nino_output_stream.e index 9e95b69e..3b595927 100644 --- a/library/server/ewsgi/connectors/nino/src/wgi_nino_output_stream.e +++ b/library/server/ewsgi/connectors/nino/src/wgi_nino_output_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_NINO_OUTPUT_STREAM}." + description: "Output stream for Nino connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/null/src/wgi_null_connector.e b/library/server/ewsgi/connectors/null/src/wgi_null_connector.e index 789c84e4..f08fbf4e 100644 --- a/library/server/ewsgi/connectors/null/src/wgi_null_connector.e +++ b/library/server/ewsgi/connectors/null/src/wgi_null_connector.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_NULL_CONNECTOR}." + description: "NULL connector, mainly used for void-safety purpose or testing" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/null/src/wgi_null_file_input_stream.e b/library/server/ewsgi/connectors/null/src/wgi_null_file_input_stream.e index 6e0282f0..9a28baee 100644 --- a/library/server/ewsgi/connectors/null/src/wgi_null_file_input_stream.e +++ b/library/server/ewsgi/connectors/null/src/wgi_null_file_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_NULL_FILE_INPUT_STREAM." + description: "Null Input stream based on FILE." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/null/src/wgi_null_input_stream.e b/library/server/ewsgi/connectors/null/src/wgi_null_input_stream.e index 93461b24..ee84dee5 100644 --- a/library/server/ewsgi/connectors/null/src/wgi_null_input_stream.e +++ b/library/server/ewsgi/connectors/null/src/wgi_null_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_NULL_INPUT_STREAM." + description: "Input stream for NULL connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/null/src/wgi_null_output_stream.e b/library/server/ewsgi/connectors/null/src/wgi_null_output_stream.e index 16fdbf73..21d95864 100644 --- a/library/server/ewsgi/connectors/null/src/wgi_null_output_stream.e +++ b/library/server/ewsgi/connectors/null/src/wgi_null_output_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_NULL_OUTPUT_STREAM." + description: "Output stream for NULL connector." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/null/src/wgi_null_string_input_stream.e b/library/server/ewsgi/connectors/null/src/wgi_null_string_input_stream.e index 09df2d2e..3c98c09b 100644 --- a/library/server/ewsgi/connectors/null/src/wgi_null_string_input_stream.e +++ b/library/server/ewsgi/connectors/null/src/wgi_null_string_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for WGI_NULL_STRING_INPUT_STREAM." + description: "Input stream for NULL connector based on string body (in memory)." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_connection_handler.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_connection_handler.e index 54ca8b74..9b32f4a2 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_connection_handler.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_connection_handler.e @@ -1,6 +1,7 @@ note - description: "Summary description for {HTTPD_CONNECTION_HANDLER}." - author: "" + description: "[ + Implementation of HTTPD_CONNECTION_HANDLER_I for concurrency mode: none + ]" date: "$Date$" revision: "$Revision$" @@ -29,7 +30,7 @@ feature -- Access Result := a_server.controller.shutdown_requested end -feature -- Execution +feature {HTTPD_SERVER_I} -- Execution accept_incoming_connection (a_listening_socket: HTTPD_STREAM_SOCKET) local diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_request_handler_factory.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_request_handler_factory.e index 8bff0870..1c93e9e3 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_request_handler_factory.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/none/httpd_request_handler_factory.e @@ -1,6 +1,5 @@ note - description: "Summary description for {HTTPD_REQUEST_HANDLER_FACTORY}." - author: "" + description: "Implementation of request handler factory for concurrency mode: none" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_connection_handler.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_connection_handler.e index e90c89d4..25b458ab 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_connection_handler.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_connection_handler.e @@ -1,5 +1,7 @@ note - description: "Summary description for {HTTPD_CONNECTION_HANDLER}." + description: "[ + Implementation of HTTPD_CONNECTION_HANDLER_I for concurrency mode: SCOOP + ]" date: "$Date$" revision: "$Revision$" @@ -36,8 +38,10 @@ feature {NONE} -- Initialization feature -- Access is_shutdown_requested: BOOLEAN + -- max_concurrent_connections (a_server: like server): INTEGER + -- Max concurrent connection settings from server `a_server'. do Result := a_server.configuration.max_concurrent_connections end @@ -87,11 +91,6 @@ feature {HTTPD_SERVER_I} -- Execution end end - separate_client_socket (hdl: separate HTTPD_REQUEST_HANDLER): separate HTTPD_STREAM_SOCKET - do - Result := hdl.client_socket - end - process_handler (hdl: separate HTTPD_REQUEST_HANDLER) require hdl.is_connected @@ -99,22 +98,28 @@ feature {HTTPD_SERVER_I} -- Execution hdl.safe_execute end + separate_client_socket (hdl: separate HTTPD_REQUEST_HANDLER): separate HTTPD_STREAM_SOCKET + do + Result := hdl.client_socket + end + feature {HTTPD_SERVER_I} -- Status report wait_for_completion - -- Wait until Current is ready for shutdown + -- Wait until Current is ready for shutdown. do wait_for_pool_completion (pool) end wait_for_pool_completion (p: like pool) + -- Wait until concurrent pool is empty and terminated. require - p.is_empty + p.is_empty -- SCOOP wait condition. do p.terminate end -feature {NONE} -- Access +feature {NONE} -- Implementation pool: separate CONCURRENT_POOL [HTTPD_REQUEST_HANDLER] -- Pool of separate connection handlers. diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_request_handler_factory.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_request_handler_factory.e index 56fa78d6..e48a96a2 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_request_handler_factory.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/httpd_request_handler_factory.e @@ -1,6 +1,5 @@ note - description: "Summary description for {HTTPD_REQUEST_HANDLER_FACTORY}." - author: "" + description: "Implementation of request handler factory for concurrency mode: SCOOP" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool.e index a26156da..90a75855 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool.e @@ -1,6 +1,5 @@ note - description: "Summary description for {CONCURRENT_POOL}." - author: "" + description: "Concurrent pool for SCOOP concurrency mode." date: "$Date$" revision: "$Revision$" @@ -19,7 +18,6 @@ feature {NONE} -- Initialization do capacity := n create items.make_empty (n) --- create busy_items.make_filled (False, n) create busy_items.make_empty (n) end diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_factory.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_factory.e index 51205fb3..92e0f2cb 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_factory.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_factory.e @@ -1,6 +1,5 @@ note - description: "Summary description for {CONCURRENT_POOL_FACTORY}." - author: "" + description: "Factory in charge of creating new concurrent pool item." date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_item.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_item.e index c197fd88..f0af2268 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_item.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/scoop/pool/concurrent_pool_item.e @@ -1,6 +1,8 @@ note - description: "Summary description for {CONCURRENT_POOL_ITEM}." - author: "" + description: "[ + Item create by the CONCURRENT_POOL_FACTORY, and managed by the CONCURRENT_POOL + for SCOOP concurrency mode. + ]" date: "$Date$" revision: "$Revision$" @@ -10,10 +12,12 @@ deferred class feature {NONE} -- Access pool: detachable separate CONCURRENT_POOL [CONCURRENT_POOL_ITEM] + -- Associated concurrent pool component. feature {CONCURRENT_POOL} -- Change set_pool (p: like pool) + -- Set associated `pool' to `p'. do pool := p end diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/thread/httpd_connection_handler.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/thread/httpd_connection_handler.e index d6bebdc1..45b85bd4 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/thread/httpd_connection_handler.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/thread/httpd_connection_handler.e @@ -1,6 +1,7 @@ note - description: "Summary description for {HTTPD_CONNECTION_HANDLER}." - author: "" + description: "[ + Implementation of HTTPD_CONNECTION_HANDLER_I for concurrency mode: Thread + ]" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/thread/httpd_request_handler_factory.e b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/thread/httpd_request_handler_factory.e index 8bff0870..cf692e55 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/thread/httpd_request_handler_factory.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/concurrency/thread/httpd_request_handler_factory.e @@ -1,6 +1,5 @@ note - description: "Summary description for {HTTPD_REQUEST_HANDLER_FACTORY}." - author: "" + description: "Implementation of request handler factory for concurrency mode: Thread" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/configuration/httpd_configuration_i.e b/library/server/ewsgi/connectors/standalone/src/httpd/configuration/httpd_configuration_i.e index 7acf397b..79b82c83 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/configuration/httpd_configuration_i.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/configuration/httpd_configuration_i.e @@ -1,5 +1,5 @@ note - description: "Summary description for {HTTPD_CONFIGURATION_I}." + description: "Configuration for the standalone HTTPd server." date: "$Date$" revision: "$Revision$" @@ -24,6 +24,7 @@ feature {NONE} -- Initialization feature -- Access Server_details: STRING_8 + -- Detail of the server. deferred end diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_connection_handler_i.e b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_connection_handler_i.e index 99d4acc0..017e2a69 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_connection_handler_i.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_connection_handler_i.e @@ -1,6 +1,12 @@ note - description: "Summary description for {HTTPD_CONNECTION_HANDLER_I}." - author: "" + description: "[ + Interface for the incoming connection handler. + + Each incoming socket connection is processed by + an implementation of HTTPD_CONNECTION_HANDLER_I. + + Note there are 3 implementations, one for each concurrent mode: none, thread, scoop. + ]" date: "$Date$" revision: "$Revision$" @@ -23,41 +29,40 @@ feature {NONE} -- Initialization deferred end - separate_factory (a_server: like server): like factory - -- Separate factory from `a_server'. - --| required by SCOOP design. - do - Result := a_server.factory - end - feature {NONE} -- Access factory: separate HTTPD_REQUEST_HANDLER_FACTORY + -- Request handler factory. server: separate HTTPD_SERVER_I + -- Associated server. feature {HTTPD_SERVER_I} -- Execution accept_incoming_connection (a_listening_socket: HTTPD_STREAM_SOCKET) + -- Accept incoming connection from `a_listening_socket'. deferred end shutdown + -- Shutdown server. deferred end wait_for_completion - -- Wait until Current completed any pending task + -- Wait until Current completed any pending task. + --| Used for SCOOP synchronisation. deferred end feature {HTTPD_SERVER} -- Status report is_shutdown_requested: BOOLEAN + -- Any request to shutdown the server? deferred end -feature {NONE} -- Output +feature {NONE} -- Implementation log (a_message: separate READABLE_STRING_8) -- Log `a_message' @@ -66,6 +71,13 @@ feature {NONE} -- Output separate_server_log (server, a_message) end + separate_factory (a_server: like server): like factory + -- Separate factory from `a_server'. + --| required by SCOOP design. + do + Result := a_server.factory + end + separate_server_log (a_server: like server; a_message: separate READABLE_STRING_8) do a_server.log (a_message) diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_controller.e b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_controller.e index 8693a71d..f9a66673 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_controller.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_controller.e @@ -1,6 +1,8 @@ note - description: "Summary description for {HTTPD_CONTROLLER}." - author: "" + description: "[ + Object used to control (i.e shutdown) the server. + Mostly needed in SCOOP concurrency mode. + ]" date: "$Date$" revision: "$Revision$" @@ -10,11 +12,15 @@ class feature -- Operation shutdown + -- Request the associated server to be shutdown. do shutdown_requested := True end +feature -- Status report. + shutdown_requested: BOOLEAN + -- Shutdown requested. ;note copyright: "2011-2013, Javier Velilla, Jocelyn Fiat and others" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_debug_facilities.e b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_debug_facilities.e index 77704e5b..31823329 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_debug_facilities.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_debug_facilities.e @@ -1,6 +1,5 @@ note - description: "Summary description for {HTTPD_DEBUG_FACILITIES}." - author: "" + description: " Routines used for debug logging." date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_logger.e b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_logger.e index c9668af9..057f43a3 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_logger.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_logger.e @@ -1,6 +1,5 @@ note - description: "Summary description for {HTTPD_LOGGER}." - author: "" + description: "Logging facilities component" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_server_observer.e b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_server_observer.e index 3c64c812..18a59981 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/httpd_server_observer.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/httpd_server_observer.e @@ -1,6 +1,5 @@ note description: "Summary description for {HTTPD_SERVER_OBSERVER}." - author: "" date: "$Date$" revision: "$Revision$" @@ -10,14 +9,18 @@ deferred class feature -- Event on_launched (a_port: INTEGER) + -- Associated server launched listening on port `a_port'. deferred end on_stopped + -- Associated server stopped. + --| the server may restart itself after being rescued. deferred end on_terminated + -- Associated server terminated. deferred end diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/no_ssl/httpd_configuration.e b/library/server/ewsgi/connectors/standalone/src/httpd/no_ssl/httpd_configuration.e index b62114ff..7af8bb74 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/no_ssl/httpd_configuration.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/no_ssl/httpd_configuration.e @@ -1,5 +1,5 @@ note - description: "Summary description for {HTTPD_CONFIGURATION}." + description: "Standalone server configuration (ssl NOT supported)." date: "$Date$" revision: "$Revision$" @@ -14,7 +14,7 @@ create feature -- Status - Server_details: STRING_8 = "Server : NINO Eiffel Server" + Server_details: STRING_8 = "Server: Standalone Eiffel Server" has_ssl_support: BOOLEAN = False -- Precursor diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/ssl/httpd_configuration.e b/library/server/ewsgi/connectors/standalone/src/httpd/ssl/httpd_configuration.e index 275fd5e4..d702bac5 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/ssl/httpd_configuration.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/ssl/httpd_configuration.e @@ -1,5 +1,5 @@ note - description: "Summary description for {HTTPD_CONFIGURATION}." + description: "Standalone server configuration (ssl supported)." date: "$Date$" revision: "$Revision$" @@ -25,7 +25,7 @@ feature {NONE} -- Initialization feature -- Access - Server_details: STRING_8 = "Server : NINO Eiffel Server (https)" + Server_details: STRING_8 = "Server: Standalone Eiffel Server (https)" has_ssl_support: BOOLEAN = True -- Precursor diff --git a/library/server/ewsgi/connectors/standalone/src/httpd/ssl/ssl_tcp_stream_socket.e b/library/server/ewsgi/connectors/standalone/src/httpd/ssl/ssl_tcp_stream_socket.e index c4f5e668..0ad0f7c7 100644 --- a/library/server/ewsgi/connectors/standalone/src/httpd/ssl/ssl_tcp_stream_socket.e +++ b/library/server/ewsgi/connectors/standalone/src/httpd/ssl/ssl_tcp_stream_socket.e @@ -1,6 +1,5 @@ note - description: "Summary description for {SSL_TCP_STREAM_SOCKET}." - author: "" + description: "SSL tcp stream socket." date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_connector.e b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_connector.e index 541b58a8..9c35e715 100644 --- a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_connector.e +++ b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_connector.e @@ -1,12 +1,7 @@ note - description: "Summary description for {WGI_STANDALONE_CONNECTOR}." - author: "" - todo: "[ - Check if server and configuration has to be 'separate' ? - currently yes, due to WGI_REQUEST.wgi_connector setting. - But we may get rid of this one... - See `{WGI_REQUEST}.wgi_connector' and `{WSF_REQUEST}.wgi_connector' ... - ]" + description: "[ + Standalone Web Server connector + ]" date: "$Date$" revision: "$Revision$" @@ -23,6 +18,7 @@ create feature {NONE} -- Initialization make + -- Create current standalone connector. local fac: separate WGI_HTTPD_REQUEST_HANDLER_FACTORY [G] do @@ -40,6 +36,7 @@ feature {NONE} -- Initialization end make_with_base (a_base: like base) + -- Create current standalone connector with base url `a_base' require a_base_starts_with_slash: (a_base /= Void and then not a_base.is_empty) implies a_base.starts_with ("/") do @@ -47,13 +44,13 @@ feature {NONE} -- Initialization set_base (a_base) end +feature {NONE} -- Separate helper + initialize_server (a_server: like server) do a_server.set_observer (observer) end -feature {NONE} -- Separate helper - set_factory_connector (conn: detachable separate WGI_STANDALONE_CONNECTOR [G]; fac: separate WGI_HTTPD_REQUEST_HANDLER_FACTORY [G]) do fac.set_connector (conn) @@ -75,12 +72,16 @@ feature -- Access feature -- Access server: separate HTTPD_SERVER + -- HTTPd server object. controller: separate HTTPD_CONTROLLER + -- Controller used to shutdown server. observer: separate WGI_STANDALONE_SERVER_OBSERVER + -- Observer providing information related to port number, and server status. configuration: separate HTTPD_CONFIGURATION + -- Server configuration. feature -- Access @@ -116,16 +117,18 @@ feature -- Event feature -- Element change - set_base (b: like base) + set_base (v: like base) + -- Set base url `base' to `v'. require - b_starts_with_slash: (b /= Void and then not b.is_empty) implies b.starts_with ("/") + b_starts_with_slash: (v /= Void and then not v.is_empty) implies v.starts_with ("/") do - base := b + base := v ensure valid_base: (attached base as l_base and then not l_base.is_empty) implies l_base.starts_with ("/") end set_port_number (a_port_number: INTEGER) + -- Set port number to `a_port_number'. require a_port_number_positive_or_zero: a_port_number >= 0 do @@ -133,6 +136,7 @@ feature -- Element change end set_max_concurrent_connections (nb: INTEGER) + -- Set maximum concurrent connections to `nb'. require nb_positive_or_zero: nb >= 0 do @@ -140,31 +144,16 @@ feature -- Element change end set_is_verbose (b: BOOLEAN) + -- Set verbose mode. do set_is_verbose_on_configuration (b, configuration) end -feature {NONE} -- Implementation - - set_port_on_configuration (a_port_number: INTEGER; cfg: like configuration) - do - cfg.set_http_server_port (a_port_number) - end - - set_max_concurrent_connections_on_configuration (nb: INTEGER; cfg: like configuration) - do - cfg.set_max_concurrent_connections (nb) - end - - set_is_verbose_on_configuration (b: BOOLEAN; cfg: like configuration) - do - is_verbose := b - cfg.set_is_verbose (b) - end feature -- Server launch + -- Launch web server listening. do launched := False port := 0 @@ -173,6 +162,7 @@ feature -- Server end shutdown_server + -- Shutdown web server listening. do if launched then -- FIXME jfiat [2015/03/27] : prevent multiple calls (otherwise it hangs) @@ -180,20 +170,26 @@ feature -- Server end end - server_controller (a_server: like server): separate HTTPD_CONTROLLER - do - Result := a_server.controller - end +feature -- Events on_server_started (obs: like observer) + -- Server started and listeing on port `obs.port'. require - obs.started + obs.started -- SCOOP wait condition. do if obs.port > 0 then on_launched (obs.port) end end + +feature {NONE} -- Implementation + + server_controller (a_server: like server): separate HTTPD_CONTROLLER + do + Result := a_server.controller + end + configure_server (a_configuration: like configuration) do if a_configuration.is_verbose then @@ -209,8 +205,6 @@ feature -- Server a_server.launch end -feature {NONE} -- Implementation - separate_server_terminated (a_server: like server): BOOLEAN do Result := a_server.is_terminated @@ -221,6 +215,24 @@ feature {NONE} -- Implementation a_controller.shutdown end +feature {NONE} -- Implementation: element change + + set_port_on_configuration (a_port_number: INTEGER; cfg: like configuration) + do + cfg.set_http_server_port (a_port_number) + end + + set_max_concurrent_connections_on_configuration (nb: INTEGER; cfg: like configuration) + do + cfg.set_max_concurrent_connections (nb) + end + + set_is_verbose_on_configuration (b: BOOLEAN; cfg: like configuration) + do + is_verbose := b + cfg.set_is_verbose (b) + end + note copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" diff --git a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_error_stream.e b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_error_stream.e index 8c48d2ab..f0267335 100644 --- a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_error_stream.e +++ b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_error_stream.e @@ -1,5 +1,7 @@ note - description: "Summary description for WGI_STANDALONE_ERROR_STREAM." + description: "[ + Error stream for the Standalone Web Server connector. + ]" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_input_stream.e b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_input_stream.e index fbfa2b0b..b3ac4d84 100644 --- a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_input_stream.e +++ b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_input_stream.e @@ -1,5 +1,7 @@ note - description: "Summary description for {WGI_STANDALONE_INPUT_STREAM}." + description: "[ + Input stream for the Standalone Web Server connector. + ]" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_output_stream.e b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_output_stream.e index b5ca291e..7f95ec22 100644 --- a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_output_stream.e +++ b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_output_stream.e @@ -1,5 +1,7 @@ note - description: "Summary description for {WGI_STANDALONE_OUTPUT_STREAM}." + description: "[ + Output stream for the Standalone Web Server connector + ]" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_response_stream.e b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_response_stream.e index 9c9ab699..4510addb 100644 --- a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_response_stream.e +++ b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_response_stream.e @@ -1,7 +1,7 @@ note description: "[ WGI Response implemented using stream buffer - + for the standalone Eiffel web server connector. ]" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_server_observer.e b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_server_observer.e index b36d0fb7..702b8ae8 100644 --- a/library/server/ewsgi/connectors/standalone/src/wgi_standalone_server_observer.e +++ b/library/server/ewsgi/connectors/standalone/src/wgi_standalone_server_observer.e @@ -1,6 +1,9 @@ note - description: "Summary description for {WGI_STANDALONE_SERVER_OBSERVER}." - author: "" + description: "[ + Server status observer for the Standalone Web Server connector. + This is used to get information related to the port number + and the status of the server. + ]" date: "$Date$" revision: "$Revision$" @@ -39,7 +42,6 @@ feature -- Event terminated := True 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/connectors/standalone/standalone-safe.ecf b/library/server/ewsgi/connectors/standalone/standalone-safe.ecf index acf1c95f..1d21728c 100644 --- a/library/server/ewsgi/connectors/standalone/standalone-safe.ecf +++ b/library/server/ewsgi/connectors/standalone/standalone-safe.ecf @@ -21,20 +21,4 @@ - - - - - - - - - - - - - diff --git a/library/server/ewsgi/connectors/standalone/test_standalone-safe.ecf b/library/server/ewsgi/connectors/standalone/test_standalone-safe.ecf new file mode 100644 index 00000000..cdc30795 --- /dev/null +++ b/library/server/ewsgi/connectors/standalone/test_standalone-safe.ecf @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/library/server/ewsgi/connectors/standalone/dev/app_counter.e b/library/server/ewsgi/connectors/standalone/tests/test_counter.e similarity index 88% rename from library/server/ewsgi/connectors/standalone/dev/app_counter.e rename to library/server/ewsgi/connectors/standalone/tests/test_counter.e index 1e4a6489..8999b4df 100644 --- a/library/server/ewsgi/connectors/standalone/dev/app_counter.e +++ b/library/server/ewsgi/connectors/standalone/tests/test_counter.e @@ -1,11 +1,10 @@ note - description: "Summary description for {APP_COUNTER}." - author: "" + description: "Simple counter component." date: "$Date$" revision: "$Revision$" class - APP_COUNTER + TEST_COUNTER create put diff --git a/library/server/ewsgi/connectors/standalone/dev/app_wsf_execution.e b/library/server/ewsgi/connectors/standalone/tests/test_execution.e similarity index 85% rename from library/server/ewsgi/connectors/standalone/dev/app_wsf_execution.e rename to library/server/ewsgi/connectors/standalone/tests/test_execution.e index 2a87ee9c..c02a3c65 100644 --- a/library/server/ewsgi/connectors/standalone/dev/app_wsf_execution.e +++ b/library/server/ewsgi/connectors/standalone/tests/test_execution.e @@ -1,11 +1,11 @@ note - description: "Summary description for {APP_WSF_EXECUTION}." + description: "Summary description for {TEST_EXECUTION}." author: "" date: "$Date$" revision: "$Revision$" class - APP_WSF_EXECUTION + TEST_EXECUTION inherit WSF_EXECUTION @@ -22,6 +22,7 @@ feature -- Execution s: STRING i64: INTEGER_64 do + i64 := {INTEGER_64} 1_000_000_000 s := "Hello Concurrent EWF" s.append (" (counter=") s.append_integer (next_cell_counter_item (counter_cell)) @@ -30,7 +31,7 @@ feature -- Execution if attached {WSF_STRING} request.query_parameter ("sleep") as p_sleep then if attached p_sleep.value.is_integer then s.append ("sleep for ") - i64 := p_sleep.value.to_integer_64 * {INTEGER_64} 1_000_000_000 + i64 := p_sleep.value.to_integer_64 * ({INTEGER_64} 1_000_000_000) s.append_integer_64 (i64) execution_environment.sleep (i64) end @@ -49,7 +50,7 @@ feature -- Execution Result := cl.next_item end - counter_cell: separate APP_COUNTER + counter_cell: separate TEST_COUNTER once ("PROCESS") create Result.put (0) end diff --git a/library/server/ewsgi/connectors/standalone/dev/httpd_connector_dev.e b/library/server/ewsgi/connectors/standalone/tests/test_standalone_connector.e similarity index 87% rename from library/server/ewsgi/connectors/standalone/dev/httpd_connector_dev.e rename to library/server/ewsgi/connectors/standalone/tests/test_standalone_connector.e index d299ec48..ddb3bce8 100644 --- a/library/server/ewsgi/connectors/standalone/dev/httpd_connector_dev.e +++ b/library/server/ewsgi/connectors/standalone/tests/test_standalone_connector.e @@ -1,13 +1,13 @@ note description: "[ - Objects that ... + Testing+developping the standalone connector, no need to review. ]" author: "$Author$" date: "$Date$" revision: "$Revision$" class - HTTPD_CONNECTOR_DEV + TEST_STANDALONE_CONNECTOR create make @@ -17,7 +17,7 @@ feature {NONE} -- Initialization make -- Initialize `Current'. local - conn: WGI_STANDALONE_CONNECTOR [APP_WSF_EXECUTION] + conn: WGI_STANDALONE_CONNECTOR [TEST_EXECUTION] do print ("Starting httpd server ...%N") 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 b48667eb..260aa393 100644 --- a/library/server/ewsgi/examples/hello_world/src/hello_world.e +++ b/library/server/ewsgi/examples/hello_world/src/hello_world.e @@ -7,9 +7,6 @@ note class HELLO_WORLD -inherit - WGI_SERVICE - create make diff --git a/library/server/ewsgi/specification/connector/wgi_connector.e b/library/server/ewsgi/specification/connector/wgi_connector.e index 07614609..d0c45d41 100644 --- a/library/server/ewsgi/specification/connector/wgi_connector.e +++ b/library/server/ewsgi/specification/connector/wgi_connector.e @@ -1,6 +1,6 @@ note - description: "Summary description for {WGI_CONNECTOR}." - specification: "Eiffel WGI/connector specification https://github.com/Eiffel-World/Eiffel-Web-Framework/wiki/WGI-specification" + description: "Common interface for all EWSGI connectors." + specification: "Eiffel WGI/connector specification https://github.com/EiffelWebFramework/EWF/wiki/WGI-specification" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/specification/connector/wgi_execution.e b/library/server/ewsgi/specification/connector/wgi_execution.e index deb0734c..ad18a6ac 100644 --- a/library/server/ewsgi/specification/connector/wgi_execution.e +++ b/library/server/ewsgi/specification/connector/wgi_execution.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WGI_EXECUTION}." - author: "" + description: "Common interface for any request execution." date: "$Date$" revision: "$Revision$" @@ -13,6 +12,7 @@ deferred class feature {NONE} -- Initialization make (req: WGI_REQUEST; res: WGI_RESPONSE) + -- Create current execution with request `req' and response `res'. do request := req response := res @@ -21,8 +21,10 @@ feature {NONE} -- Initialization feature {NONE} -- Access request: WGI_REQUEST + -- Request data. response: WGI_RESPONSE + -- Response interface. feature -- Execution diff --git a/library/server/ewsgi/specification/connector/wgi_execution_factory.e b/library/server/ewsgi/specification/connector/wgi_execution_factory.e deleted file mode 100644 index d0df1af0..00000000 --- a/library/server/ewsgi/specification/connector/wgi_execution_factory.e +++ /dev/null @@ -1,26 +0,0 @@ -note - description: "Summary description for {WGI_EXECUTION_FACTORY}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - WGI_EXECUTION_FACTORY - -feature -- Factory - - execution (req: WGI_REQUEST; res: WGI_RESPONSE): WGI_EXECUTION - deferred - 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)" - 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/ewsgi/specification/connector/wgi_exporter.e b/library/server/ewsgi/specification/connector/wgi_exporter.e index 7fd4e349..386b23f5 100644 --- a/library/server/ewsgi/specification/connector/wgi_exporter.e +++ b/library/server/ewsgi/specification/connector/wgi_exporter.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WGI_EXPORTER}." - author: "" +description: "Interface giving access to restricting features of EWSGI components." date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/specification/request/wgi_meta_names.e b/library/server/ewsgi/specification/request/wgi_meta_names.e index 5c2ed931..6e4f2db9 100644 --- a/library/server/ewsgi/specification/request/wgi_meta_names.e +++ b/library/server/ewsgi/specification/request/wgi_meta_names.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_META_NAMES}." + description: "Common CGI and meta variable names." legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" diff --git a/library/server/ewsgi/specification/response/wgi_filter_response.e b/library/server/ewsgi/specification/response/wgi_filter_response.e index 02485387..81d1b28a 100644 --- a/library/server/ewsgi/specification/response/wgi_filter_response.e +++ b/library/server/ewsgi/specification/response/wgi_filter_response.e @@ -1,5 +1,7 @@ note - description: "Summary description for {WGI_FILTER_RESPONSE}." + description: "[ + WGI response acting as a filter. + ]" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/specification/response/wgi_logger_response.e b/library/server/ewsgi/specification/response/wgi_logger_response.e index 39f6195a..f715d90a 100644 --- a/library/server/ewsgi/specification/response/wgi_logger_response.e +++ b/library/server/ewsgi/specification/response/wgi_logger_response.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_LOGGER_RESPONSE}." + description: "Filter response used to log response sending." date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/specification/response/wgi_response.e b/library/server/ewsgi/specification/response/wgi_response.e index d0192a5a..53838af0 100644 --- a/library/server/ewsgi/specification/response/wgi_response.e +++ b/library/server/ewsgi/specification/response/wgi_response.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_RESPONSE}." + description: "Interface to send response back to the client" date: "$Date$" revision: "$Revision$" diff --git a/library/server/ewsgi/specification/stream/wgi_chunked_input_stream.e b/library/server/ewsgi/specification/stream/wgi_chunked_input_stream.e index 4722591d..12d3fc00 100644 --- a/library/server/ewsgi/specification/stream/wgi_chunked_input_stream.e +++ b/library/server/ewsgi/specification/stream/wgi_chunked_input_stream.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WGI_CHUNKED_INPUT_STREAM}." + description: "Input stream for chunked encoding request." date: "$Date$" revision: "$Revision$" EIS: "name=Chunked Transfer Coding", "protocol=URI", "src=http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1" diff --git a/library/server/ewsgi/src/wgi_agent_service.e b/library/server/ewsgi/src/wgi_agent_service.e deleted file mode 100644 index 579e5bcf..00000000 --- a/library/server/ewsgi/src/wgi_agent_service.e +++ /dev/null @@ -1,48 +0,0 @@ -note - description: "Summary description for {WGI_AGENT_SERVICE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -class - WGI_AGENT_SERVICE - -inherit - WGI_SERVICE - -create - make - -feature {NONE} -- Implementation - - make (a_callback: like callback) - -- Initialize `Current'. - do - callback := a_callback - end - -feature {NONE} -- Implementation - - callback: PROCEDURE [ANY, TUPLE [req: WGI_REQUEST; res: WGI_RESPONSE]] - -- Procedure called on `execute' - - execute (req: WGI_REQUEST; res: WGI_RESPONSE) - -- Execute the request - do - callback.call ([req, res]) - end - -invariant - callback_attached: callback /= Void - -note - copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, 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/default/cgi/wsf_default_service.e b/library/server/wsf/default/cgi/wsf_default_service.e index a19fb656..bf0f21d5 100644 --- a/library/server/wsf/default/cgi/wsf_default_service.e +++ b/library/server/wsf/default/cgi/wsf_default_service.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WSF_DEFAULT_SERVICE}." + description: "Service using default connector launcher: CGI" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/default/cgi/wsf_default_service_launcher.e b/library/server/wsf/default/cgi/wsf_default_service_launcher.e index a6ba4e6c..524a820a 100644 --- a/library/server/wsf/default/cgi/wsf_default_service_launcher.e +++ b/library/server/wsf/default/cgi/wsf_default_service_launcher.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WSF_DEFAULT_SERVICE_LAUNCHER}." - author: "" + description: "Launcher for default connector: CGI" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/default/libfcgi/wsf_default_service.e b/library/server/wsf/default/libfcgi/wsf_default_service.e index a19fb656..bf8d350b 100644 --- a/library/server/wsf/default/libfcgi/wsf_default_service.e +++ b/library/server/wsf/default/libfcgi/wsf_default_service.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WSF_DEFAULT_SERVICE}." + description: "Service using default connector launcher: libFCGI" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/default/libfcgi/wsf_default_service_launcher.e b/library/server/wsf/default/libfcgi/wsf_default_service_launcher.e index 99f302ce..ca37b590 100644 --- a/library/server/wsf/default/libfcgi/wsf_default_service_launcher.e +++ b/library/server/wsf/default/libfcgi/wsf_default_service_launcher.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WSF_DEFAULT_SERVICE_LAUNCHER}." - author: "" + description: "Launcher for default connector: libFCGI" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/default/nino/wsf_default_service.e b/library/server/wsf/default/nino/wsf_default_service.e index c29c7047..87173559 100644 --- a/library/server/wsf/default/nino/wsf_default_service.e +++ b/library/server/wsf/default/nino/wsf_default_service.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WSF_DEFAULT_SERVICE}." + description: "Service using default connector launcher: Nino" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/default/openshift/wsf_default_service.e b/library/server/wsf/default/openshift/wsf_default_service.e index a19fb656..8ffe9150 100644 --- a/library/server/wsf/default/openshift/wsf_default_service.e +++ b/library/server/wsf/default/openshift/wsf_default_service.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WSF_DEFAULT_SERVICE}." + description: "Service using default connector launcher: openshift" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/default/standalone/wsf_default_service.e b/library/server/wsf/default/standalone/wsf_default_service.e index a19fb656..df754d51 100644 --- a/library/server/wsf/default/standalone/wsf_default_service.e +++ b/library/server/wsf/default/standalone/wsf_default_service.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WSF_DEFAULT_SERVICE}." + description: "Service using default connector launcher: Standalone" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/extension/filter/wsf_debug_filter.e b/library/server/wsf/extension/filter/wsf_debug_filter.e index a9354ddb..abe403eb 100644 --- a/library/server/wsf/extension/filter/wsf_debug_filter.e +++ b/library/server/wsf/extension/filter/wsf_debug_filter.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WSF_DEBUG_FILTER}." + description: "Filter implementing debug output in error stream, or `output' file." date: "$Date: 2013-05-23 21:54:29 +0200 (jeu., 23 mai 2013) $" revision: "$Revision: 92585 $" diff --git a/library/server/wsf/extension/handler/wsf_debug_handler.e b/library/server/wsf/extension/handler/wsf_debug_handler.e index d4b7d954..7ae7a266 100644 --- a/library/server/wsf/extension/handler/wsf_debug_handler.e +++ b/library/server/wsf/extension/handler/wsf_debug_handler.e @@ -1,6 +1,6 @@ note - description: "Summary description for {WSF_DEBUG_HANDLER}." - author: "" + description: "Handler returning debug information." + date: "$Date: 2013-06-28 16:14:02 +0200 (ven., 28 juin 2013) $" revision: "$Revision: 92754 $" diff --git a/library/server/wsf/extension/wsf_request_utility.e b/library/server/wsf/extension/wsf_request_utility.e index 88566954..be6c7a08 100644 --- a/library/server/wsf/extension/wsf_request_utility.e +++ b/library/server/wsf/extension/wsf_request_utility.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WSF_REQUEST_UTILITY}." - author: "" + description: "Collection of utilities routines for WSF_REQUEST." date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/extension/wsf_request_utility_proxy.e b/library/server/wsf/extension/wsf_request_utility_proxy.e index eb8a3afd..850fd7e0 100644 --- a/library/server/wsf/extension/wsf_request_utility_proxy.e +++ b/library/server/wsf/extension/wsf_request_utility_proxy.e @@ -1,6 +1,8 @@ note - description: "Summary description for {WSF_REQUES_UTILITY_PROXY}." - author: "" + description: "[ + Proxy interface on WSF_REQUEST_UTILITY interface. + Used to factorize code. + ]" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/extension/wsf_value_utility.e b/library/server/wsf/extension/wsf_value_utility.e index 19623e20..229db9be 100644 --- a/library/server/wsf/extension/wsf_value_utility.e +++ b/library/server/wsf/extension/wsf_value_utility.e @@ -1,5 +1,7 @@ note - description: "Summary description for {WSF_VALUE_UTILITY}." + description: "[ + Collection of utilities routines to factorize code related to WSF_VALUE manipulation. + ]" author: "" date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/policy_driven/wsf_skeleton_handler.e b/library/server/wsf/policy_driven/wsf_skeleton_handler.e index ee6f5b2e..07993264 100644 --- a/library/server/wsf/policy_driven/wsf_skeleton_handler.e +++ b/library/server/wsf/policy_driven/wsf_skeleton_handler.e @@ -146,7 +146,7 @@ feature -- Access Result := True -- redefine to return `False', so as to induce a Vary: * header end - + allowed_cross_origins (req: WSF_REQUEST): detachable STRING -- Value for Access-Control-Allow-Origin header; -- If supplied, should be a single URI, or the values "*" or "null". @@ -177,7 +177,7 @@ feature -- Access req_attached: req /= Void deferred end - + last_modified (req: WSF_REQUEST): detachable DATE_TIME -- When representation of resource selected in `req' was last modified; -- SHOULD be set whenever it can reasonably be determined. @@ -503,7 +503,7 @@ feature -- Execution a_helper_attached: a_helper /= Void do a_helper.handle_content_negotiation (req, res, Current) - if not res.status_is_set or else res.status_code /= {HTTP_STATUS_CODE}.Not_acceptable then + if res.status_code /= {HTTP_STATUS_CODE}.Not_acceptable then check_resource_exists (req, a_helper) if a_helper.resource_exists then a_helper.execute_existing_resource (req, res, Current) @@ -538,7 +538,7 @@ feature -- Execution end feature {NONE} -- Implementation - + handle_invalid_content_range (res: WSF_RESPONSE) -- Write "Bad Request" response to `res' for Content-Range header present in PUT request. require @@ -560,7 +560,7 @@ feature {NONE} -- Implementation status_is_service_unavailable: res.status_code = {HTTP_STATUS_CODE}.internal_server_error body_sent: res.message_committed and then res.transfered_content_length > 0 end - + handle_internal_server_error (res: WSF_RESPONSE) -- Write "Internal Server Error" response to `res'. require @@ -584,7 +584,7 @@ feature {NONE} -- Implementation end note - copyright: "2011-2013, Colin Adams, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others" + copyright: "2011-2014, Colin Adams, 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 diff --git a/library/server/wsf/router/filter/wsf_filtered_service.e b/library/server/wsf/router/filter/wsf_filtered_service.e deleted file mode 100644 index f7cb826d..00000000 --- a/library/server/wsf/router/filter/wsf_filtered_service.e +++ /dev/null @@ -1,55 +0,0 @@ -note - description: "Summary description for {WSF_FILTERED_SERVICE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - WSF_FILTERED_SERVICE - -feature {NONE} -- Initialization - - initialize_filter - -- Initialize `filter' - do - create_filter - setup_filter - end - - create_filter - -- Create `filter' - deferred - ensure - filter_created: filter /= Void - end - - setup_filter - -- Setup `filter' - require - filter_created: filter /= Void - deferred - end - -feature -- Access - - filter: WSF_FILTER - -- Filter - -feature -- Execution - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - do - filter.execute (req, res) - end - -;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/policy/service/wsf_routed_skeleton_execution.e b/library/server/wsf/router/policy/execution/wsf_routed_skeleton_execution.e similarity index 99% rename from library/server/wsf/router/policy/service/wsf_routed_skeleton_execution.e rename to library/server/wsf/router/policy/execution/wsf_routed_skeleton_execution.e index 8a0a4792..859adaff 100644 --- a/library/server/wsf/router/policy/service/wsf_routed_skeleton_execution.e +++ b/library/server/wsf/router/policy/execution/wsf_routed_skeleton_execution.e @@ -1,5 +1,5 @@ note - description: "Summary description for {WSF_ROUTED_SKELETON_EXECUTION}." + description: "Skeleton execution based on router." date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/router/policy/service/wsf_routed_skeleton_service.e b/library/server/wsf/router/policy/service/wsf_routed_skeleton_service.e deleted file mode 100644 index df05e4ea..00000000 --- a/library/server/wsf/router/policy/service/wsf_routed_skeleton_service.e +++ /dev/null @@ -1,287 +0,0 @@ -note - description: "Summary description for {WSF_ROUTED_SKELETON_SERVICE}." - date: "$Date$" - revision: "$Revision$" - -deferred class - WSF_ROUTED_SKELETON_SERVICE - -inherit - WSF_ROUTED_SERVICE - redefine - execute - end - - WSF_SYSTEM_OPTIONS_ACCESS_POLICY - - WSF_PROXY_USE_POLICY - -feature -- Execution - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - -- If the service is available, and request URI is not too long, dispatch the request - -- and if handler is not found, execute the default procedure `execute_default'. - local - l_sess: WSF_ROUTER_SESSION - do - --| When we reach here, the request has already passed check for 400 (Bad request), - --| which is implemented in WSF_REQUEST.make_from_wgi (when it calls `analyze'). - if unavailable then - handle_unavailable (res) - elseif requires_proxy (req) then - handle_use_proxy (req, res) - elseif - maximum_uri_length > 0 and then - req.request_uri.count.to_natural_32 > maximum_uri_length - then - handle_request_uri_too_long (res) - elseif - req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) and then - req.request_uri.same_string ("*") - then - handle_server_options (req, res) - else - create l_sess - router.dispatch (req, res, l_sess) - if not l_sess.dispatched then - execute_default (req, res) - end - end - end - -feature -- Measurement - - maximum_uri_length: NATURAL - -- Maximum length in characters (or zero for no limit) permitted - -- for {WSF_REQUEST}.request_uri - -feature -- Status report - - unavailable: BOOLEAN - -- Is service currently unavailable? - - unavailablity_message: detachable READABLE_STRING_8 - -- Message to be included as text of response body for {HTTP_STATUS_CODE}.service_unavailable - - unavailability_duration: NATURAL - -- Delta seconds for service unavailability (0 if not known) - - unavailable_until: detachable DATE_TIME - -- Time at which service becomes available again (if known) - -feature -- Status setting - - set_available - -- Set `unavailable' to `False'. - do - unavailable := False - unavailablity_message := Void - unavailable_until := Void - ensure - available: unavailable = False - unavailablity_message_detached: unavailablity_message = Void - unavailable_until_detached: unavailable_until = Void - end - - set_unavailable (a_message: READABLE_STRING_8; a_duration: NATURAL; a_until: detachable DATE_TIME) - -- Set `unavailable' to `True'. - require - a_message_attached: a_message /= Void - a_duration_xor_a_until: a_duration > 0 implies a_until = Void - do - unavailable := True - unavailablity_message := a_message - unavailability_duration := a_duration - ensure - unavailable: unavailable = True - unavailablity_message_aliased: unavailablity_message = a_message - unavailability_duration_set: unavailability_duration = a_duration - unavailable_until_aliased: unavailable_until = a_until - end - - set_maximum_uri_length (a_len: NATURAL) - -- Set `maximum_uri_length' to `a_len'. - -- Can pass zero to mean no restrictions. - do - maximum_uri_length := a_len - ensure - maximum_uri_length_set: maximum_uri_length = a_len - end - -feature {NONE} -- Implementation - - handle_unavailable (res: WSF_RESPONSE) - -- Write "Service unavailable" response to `res'. - require - unavailable: unavailable - res_attached: res /= Void - local - h: HTTP_HEADER - do - create h.make - h.put_content_type_text_plain - check attached unavailablity_message as m then - -- invariant `unavailability_message_attached' plus precondition `unavailable' - h.put_content_length (m.count) - h.put_current_date - res.set_status_code ({HTTP_STATUS_CODE}.service_unavailable) - if unavailability_duration > 0 then - h.put_header_key_value ({HTTP_HEADER_NAMES}.header_retry_after, unavailability_duration.out) - elseif attached unavailable_until as u then - h.put_header_key_value ({HTTP_HEADER_NAMES}.header_retry_after, - h.date_to_rfc1123_http_date_format (u)) - end - res.put_header_text (h.string) - res.put_string (m) - end - ensure - response_status_is_set: res.status_is_set - status_is_service_unavailable: res.status_code = {HTTP_STATUS_CODE}.service_unavailable - body_sent: res.message_committed and then res.transfered_content_length > 0 - body_content_was_unavailablity_message: True -- doesn't seem to be any way to check - end - - handle_request_uri_too_long (res: WSF_RESPONSE) - -- Write "Request URI too long" response into `res'. - require - res_attached: res /= Void - local - h: HTTP_HEADER - m: READABLE_STRING_8 - do - create h.make - h.put_content_type_text_plain - h.put_current_date - m := "Maximum permitted length for request URI is " + maximum_uri_length.out + " characters" - h.put_content_length (m.count) - res.set_status_code ({HTTP_STATUS_CODE}.request_uri_too_long) - res.put_header_text (h.string) - res.put_string (m) - ensure - response_status_is_set: res.status_is_set - status_is_request_uri_too_long: res.status_code = {HTTP_STATUS_CODE}.request_uri_too_long - body_sent: res.message_committed and then res.transfered_content_length > 0 - end - - frozen handle_server_options (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Write response to OPTIONS * into `res'. - require - req_attached: req /= Void - res_attached: res /= Void - method_is_options: req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) - server_options_requested: req.request_uri.same_string ("*") - do - --| First check if forbidden. - --| (N.B. authentication requires an absoluteURI (RFC3617 page 3), and so cannot be used for OPTIONS *. - --| Otherwise construct an Allow response automatically from the router. - if is_system_options_forbidden (req) then - handle_system_options_forbidden (req, res) - else - handle_system_options (req, res) - end - ensure - response_status_is_set: res.status_is_set - valid_response_code: res.status_code = {HTTP_STATUS_CODE}.forbidden or - res.status_code = {HTTP_STATUS_CODE}.not_found or res.status_code = {HTTP_STATUS_CODE}.ok - header_sent: res.header_committed and res.message_committed - end - - frozen handle_system_options_forbidden (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Write a 403 Forbidden or a 404 Not found response into `res'. - require - req_attached: req /= Void - res_attached: res /= Void - method_is_options: req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) - server_options_requested: req.request_uri.same_string ("*") - local - m: detachable READABLE_STRING_8 - h: HTTP_HEADER - do - m := system_options_forbidden_text (req) - if attached {READABLE_STRING_8} m as l_msg then - create h.make - h.put_content_type_text_plain - h.put_current_date - h.put_content_length (l_msg.count) - res.set_status_code ({HTTP_STATUS_CODE}.forbidden) - res.put_header_text (h.string) - res.put_string (l_msg) - else - create h.make - h.put_content_type_text_plain - h.put_current_date - h.put_content_length (0) - res.set_status_code ({HTTP_STATUS_CODE}.not_found) - res.put_header_text (h.string) - end - ensure - response_status_is_set: res.status_is_set - valid_response_code: res.status_code = {HTTP_STATUS_CODE}.forbidden or - res.status_code = {HTTP_STATUS_CODE}.not_found - header_sent: res.header_committed - message_sent: res.message_committed - end - - handle_system_options (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Write response to OPTIONS * into `res'. - -- This may be redefined by the user, but normally this will not be necessary. - require - req_attached: req /= Void - res_attached: res /= Void - method_is_options: req.is_request_method ({HTTP_REQUEST_METHODS}.method_options) - server_options_requested: req.request_uri.same_string ("*") - local - h: HTTP_HEADER - do - create h.make - h.put_content_type_text_plain - h.put_current_date - h.put_allow (router.all_allowed_methods) - h.put_content_length (0) - res.set_status_code ({HTTP_STATUS_CODE}.ok) - res.put_header_text (h.string) - ensure - response_status_is_set: res.status_is_set - response_code_ok: res.status_code = {HTTP_STATUS_CODE}.ok - header_sent: res.header_committed and res.message_committed - empty_body: res.transfered_content_length = 0 - end - - frozen handle_use_proxy (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Write Use Proxy response `res'. - require - res_attached: res /= Void - req_attached: req /= Void - proxy_required: requires_proxy (req) - local - h: HTTP_HEADER - do - create h.make - h.put_content_type_text_plain - h.put_current_date - h.put_location (proxy_server (req).string) - h.put_content_length (0) - res.put_header_lines (h) - res.set_status_code ({HTTP_STATUS_CODE}.use_proxy) - ensure - response_status_is_set: res.status_is_set - response_code_use_proxy: res.status_code = {HTTP_STATUS_CODE}.use_proxy - end - -invariant - - unavailability_message_attached: unavailable implies attached unavailablity_message as m and then - m.count > 0 - unavailability_duration_xor_unavailable_until: unavailability_duration > 0 implies unavailable_until = Void - -;note - copyright: "2011-2013, 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 - 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/helpers/wsf_uri_helper_for_routed_service.e b/library/server/wsf/router/support/uri/helpers/wsf_uri_helper_for_routed_service.e deleted file mode 100644 index 287fcbfd..00000000 --- a/library/server/wsf/router/support/uri/helpers/wsf_uri_helper_for_routed_service.e +++ /dev/null @@ -1,60 +0,0 @@ -note - description: "Facilities inheritance to add URI base routing to a routed service" - - date: "$Date$" - revision: "$Revision$" - -deferred class WSF_URI_HELPER_FOR_ROUTED_SERVICE - -feature -- Access - - router: WSF_ROUTER - -- Router used to dispatch the request according to the WSF_REQUEST object - -- and associated request methods; - -- This should not be implemented by descendants. Instead, you gain an effective - -- version by also inheriting from WSF_ROUTED_SERVICE, or one of it's descendants. - deferred - ensure - router_not_void: Result /= Void - end - -feature -- Mapping helper: uri - - map_uri (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER) - -- Map `h' as handler for `a_uri' - do - map_uri_with_request_methods (a_uri, h, Void) - end - - map_uri_with_request_methods (a_uri: READABLE_STRING_8; h: WSF_URI_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS) - -- Map `h' as handler for `a_uri' for request methods `rqst_methods'. - do - router.map_with_request_methods (create {WSF_URI_MAPPING}.make (a_uri, h), rqst_methods) - end - -feature -- Mapping helper: uri agent - - map_uri_agent (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]) - -- Map `proc' as handler for `a_uri' - do - map_uri_agent_with_request_methods (a_uri, proc, Void) - end - - map_uri_agent_with_request_methods (a_uri: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS) - -- Map `proc' as handler for `a_uri' for request methods `rqst_methods'. - do - map_uri_with_request_methods (a_uri, create {WSF_URI_AGENT_HANDLER}.make (proc), rqst_methods) - end - -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_helper_for_routed_service.e b/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_helper_for_routed_service.e deleted file mode 100644 index d61a6a4e..00000000 --- a/library/server/wsf/router/support/uri_template/helpers/wsf_uri_template_helper_for_routed_service.e +++ /dev/null @@ -1,73 +0,0 @@ -note - - description: "Facilities inheritance to add URI template-base routing to a routed service" - - date: "$Date$" - revision: "$Revision$" - -deferred class WSF_URI_TEMPLATE_HELPER_FOR_ROUTED_SERVICE - -feature -- Access - - router: WSF_ROUTER - -- Router used to dispatch the request according to the WSF_REQUEST object - -- and associated request methods; - -- This should not be implemented by descendants. Instead, you gain an effective - -- version by also inheriting from WSF_ROUTED_SERVICE, or one of it's descendants. - deferred - ensure - router_not_void: Result /= Void - end - -feature -- Mapping helper: uri template - - map_uri_template (a_tpl: STRING; h: WSF_URI_TEMPLATE_HANDLER) - -- Map `h' as handler for `a_tpl' - require - a_tpl_attached: a_tpl /= Void - h_attached: h /= Void - do - map_uri_template_with_request_methods (a_tpl, h, Void) - end - - map_uri_template_with_request_methods (a_tpl: READABLE_STRING_8; h: WSF_URI_TEMPLATE_HANDLER; rqst_methods: detachable WSF_REQUEST_METHODS) - -- Map `h' as handler for `a_tpl' for request methods `rqst_methods'. - require - a_tpl_attached: a_tpl /= Void - h_attached: h /= Void - do - router.map_with_request_methods (create {WSF_URI_TEMPLATE_MAPPING}.make (a_tpl, h), rqst_methods) - end - -feature -- Mapping helper: uri template agent - - map_uri_template_agent (a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]) - -- Map `proc' as handler for `a_tpl' - require - a_tpl_attached: a_tpl /= Void - proc_attached: proc /= Void - do - map_uri_template_agent_with_request_methods (a_tpl, proc, Void) - end - - map_uri_template_agent_with_request_methods (a_tpl: READABLE_STRING_8; proc: PROCEDURE [ANY, TUPLE [req: WSF_REQUEST; res: WSF_RESPONSE]]; rqst_methods: detachable WSF_REQUEST_METHODS) - -- Map `proc' as handler for `a_tpl' for request methods `rqst_methods'. - require - a_tpl_attached: a_tpl /= Void - proc_attached: proc /= Void - do - map_uri_template_with_request_methods (a_tpl, create {WSF_URI_TEMPLATE_AGENT_HANDLER}.make (proc), rqst_methods) - end - -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/wsf_routed_execution.e b/library/server/wsf/router/wsf_routed_execution.e index 7b2d693a..a5bb8f12 100644 --- a/library/server/wsf/router/wsf_routed_execution.e +++ b/library/server/wsf/router/wsf_routed_execution.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WSF_ROUTED_EXECUTION}." - author: "" + description: "Execution based on router." date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/router/wsf_routed_service.e b/library/server/wsf/router/wsf_routed_service.e deleted file mode 100644 index d205f770..00000000 --- a/library/server/wsf/router/wsf_routed_service.e +++ /dev/null @@ -1,84 +0,0 @@ -note - description: "Summary description for {WSF_ROUTED_SERVICE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - WSF_ROUTED_SERVICE - -feature -- Initialization - - initialize_router - -- Initialize router - do - create_router - setup_router - end - - create_router - -- Create `router' - --| could be redefine to initialize with proper capacity - do - create router.make (10) - ensure - router_created: router /= Void - end - - setup_router - -- Setup `router' - require - router_created: router /= Void - deferred - end - -feature -- Execution - - execute (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Dispatch the request - -- and if handler is not found, execute the default procedure `execute_default'. - require - req_attached: req /= Void - res_attached: res /= Void - local - sess: WSF_ROUTER_SESSION - do - create sess - router.dispatch (req, res, sess) - if not sess.dispatched then - execute_default (req, res) - end - ensure - response_status_is_set: res.status_is_set - end - - execute_default (req: WSF_REQUEST; res: WSF_RESPONSE) - -- Dispatch requests without a matching handler. - require - req_attached: req /= Void - res_attached: res /= Void - local - msg: WSF_DEFAULT_ROUTER_RESPONSE - do - create msg.make_with_router (req, router) - msg.set_documentation_included (True) - res.send (msg) - end - -feature -- Access - - router: WSF_ROUTER - -- Router used to dispatch the request according to the WSF_REQUEST object - -- and associated request methods - -;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/wsf_router_methods.e b/library/server/wsf/router/wsf_router_methods.e deleted file mode 100644 index d89dd1ca..00000000 --- a/library/server/wsf/router/wsf_router_methods.e +++ /dev/null @@ -1,72 +0,0 @@ -note - description: "[ - Object that is use in relation with WSF_ROUTER, to precise which request methods is accepted. - For convenience, `make_from_iterable' is available, so that you can use <<"GET", "POST">> for instance - but remember manifest string are evil ... - Since in HTTP you can use your own custom request method, this is not possible to catch any typo - ( for instance if you write "POST" instead of "P0ST" this is hard to find the error, - but in one case it uses upper "o" and in the other case this is zero "0" - ) - - The recommanded way to use is for instance - create {WSF_ROUTER_METHODS}.make_get_post - create methods; methods.enable_get; methods.enable_post - - This sounds heavy, but this is much safer. - - ( note: in addition internally this first checks using reference comparison - and then compare string value, so it brings optimization for accepted request methods. - ) - ]" - date: "$Date$" - revision: "$Revision$" - -class - WSF_ROUTER_METHODS - -obsolete - "Use WSF_REQUEST_METHODS" - -inherit - WSF_REQUEST_METHODS - redefine - plus - end - -create - default_create, - make, - make_from_iterable, - make_from_string - -convert - to_array: {ARRAY [READABLE_STRING_8]}, - make_from_iterable ({ITERABLE [READABLE_STRING_8], ITERABLE [STRING_8], ARRAY [READABLE_STRING_8], ARRAY [STRING_8]}), - make_from_string ({READABLE_STRING_8, STRING_8}) - -feature -- Basic operations - - add (a_other: like plus): like plus - obsolete "Use `plus' or `alias +'" - do - Result := plus (a_other) - end - - plus alias "+" (a_other: WSF_ROUTER_METHODS): WSF_ROUTER_METHODS - -- Merge Current and a_other into Result - do - create Result.make_from_iterable (Current) - Result.add_methods (a_other) - end - -;note - copyright: "2011-2012, 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_context/support/starts_with/helpers/wsf_starts_with_context_routed_service.e b/library/server/wsf/router_context/support/starts_with/helpers/wsf_starts_with_context_routed_service.e deleted file mode 100644 index c7b8245e..00000000 --- a/library/server/wsf/router_context/support/starts_with/helpers/wsf_starts_with_context_routed_service.e +++ /dev/null @@ -1,27 +0,0 @@ -note - description: "Summary description for {WSF_STARTS_WITH_CONTEXT_ROUTED_SERVICE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - WSF_STARTS_WITH_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end] - -obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_STARTS_WITH_CONTEXT_ROUTER_HELPER [2013-mar-19]" - -inherit - WSF_ROUTED_SERVICE - - WSF_STARTS_WITH_CONTEXT_ROUTER_HELPER [C] - -note - copyright: "2011-2012, 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_context/support/starts_with/helpers/wsf_starts_with_context_router_helper.e b/library/server/wsf/router_context/support/starts_with/helpers/wsf_starts_with_context_router_helper.e index 330ceb49..77f53f32 100644 --- a/library/server/wsf/router_context/support/starts_with/helpers/wsf_starts_with_context_router_helper.e +++ b/library/server/wsf/router_context/support/starts_with/helpers/wsf_starts_with_context_router_helper.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WSF_STARTS_WITH_CONTEXT_ROUTED_SERVICE}." - author: "" + description: "Helper for routed execution with context." date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/router_context/support/uri/helpers/wsf_uri_context_routed_service.e b/library/server/wsf/router_context/support/uri/helpers/wsf_uri_context_routed_service.e deleted file mode 100644 index 46be558a..00000000 --- a/library/server/wsf/router_context/support/uri/helpers/wsf_uri_context_routed_service.e +++ /dev/null @@ -1,28 +0,0 @@ -note - description: "Summary description for {WSF_URI_CONTEXT_ROUTED_SERVICE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - WSF_URI_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end] - -obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_CONTEXT_ROUTER_HELPER [2013-mar-19]" - -inherit - WSF_ROUTED_SERVICE - - WSF_URI_CONTEXT_ROUTER_HELPER [C] - - -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_context/support/uri/helpers/wsf_uri_context_router_helper.e b/library/server/wsf/router_context/support/uri/helpers/wsf_uri_context_router_helper.e index b52d8096..8d5baa5b 100644 --- a/library/server/wsf/router_context/support/uri/helpers/wsf_uri_context_router_helper.e +++ b/library/server/wsf/router_context/support/uri/helpers/wsf_uri_context_router_helper.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WSF_URI_CONTEXT_ROUTER_HELPER}." - author: "" + description: "Helper for exection based on router, and uri mapping context." date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/router_context/support/uri_template/helpers/wsf_uri_template_context_routed_service.e b/library/server/wsf/router_context/support/uri_template/helpers/wsf_uri_template_context_routed_service.e deleted file mode 100644 index e6ef848b..00000000 --- a/library/server/wsf/router_context/support/uri_template/helpers/wsf_uri_template_context_routed_service.e +++ /dev/null @@ -1,27 +0,0 @@ -note - description: "Summary description for {WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - WSF_URI_TEMPLATE_CONTEXT_ROUTED_SERVICE [C -> WSF_HANDLER_CONTEXT create make end] - -obsolete "Inherit from WSF_ROUTED_SERVICE and WSF_URI_TEMPLATE_CONTEXT_ROUTER_HELPER [2013-mar-19]" - -inherit - WSF_ROUTED_SERVICE - - WSF_URI_TEMPLATE_CONTEXT_ROUTER_HELPER [C] - -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_context/support/uri_template/helpers/wsf_uri_template_context_router_helper.e b/library/server/wsf/router_context/support/uri_template/helpers/wsf_uri_template_context_router_helper.e index a744719e..e3969420 100644 --- a/library/server/wsf/router_context/support/uri_template/helpers/wsf_uri_template_context_router_helper.e +++ b/library/server/wsf/router_context/support/uri_template/helpers/wsf_uri_template_context_router_helper.e @@ -1,6 +1,5 @@ note - description: "Summary description for {WSF_URI_TEMPLATE_CONTEXT_ROUTER_HELPER}." - author: "" + description: "Helper for execution based on router and uri template mapping context." date: "$Date$" revision: "$Revision$" diff --git a/library/server/wsf/src/support/wsf_cookie.e b/library/server/wsf/src/support/wsf_cookie.e index 9a011a86..2b9f57c2 100644 --- a/library/server/wsf/src/support/wsf_cookie.e +++ b/library/server/wsf/src/support/wsf_cookie.e @@ -7,7 +7,6 @@ class WSF_COOKIE inherit - HTTP_COOKIE create diff --git a/library/server/wsf/src/wsf_execution.e b/library/server/wsf/src/wsf_execution.e index ea559543..79c69336 100644 --- a/library/server/wsf/src/wsf_execution.e +++ b/library/server/wsf/src/wsf_execution.e @@ -25,6 +25,7 @@ inherit feature {NONE} -- Initialization make (req: WGI_REQUEST; res: WGI_RESPONSE) + -- Create Current execution with request `req' and response `res'. do Precursor (req, res) create request.make_from_wgi (wgi_request) @@ -39,7 +40,7 @@ feature {NONE} -- Initialization end -feature {NONE} -- Access +feature -- Access request: WSF_REQUEST -- Access to request data. diff --git a/library/server/wsf/src/wsf_execution_factory.e b/library/server/wsf/src/wsf_execution_factory.e deleted file mode 100644 index 04be7117..00000000 --- a/library/server/wsf/src/wsf_execution_factory.e +++ /dev/null @@ -1,32 +0,0 @@ -note - description: "Summary description for {WSF_EXECUTION_FACTORY}." - author: "" - date: "$Date$" - revision: "$Revision$" - -deferred class - WSF_EXECUTION_FACTORY - -inherit - WGI_EXECUTION_FACTORY - redefine - execution - end - -feature -- Factory - - execution (req: WGI_REQUEST; res: WGI_RESPONSE): WSF_EXECUTION - deferred - end - -note - 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 - 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