aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_connection.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2014-04-17 15:15:57 +0200
committerIngela Anderton Andin <[email protected]>2014-04-17 15:15:57 +0200
commit5ed7805b6609566c32b5b6728900e4ab28f34d41 (patch)
treeaa1f24d040d76dbee958f377212111d36e953d70 /lib/ssl/src/ssl_connection.erl
parentdf7dc4d8b6a2834136c5ffefb404009ce62ea939 (diff)
downloadotp-5ed7805b6609566c32b5b6728900e4ab28f34d41.tar.gz
otp-5ed7805b6609566c32b5b6728900e4ab28f34d41.tar.bz2
otp-5ed7805b6609566c32b5b6728900e4ab28f34d41.zip
ssl: recv shall ruturn {error, einval} on active socket
Diffstat (limited to 'lib/ssl/src/ssl_connection.erl')
-rw-r--r--lib/ssl/src/ssl_connection.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index c2810a199f..edf49a340b 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -696,7 +696,11 @@ handle_sync_event({shutdown, How0}, _, StateName,
Error ->
{stop, normal, Error, State}
end;
-
+
+handle_sync_event({recv, _N, _Timeout}, _RecvFrom, StateName,
+ #state{socket_options = #socket_options{active = Active}} = State) when Active =/= false ->
+ {reply, {error, einval}, StateName, State, get_timeout(State)};
+
handle_sync_event({recv, N, Timeout}, RecvFrom, connection = StateName,
#state{protocol_cb = Connection} = State0) ->
Timer = start_or_recv_cancel_timer(Timeout, RecvFrom),