- IEC 61850 server: fixed - Configuration option CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS = -1 doesn't work (#231)

pull/239/head
Michael Zillgith 5 years ago
parent d42f96ee97
commit b0fbf9f3a3

@ -187,12 +187,11 @@ removeClientConnection(IsoServer self, IsoConnection connection)
{ {
#if (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1) #if (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1)
#if (CONFIG_MMS_SINGLE_THREADED == 0)
LinkedList_remove(self->openClientConnections, connection); LinkedList_remove(self->openClientConnections, connection);
#endif /* (CONFIG_MMS_SINGLE_THREADED == 0) */ #if (CONFIG_MMS_SINGLE_THREADED == 1)
IsoConnection_removeFromHandleSet(connection, self->handleset);
#endif
#else #else
@ -226,7 +225,8 @@ removeTerminatedConnections(IsoServer self, bool isSingleThread)
#if (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1) #if (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1)
LinkedList openConnection = LinkedList_getNext(self->openClientConnections); LinkedList openConnection = LinkedList_getNext(self->openClientConnections);
while (openConnection != NULL) {
while (openConnection) {
IsoConnection isoConnection = (IsoConnection) openConnection->data; IsoConnection isoConnection = (IsoConnection) openConnection->data;
if (isSingleThread) { if (isSingleThread) {
@ -335,6 +335,7 @@ callTickHandlerForClientConnections(IsoServer self)
#if (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1) #if (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1)
LinkedList openConnection = LinkedList_getNext(self->openClientConnections); LinkedList openConnection = LinkedList_getNext(self->openClientConnections);
while (openConnection != NULL) { while (openConnection != NULL) {
IsoConnection isoConnection = (IsoConnection) openConnection->data; IsoConnection isoConnection = (IsoConnection) openConnection->data;
@ -376,13 +377,6 @@ handleClientConnections(IsoServer self)
if (IsoConnection_isRunning(isoConnection)) if (IsoConnection_isRunning(isoConnection))
IsoConnection_handleTcpConnection(isoConnection, true); IsoConnection_handleTcpConnection(isoConnection, true);
else {
IsoConnection_destroy(isoConnection);
lastConnection->next = openConnection->next;
GLOBAL_FREEMEM(openConnection);
}
openConnection = LinkedList_getNext(openConnection); openConnection = LinkedList_getNext(openConnection);
} }
@ -391,6 +385,8 @@ handleClientConnections(IsoServer self)
unlockClientConnections(self); unlockClientConnections(self);
#endif #endif
removeTerminatedConnections(self, true);
#else #else
#if (CONFIG_MMS_THREADLESS_STACK != 1) && (CONFIG_MMS_SINGLE_THREADED == 0) #if (CONFIG_MMS_THREADLESS_STACK != 1) && (CONFIG_MMS_SINGLE_THREADED == 0)

Loading…
Cancel
Save