Improved networking implementation for httpd server and sockets.
Use new EiffelNet routines that do not raise exception on error. Made compilable with 16.05 and dev-and-upcoming release 16.11. Fixed various minor issues related to base_url, and added comments.
This commit is contained in:
@@ -20,13 +20,19 @@ create
|
||||
feature {NONE} -- Factory
|
||||
|
||||
new_listening_socket (a_addr: detachable INET_ADDRESS; a_http_port: INTEGER): HTTPD_STREAM_SOCKET
|
||||
local
|
||||
s_ssl: HTTPD_STREAM_SSL_SOCKET
|
||||
do
|
||||
if configuration.is_secure then
|
||||
if a_addr /= Void then
|
||||
create {HTTPD_STREAM_SSL_SOCKET} Result.make_ssl_server_by_address_and_port (a_addr, a_http_port, configuration.ssl_protocol, configuration.ca_crt, configuration.ca_key)
|
||||
create s_ssl.make_server_by_address_and_port (a_addr, a_http_port)
|
||||
Result := s_ssl
|
||||
else
|
||||
create {HTTPD_STREAM_SSL_SOCKET} Result.make_ssl_server_by_port (a_http_port, configuration.ssl_protocol, configuration.ca_crt, configuration.ca_key)
|
||||
create s_ssl.make_server_by_port (a_http_port)
|
||||
end
|
||||
s_ssl.set_tls_protocol (configuration.ssl_protocol)
|
||||
s_ssl.set_certificate_filenames (configuration.ca_crt, configuration.ca_key)
|
||||
Result := s_ssl
|
||||
else
|
||||
Result := Precursor (a_addr, a_http_port)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user