aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_ssl_transport.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-04-16 13:59:30 +0200
committerLoïc Hoguin <[email protected]>2011-04-16 13:59:30 +0200
commit8f818d79dfe22af8a4a557c1e8676463224b9c22 (patch)
treeedc60a719bb1a4b40cc710ddbe53faadcecb0530 /src/cowboy_ssl_transport.erl
parentd4985dd72be29f6b472d2f7514b88fa20fb061b6 (diff)
downloadcowboy-8f818d79dfe22af8a4a557c1e8676463224b9c22.tar.gz
cowboy-8f818d79dfe22af8a4a557c1e8676463224b9c22.tar.bz2
cowboy-8f818d79dfe22af8a4a557c1e8676463224b9c22.zip
Add an accept timeout for code reloading.
Thought it was already there, but I guess not. Anyway it's here now so everything is back to normal. ;)
Diffstat (limited to 'src/cowboy_ssl_transport.erl')
-rw-r--r--src/cowboy_ssl_transport.erl16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cowboy_ssl_transport.erl b/src/cowboy_ssl_transport.erl
index f5c23e3..1122bfb 100644
--- a/src/cowboy_ssl_transport.erl
+++ b/src/cowboy_ssl_transport.erl
@@ -13,7 +13,7 @@
%% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-module(cowboy_ssl_transport).
--export([name/0, messages/0, listen/1, accept/1, recv/3, send/2, setopts/2,
+-export([name/0, messages/0, listen/1, accept/2, recv/3, send/2, setopts/2,
controlling_process/2, peername/1, close/1]). %% API.
-include("include/types.hrl").
@@ -38,12 +38,12 @@ listen(Opts) ->
{packet, raw}, {reuseaddr, true},
{certfile, CertFile}, {keyfile, KeyFile}, {password, Password}]).
--spec accept(LSocket::sslsocket())
+-spec accept(LSocket::sslsocket(), Timeout::timeout())
-> {ok, Socket::sslsocket()} | {error, Reason::closed | timeout | posix()}.
-accept(LSocket) ->
- case ssl:transport_accept(LSocket) of
+accept(LSocket, Timeout) ->
+ case ssl:transport_accept(LSocket, Timeout) of
{ok, CSocket} ->
- ssl_accept(CSocket);
+ ssl_accept(CSocket, Timeout);
{error, Reason} ->
{error, Reason}
end.
@@ -79,10 +79,10 @@ close(Socket) ->
%% Internal.
--spec ssl_accept(CSocket::sslsocket())
+-spec ssl_accept(CSocket::sslsocket(), Timeout::timeout())
-> {ok, Socket::sslsocket()} | {error, Reason::closed | timeout | posix()}.
-ssl_accept(CSocket) ->
- case ssl:ssl_accept(CSocket) of
+ssl_accept(CSocket, Timeout) ->
+ case ssl:ssl_accept(CSocket, Timeout) of
ok ->
{ok, CSocket};
{error, Reason} ->