From a69dc6d28744ff9e17e2ef1bfab663a4a8cae8d0 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 19 Nov 2012 14:55:17 +0100 Subject: 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. --- lib/ssl/src/ssl_connection.erl | 6 +++--- 1 file 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); _ -> -- cgit v1.2.3