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 @@ -399,6 +399,7 @@ namespace sio
399
399
void client_impl::on_close (connection_hdl con)
400
400
{
401
401
LOG (" Client Disconnected." << endl);
402
+ con_state m_con_state_was = m_con_state;
402
403
m_con_state = con_closed;
403
404
lib::error_code ec;
404
405
close::status::value code = close::status::normal;
@@ -414,7 +415,11 @@ namespace sio
414
415
m_con.reset ();
415
416
this ->clear_timers ();
416
417
client::close_reason reason;
417
- if (code == close::status::normal)
418
+
419
+ // If we initiated the close, no matter what the close status was,
420
+ // we'll consider it a normal close. (When using TLS, we can
421
+ // sometimes get a TLS Short Read error when closing.)
422
+ if (code == close::status::normal || m_con_state_was == con_closing)
418
423
{
419
424
this ->sockets_invoke_void (&sio::socket::on_disconnect);
420
425
reason = client::close_reason_normal;
You can’t perform that action at this time.
0 commit comments