Skip to content
Snippets Groups Projects
Commit 13c76f67 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

SSL.File: Improved robustness of close handling.

The close_state is now set correctly even when there's a pending
close_errno and the peer closes the connection.
parent 2da298ca
No related branches found
No related tags found
No related merge requests found
...@@ -2089,10 +2089,8 @@ protected int ssl_close_callback (int ignored) ...@@ -2089,10 +2089,8 @@ protected int ssl_close_callback (int ignored)
SSL3_DEBUG_MSG ("ssl_close_callback: Propagating errno from another callback\n"); SSL3_DEBUG_MSG ("ssl_close_callback: Propagating errno from another callback\n");
#endif #endif
if (!close_errno) {
if (!conn || conn->state & CONNECTION_peer_closed) if (!conn || conn->state & CONNECTION_peer_closed)
SSL3_DEBUG_MSG ("ssl_close_callback: After clean close\n"); SSL3_DEBUG_MSG ("ssl_close_callback: After clean close\n");
else { else {
// The remote end has closed the connection without sending a // The remote end has closed the connection without sending a
// close packet. // close packet.
...@@ -2104,8 +2102,9 @@ protected int ssl_close_callback (int ignored) ...@@ -2104,8 +2102,9 @@ protected int ssl_close_callback (int ignored)
SSL3_DEBUG_MSG ("ssl_close_callback: Abrupt close - " SSL3_DEBUG_MSG ("ssl_close_callback: Abrupt close - "
"simulating System.EPIPE\n"); "simulating System.EPIPE\n");
cleanup_on_error(); cleanup_on_error();
close_errno = System.EPIPE;
close_state = ABRUPT_CLOSE; close_state = ABRUPT_CLOSE;
if (!close_errno) {
close_errno = System.EPIPE;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment