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 @@ -411,6 +411,7 @@ namespace sio
411
411
void client_impl::on_close (connection_hdl con)
412
412
{
413
413
LOG (" Client Disconnected." << endl);
414
+ con_state m_con_state_was = m_con_state;
414
415
m_con_state = con_closed;
415
416
lib::error_code ec;
416
417
close::status::value code = close::status::normal;
@@ -426,7 +427,11 @@ namespace sio
426
427
m_con.reset ();
427
428
this ->clear_timers ();
428
429
client::close_reason reason;
429
- if (code == close::status::normal)
430
+
431
+ // If we initiated the close, no matter what the close status was,
432
+ // we'll consider it a normal close. (When using TLS, we can
433
+ // sometimes get a TLS Short Read error when closing.)
434
+ if (code == close::status::normal || m_con_state_was == con_closing)
430
435
{
431
436
this ->sockets_invoke_void (&sio::socket::on_disconnect);
432
437
reason = client::close_reason_normal;
You can’t perform that action at this time.
0 commit comments