File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,7 @@ namespace sio
406
406
void client_impl::on_close (connection_hdl con)
407
407
{
408
408
LOG (" Client Disconnected." << endl);
409
+ con_state m_con_state_was = m_con_state;
409
410
m_con_state = con_closed;
410
411
lib::error_code ec;
411
412
close::status::value code = close::status::normal;
@@ -421,7 +422,11 @@ namespace sio
421
422
m_con.reset ();
422
423
this ->clear_timers ();
423
424
client::close_reason reason;
424
- if (code == close::status::normal)
425
+
426
+ // If we initiated the close, no matter what the close status was,
427
+ // we'll consider it a normal close. (When using TLS, we can
428
+ // sometimes get a TLS Short Read error when closing.)
429
+ if (code == close::status::normal || m_con_state_was == con_closing)
425
430
{
426
431
this ->sockets_invoke_void (&sio::socket::on_disconnect);
427
432
reason = client::close_reason_normal;
You can’t perform that action at this time.
0 commit comments