Updated a few comments.

This commit is contained in:
2015-05-06 22:37:55 +02:00
parent d015c065f6
commit fffa763d05
6 changed files with 22 additions and 26 deletions

View File

@@ -31,8 +31,7 @@ feature {NONE} -- Initialization
end end
initialize_pool (p: like pool; n: INTEGER) initialize_pool (p: like pool; n: INTEGER)
-- Initialize pool of separate connection handlers. -- Initialize Concurrent pool of `n' potential separate connection handlers.
--| set the pool capacity to n.
do do
p.set_count (n) p.set_count (n)
end end
@@ -60,7 +59,7 @@ feature {HTTPD_SERVER_I} -- Execution
end end
pool_gracefull_stop (p: like pool) pool_gracefull_stop (p: like pool)
-- Graceful stop pool of separate connection handlers. -- Graceful stop concurrent pool of separate connection handlers.
do do
p.gracefull_stop p.gracefull_stop
end end
@@ -97,7 +96,7 @@ feature {HTTPD_SERVER_I} -- Execution
end end
process_handler (hdl: separate HTTPD_REQUEST_HANDLER) process_handler (hdl: separate HTTPD_REQUEST_HANDLER)
-- Process request handler `hdl' concurrently. -- Process request handler `hdl' as soon as `hdl' is connected to accepted socket.
require require
hdl.is_connected hdl.is_connected
do do
@@ -123,7 +122,7 @@ feature {HTTPD_SERVER_I} -- Status report
feature {NONE} -- Implementation feature {NONE} -- Implementation
separate_client_socket (hdl: separate HTTPD_REQUEST_HANDLER): separate HTTPD_STREAM_SOCKET separate_client_socket (hdl: separate HTTPD_REQUEST_HANDLER): separate HTTPD_STREAM_SOCKET
-- Client socket for handler `hdl'. -- Client socket for request handler `hdl'.
do do
Result := hdl.client_socket Result := hdl.client_socket
end end

View File

@@ -63,7 +63,7 @@ feature -- Access: SSL
-- private key to the certificate. -- private key to the certificate.
ssl_protocol: NATURAL ssl_protocol: NATURAL
-- By default protocol is tls 1.2. -- By default protocol is tls 1.2.
feature -- Element change feature -- Element change
@@ -71,7 +71,6 @@ feature -- Element change
do do
if v = Void then if v = Void then
unset_http_server_name unset_http_server_name
-- http_server_name := Void
else else
create {IMMUTABLE_STRING_8} http_server_name.make_from_separate (v) create {IMMUTABLE_STRING_8} http_server_name.make_from_separate (v)
end end
@@ -79,6 +78,7 @@ feature -- Element change
end end
unset_http_server_name unset_http_server_name
-- Unset `http_server_name' value.
do do
http_server_name := Void http_server_name := Void
ensure ensure
@@ -162,12 +162,11 @@ feature -- Element change
else else
is_secure := False is_secure := False
end end
--| Missing postcondition ensure
--| ensure is_secure_set: has_ssl_support implies is_secure
-- is_secure_set : has_ssl_support implies is_secure -- http_server_port_set: has_ssl_support implies http_server_port = 443
-- http_server_port_set: has_ssl_support implies http_server_port = 443 is_not_secure: not has_ssl_support implies not is_secure
-- is_not_secure: not has_ssl_support implies not is_secure -- default_port: not has_ssl_support implies http_server_port = 80
-- default_port: not has_ssl_support implies http_server_port = 80
end end
feature -- Element change feature -- Element change

View File

@@ -79,7 +79,7 @@ feature {NONE} -- Implementation
end end
separate_server_log (a_server: like server; a_message: separate READABLE_STRING_8) separate_server_log (a_server: like server; a_message: separate READABLE_STRING_8)
-- Separete log from a server `a_server' with message `a_message'. -- Concurrent call to `a_server.log (a_message)'.
do do
a_server.log (a_message) a_server.log (a_message)
end end

View File

@@ -1,5 +1,5 @@
note note
description: "Represent a handler interface that process HTTP requests." description: "HTTPD handler interface processing request."
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
@@ -126,7 +126,7 @@ feature -- Change
feature -- Execution feature -- Execution
safe_execute safe_execute
-- Execute incoming request. -- Execute accepted incoming connection as request.
local local
retried: BOOLEAN retried: BOOLEAN
do do
@@ -219,7 +219,6 @@ feature -- Execution
if has_error then if has_error then
-- check catch_bad_incoming_connection: False end -- check catch_bad_incoming_connection: False end
if is_verbose then if is_verbose then
-- check invalid_incoming_request: False end
log ("ERROR: invalid HTTP incoming request") log ("ERROR: invalid HTTP incoming request")
end end
else else

View File

@@ -14,9 +14,10 @@ inherit
feature {NONE} -- Initialization feature {NONE} -- Initialization
make (a_factory: like factory) make (a_factory: like factory)
-- Create current httpd server with `a_factory' of connection handlers.
-- `a_factory': connection handler builder -- `a_factory': connection handler builder
require require
fac_is_separated: {PLATFORM}.is_scoop_capable implies not attached {HTTPD_REQUEST_HANDLER_FACTORY} a_factory a_factory_is_separated: {PLATFORM}.is_scoop_capable implies not attached {HTTPD_REQUEST_HANDLER_FACTORY} a_factory
do do
make_configured (create {like configuration}.make, a_factory) make_configured (create {like configuration}.make, a_factory)
end end
@@ -66,7 +67,7 @@ feature -- Callbacks
observer: detachable separate HTTPD_SERVER_OBSERVER observer: detachable separate HTTPD_SERVER_OBSERVER
set_observer (obs: like observer) set_observer (obs: like observer)
-- Set `observer' with `obs' -- Set `observer' to `obs'.
do do
observer := obs observer := obs
end end
@@ -252,7 +253,6 @@ feature -- Event
require require
not_launched: not is_launched not_launched: not is_launched
do do
-- print ("port=" + a_port.out + "%N")
is_launched := True is_launched := True
port := a_port port := a_port
if attached observer as obs then if attached observer as obs then
@@ -320,7 +320,7 @@ feature -- Output
output: detachable FILE output: detachable FILE
set_log_output (f: FILE) set_log_output (f: FILE)
-- Set `output' with `f'. -- Set `output' to `f'.
do do
output := f output := f
ensure ensure
@@ -328,7 +328,7 @@ feature -- Output
end end
log (a_message: separate READABLE_STRING_8) log (a_message: separate READABLE_STRING_8)
-- Log `a_message' -- Log `a_message'.
local local
m: STRING m: STRING
do do

View File

@@ -1,5 +1,5 @@
note note
description: "Object that represent a request execution with request and response. " description: "Request execution based on attributes `request' and `response'. "
date: "$Date$" date: "$Date$"
revision: "$Revision$" revision: "$Revision$"
@@ -51,7 +51,7 @@ feature -- Access
feature -- Execution feature -- Execution
execute execute
-- Execute Current `request', -- Execute Current request,
-- getting data from `request' -- getting data from `request'
-- and response to client via `response'. -- and response to client via `response'.
deferred deferred
@@ -90,14 +90,13 @@ feature -- Helpers
end end
put_error (err: READABLE_STRING_8) put_error (err: READABLE_STRING_8)
-- Report error described by `a_message'. -- Report error message `err' on the error output of the associated connector.
require require
message_writable: message_writable message_writable: message_writable
do do
response.put_error (err) response.put_error (err)
end end
feature -- Cleaning feature -- Cleaning
clean clean