- invalidate ClientConnection instance when connection is closed by remote (LIB61850-488)

v1.6
Michael Zillgith 1 month ago
parent 6630256f63
commit 96a7106a99

@ -95,6 +95,9 @@ private_IedServer_getClientConnectionByHandle(IedServer self, void* serverConnec
LIB61850_INTERNAL ClientConnection LIB61850_INTERNAL ClientConnection
private_ClientConnection_create(void* serverConnectionHandle); private_ClientConnection_create(void* serverConnectionHandle);
LIB61850_INTERNAL void
private_ClientConnection_invalidate(ClientConnection self);
LIB61850_INTERNAL int LIB61850_INTERNAL int
private_ClientConnection_getTasksCount(ClientConnection self); private_ClientConnection_getTasksCount(ClientConnection self);

@ -57,6 +57,20 @@ struct sClientConnection
#endif /* _TLS_OWN_CNT_SEM */ #endif /* _TLS_OWN_CNT_SEM */
}; };
void
private_ClientConnection_invalidate(ClientConnection self)
{
#if (CONFIG_MMS_THREADLESS_STACK != 1)
Semaphore_wait(self->accessMutex);
#endif
self->serverConnectionHandle = NULL;
#if (CONFIG_MMS_THREADLESS_STACK != 1)
Semaphore_post(self->accessMutex);
#endif
}
ClientConnection ClientConnection
private_ClientConnection_create(void* serverConnectionHandle) private_ClientConnection_create(void* serverConnectionHandle)
{ {

@ -3354,6 +3354,8 @@ mmsConnectionHandler(void* parameter, MmsServerConnection connection, MmsServerE
unselectAllSettingGroups(self, connection); unselectAllSettingGroups(self, connection);
#endif #endif
private_ClientConnection_invalidate(clientConnection);
ClientConnection_release(clientConnection); ClientConnection_release(clientConnection);
} }
else if (event == MMS_SERVER_NEW_CONNECTION) { else if (event == MMS_SERVER_NEW_CONNECTION) {

@ -818,7 +818,6 @@ MmsServerConnection_init(MmsServerConnection connection, MmsServer server, IsoCo
void void
MmsServerConnection_destroy(MmsServerConnection self) MmsServerConnection_destroy(MmsServerConnection self)
{ {
#if (MMS_FILE_SERVICE == 1) #if (MMS_FILE_SERVICE == 1)
int frsmIndex = 0; int frsmIndex = 0;

Loading…
Cancel
Save