diff options
author | Ingela Anderton Andin <[email protected]> | 2014-06-24 15:50:19 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-06-26 08:57:55 +0200 |
commit | 87401c346717d12e64d5dc2c8b3715e322072535 (patch) | |
tree | a1415c1f2be29ea679567a293e5f9b725a0fac16 /lib/inets | |
parent | 54a15c0d2720ae041620c55ea6541126b3f451ec (diff) | |
download | otp-87401c346717d12e64d5dc2c8b3715e322072535.tar.gz otp-87401c346717d12e64d5dc2c8b3715e322072535.tar.bz2 otp-87401c346717d12e64d5dc2c8b3715e322072535.zip |
inets: Create seperate timeout for TLS/SSL handshake
We do not want this timeout to be mixed up with the keep alive timeout.
We will probably want to make it configurable later.
Diffstat (limited to 'lib/inets')
-rw-r--r-- | lib/inets/src/http_server/httpd_request_handler.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl index b3c9cbc46a..9bea58cc9e 100644 --- a/lib/inets/src/http_server/httpd_request_handler.erl +++ b/lib/inets/src/http_server/httpd_request_handler.erl @@ -35,6 +35,7 @@ -include("http_internal.hrl"). -include("httpd_internal.hrl"). +-define(HANDSHAKE_TIMEOUT, 5000). -record(state, {mod, %% #mod{} manager, %% pid() status, %% accept | busy | blocked @@ -96,15 +97,13 @@ init([Manager, ConfigDB, AcceptTimeout]) -> {SocketType, Socket} = await_socket_ownership_transfer(AcceptTimeout), - TimeOut = httpd_util:lookup(ConfigDB, keep_alive_timeout, 150000), - Then = erlang:now(), + KeepAliveTimeOut = httpd_util:lookup(ConfigDB, keep_alive_timeout, 150000), - case http_transport:negotiate(SocketType, Socket, TimeOut) of + case http_transport:negotiate(SocketType, Socket, ?HANDSHAKE_TIMEOUT) of {error, _Error} -> exit(shutdown); %% Can be 'normal'. ok -> - NewTimeout = TimeOut - timer:now_diff(now(),Then) div 1000, - continue_init(Manager, ConfigDB, SocketType, Socket, NewTimeout) + continue_init(Manager, ConfigDB, SocketType, Socket, KeepAliveTimeOut) end. continue_init(Manager, ConfigDB, SocketType, Socket, TimeOut) -> |