File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -819,9 +819,6 @@ static dmExtension::Result OnUpdate(dmExtension::Params* params)
819819 {
820820 WebsocketConnection* conn = g_Websocket.m_Connections [i];
821821
822- bool state_transition = conn->m_State != conn->m_PreviousState ;
823- conn->m_PreviousState = conn->m_State ;
824-
825822 if (STATE_DISCONNECTED == conn->m_State )
826823 {
827824 {
@@ -845,7 +842,8 @@ static dmExtension::Result OnUpdate(dmExtension::Params* params)
845842 else if ((STATE_CONNECTED == conn->m_State ) || (STATE_DISCONNECTING == conn->m_State ))
846843 {
847844 DM_MUTEX_SCOPED_LOCK (conn->m_Mutex );
848- if (state_transition && (STATE_CONNECTED == conn->m_State ))
845+ // transitioned to the connected state?
846+ if ((conn->m_State != conn->m_PreviousState ) && (STATE_CONNECTED == conn->m_State ))
849847 {
850848 HandleCallback (conn, EVENT_CONNECTED, 0 , 0 );
851849 }
@@ -881,6 +879,8 @@ static dmExtension::Result OnUpdate(dmExtension::Params* params)
881879 }
882880#endif
883881 }
882+
883+ conn->m_PreviousState = conn->m_State ;
884884 }
885885
886886 return dmExtension::RESULT_OK;
You can’t perform that action at this time.
0 commit comments