aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-11-19 14:55:17 +0100
committerIngela Anderton Andin <[email protected]>2012-11-19 14:55:17 +0100
commita69dc6d28744ff9e17e2ef1bfab663a4a8cae8d0 (patch)
treea8c46baadf1faf5cb441f6bf0cdf7bee269246d7
parentc344975f28584e70240b82ae955ea1260276f89d (diff)
downloadotp-a69dc6d28744ff9e17e2ef1bfab663a4a8cae8d0.tar.gz
otp-a69dc6d28744ff9e17e2ef1bfab663a4a8cae8d0.tar.bz2
otp-a69dc6d28744ff9e17e2ef1bfab663a4a8cae8d0.zip
ssl: Fix bug in match expression found by Dialyzer
Code should handle case the there is some undelivered data left on the socket when peer close signal is received. It is unlikely that this happens during normal testing.
-rw-r--r--lib/ssl/src/ssl_connection.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index c1086a09ef..eb71bc61e9 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -2478,9 +2478,9 @@ handle_unrecv_data(StateName, #state{socket = Socket, transport_cb = Transport}
handle_close_alert(Data, StateName, State)
end.
-handle_close_alert(Data, StateName, State) ->
- case next_tls_record(Data, State) of
- #ssl_tls{type = ?ALERT, fragment = EncAlerts} ->
+handle_close_alert(Data, StateName, State0) ->
+ case next_tls_record(Data, State0) of
+ {#ssl_tls{type = ?ALERT, fragment = EncAlerts}, State} ->
[Alert|_] = decode_alerts(EncAlerts),
handle_normal_shutdown(Alert, StateName, State);
_ ->