Updated code related to force_single_threaded setting to mark it obsolete, and for now, have coherent value 1 vs 0 among the standalone code and the httpd library.
This commit is contained in:
@@ -53,8 +53,10 @@ feature -- Access
|
||||
-- Max number of concurrent connections.
|
||||
|
||||
force_single_threaded: BOOLEAN assign set_force_single_threaded
|
||||
obsolete
|
||||
"Use directly `max_concurrent_connections = 1` [Feb/2017]"
|
||||
do
|
||||
Result := max_concurrent_connections = 0
|
||||
Result := max_concurrent_connections <= 1
|
||||
end
|
||||
|
||||
is_verbose: BOOLEAN assign set_is_verbose
|
||||
@@ -198,16 +200,18 @@ feature -- Element change
|
||||
|
||||
set_force_single_threaded (v: like force_single_threaded)
|
||||
-- Force server to handle incoming request in a single thread.
|
||||
-- i.e set max_concurrent_connections to 0!
|
||||
-- i.e set max_concurrent_connections to 1!
|
||||
obsolete
|
||||
"Use set_max_concurrent_connections (0) [June/2016]"
|
||||
"Use set_max_concurrent_connections (1) [June/2016]"
|
||||
do
|
||||
if v then
|
||||
set_max_concurrent_connections (0)
|
||||
set_max_concurrent_connections (1)
|
||||
else
|
||||
set_max_concurrent_connections (default_max_concurrent_connections)
|
||||
end
|
||||
--|Missing postcondition
|
||||
--| force_single_thread_set: v implies max_concurrent_connections = 0
|
||||
--| not_single_thread: not v implies max_concurrent_connections > 0
|
||||
ensure
|
||||
force_single_threaded_set: v implies max_concurrent_connections <= 1
|
||||
not_single_threaded: not v implies max_concurrent_connections > 1
|
||||
end
|
||||
|
||||
set_is_verbose (b: BOOLEAN)
|
||||
|
||||
@@ -9,7 +9,7 @@ note
|
||||
port: numeric such as 8099 (or equivalent string as "8099")
|
||||
base: base_url (very specific to standalone server)
|
||||
|
||||
max_concurrent_connections: set one, for single threaded behavior
|
||||
max_concurrent_connections: set to 1, for single threaded behavior
|
||||
max_tcp_clients: max number of open tcp connection
|
||||
|
||||
socket_timeout: connection timeout
|
||||
@@ -106,7 +106,8 @@ feature {NONE} -- Initialization
|
||||
port_number := opts.option_integer_value ("port", port_number)
|
||||
|
||||
if opts.option_boolean_value ("force_single_threaded", False) then
|
||||
force_single_threaded
|
||||
-- Obsolete: keep for backward compatibility with obsolete Nino connector.
|
||||
set_max_concurrent_connections (1)
|
||||
end
|
||||
max_concurrent_connections := opts.option_integer_value ("max_concurrent_connections", max_concurrent_connections)
|
||||
max_tcp_clients := opts.option_integer_value ("max_tcp_clients", max_tcp_clients)
|
||||
@@ -139,8 +140,22 @@ feature {NONE} -- Initialization
|
||||
|
||||
force_single_threaded
|
||||
-- Set `single_threaded' to True.
|
||||
obsolete
|
||||
"Use set_max_concurrent_connections (1) [Feb/2017]"
|
||||
do
|
||||
max_concurrent_connections := 1
|
||||
set_max_concurrent_connections (1)
|
||||
ensure
|
||||
single_threaded: single_threaded
|
||||
end
|
||||
|
||||
set_max_concurrent_connections (v: like max_concurrent_connections)
|
||||
-- Set `max_concurrent_connections` to `v`.
|
||||
require
|
||||
v_positive_or_zero: v >= 0
|
||||
do
|
||||
max_concurrent_connections := v
|
||||
ensure
|
||||
max_concurrent_connections_set : max_concurrent_connections = v
|
||||
end
|
||||
|
||||
feature -- Execution
|
||||
@@ -162,7 +177,7 @@ feature -- Execution
|
||||
|
||||
launch
|
||||
-- <Precursor/>
|
||||
-- using `port_number', `base_url', `verbose' and `single_threaded'
|
||||
-- using associated settings/configuration.
|
||||
local
|
||||
conn: like connector
|
||||
do
|
||||
@@ -219,11 +234,13 @@ feature {NONE} -- Implementation
|
||||
-- Help defining the verbosity.
|
||||
-- The higher, the more output.
|
||||
|
||||
max_concurrent_connections: INTEGER
|
||||
max_concurrent_connections: INTEGER assign set_max_concurrent_connections
|
||||
|
||||
single_threaded: BOOLEAN
|
||||
obsolete
|
||||
"Use max_concurrent_connections <= 1 [Feb/2017]"
|
||||
do
|
||||
Result := max_concurrent_connections = 0
|
||||
Result := max_concurrent_connections <= 1
|
||||
end
|
||||
|
||||
max_tcp_clients: INTEGER
|
||||
|
||||
Reference in New Issue
Block a user