diff options
author | Ingela Anderton Andin <[email protected]> | 2015-04-01 10:01:05 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-04-07 23:00:46 +0200 |
commit | 9610d69586cbc54cc6068d2d736d5c47d9acce03 (patch) | |
tree | 7847e7c97c63bab322e4fa312a4d3397974b9bda | |
parent | 29a483d4f1eb42e23e30372d14ad69db2e9f33b9 (diff) | |
download | otp-9610d69586cbc54cc6068d2d736d5c47d9acce03.tar.gz otp-9610d69586cbc54cc6068d2d736d5c47d9acce03.tar.bz2 otp-9610d69586cbc54cc6068d2d736d5c47d9acce03.zip |
ssh: Add {active, false} to ssh listen socket
The ssh acceptor process listens for connections and
spawns a process to handle each new connection that it accepts.
The ownership of the accepted socket will be transfered to the new process
that will handle the incomming messages. Before the ownership is
transfered the socket should be in {active, false} or the acceptor
process may receive data aimed for the connection. As the accept socket
inherits the listen options we set {active, false} there.
-rw-r--r-- | lib/ssh/src/ssh_acceptor.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl index 6c443eeb9c..34988f17b6 100644 --- a/lib/ssh/src/ssh_acceptor.erl +++ b/lib/ssh/src/ssh_acceptor.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2013. All Rights Reserved. +%% Copyright Ericsson AB 2008-2015. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -43,7 +43,7 @@ start_link(Port, Address, SockOpts, Opts, AcceptTimeout) -> acceptor_init(Parent, Port, Address, SockOpts, Opts, AcceptTimeout) -> {_, Callback, _} = proplists:get_value(transport, Opts, {tcp, gen_tcp, tcp_closed}), - case (catch do_socket_listen(Callback, Port, SockOpts)) of + case (catch do_socket_listen(Callback, Port, [{active, false} | SockOpts])) of {ok, ListenSocket} -> proc_lib:init_ack(Parent, {ok, self()}), acceptor_loop(Callback, |