Files
EWF/library/server/httpd/concurrency/thread/httpd_connection_handler.e
Jocelyn Fiat 30a5e087ae Web form:
- Improvement about web form manipulation (remove a field, set a text value to input fields by name, ...)
 - Improved web form html generation, especially for select and type checkbox
 - Updated the date input field interface with a new set_date_value .

File response:
 - "application/force-download" is not a standard MIME content type, so use "application_octet_stream" instead as default.

Standalone connector:
 - Added expected creation procedure for the service launcher.
 - Added new "secure_port" configuration variable, for SSL standalone service.
   This way, if `is_secure` is True, the server will use `secure_port` (overrides `port` value).

Date:
 - Improved support for RFC 3339 (a profile of ISO 8601)

Removed obsolete and warnings:
 - removed usage of FILE_NAME
 - updated code to avoid implicit conversion from STRING_32 to STRING_8
 - avoid uneed conversion to STRING_8 (when possible)
2020-10-02 15:02:06 +02:00

101 lines
2.1 KiB
Plaintext

note
description: "[
Implementation of HTTPD_CONNECTION_HANDLER_I for concurrency mode: Thread
]"
date: "$Date$"
revision: "$Revision$"
class
HTTPD_CONNECTION_HANDLER
inherit
HTTPD_CONNECTION_HANDLER_I
create
make
feature {NONE} -- Initialization
initialize
local
n: INTEGER
do
n := max_concurrent_connections (server).max (1) -- At least one thread!
create pool.make (n.to_natural_32)
end
feature -- Access
is_shutdown_requested: BOOLEAN
max_concurrent_connections (a_server: like server): INTEGER
do
Result := a_server.configuration.max_concurrent_connections
end
feature {HTTPD_SERVER_I} -- Execution
shutdown
do
if not is_shutdown_requested then
is_shutdown_requested := True
pool_gracefull_stop (pool)
end
end
pool_gracefull_stop (p: like pool)
do
p.terminate
end
accept_incoming_connection (a_listening_socket: HTTPD_STREAM_SOCKET)
local
cl: separate HTTPD_STREAM_SOCKET
do
debug ("dbglog")
dbglog (generator + ".ENTER accept_connection {"+ a_listening_socket.descriptor.out +"}")
end
if is_shutdown_requested then
-- cancel
elseif attached factory.new_handler as h then
cl := h.client_socket
a_listening_socket.accept_to (cl)
if h.is_connected then
pool.add_work (agent h.safe_execute)
end
end
debug ("dbglog")
dbglog (generator + ".LEAVE accept_incoming_connection {"+ a_listening_socket.descriptor.out +"}")
end
end
feature {HTTPD_SERVER_I} -- Status report
wait_for_completion
-- Wait until Current is ready for shutdown
do
pool.wait_for_completion
end
feature {NONE} -- Access
pool: THREAD_POOL [HTTPD_REQUEST_HANDLER] --ANY] --POOLED_THREAD [HTTP_REQUEST_HANDLER]]
-- Pool of concurrent connection handlers.
invariant
pool_attached: pool /= Void
note
copyright: "2011-2018, 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