From ab51835377212e9cadb1b429d079c877498ae17e Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Tue, 26 Jun 2018 19:28:24 +0200 Subject: [PATCH] - MMS server: fixed wrong preprocessor defines that can cause problems in some configurations (unlimited number of client connections/ multi-threaded server) --- src/mms/iso_server/iso_server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mms/iso_server/iso_server.c b/src/mms/iso_server/iso_server.c index a2e0ba84..1b5628b9 100644 --- a/src/mms/iso_server/iso_server.c +++ b/src/mms/iso_server/iso_server.c @@ -623,7 +623,9 @@ IsoServer_waitReady(IsoServer self, unsigned int timeoutMs) IsoConnection_addHandleSet(isoConnection, handles); openConnection = LinkedList_getNext(openConnection); } else { +#if ((CONFIG_MMS_SINGLE_THREADED == 1) || (CONFIG_MMS_THREADLESS_STACK == 1)) IsoConnection_destroy(isoConnection); +#endif lastConnection->next = openConnection->next; GLOBAL_FREEMEM(openConnection); openConnection = lastConnection->next; @@ -649,11 +651,12 @@ IsoServer_waitReady(IsoServer self, unsigned int timeoutMs) } } +#endif /* (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1) */ + #if (CONFIG_MMS_THREADLESS_STACK != 1) && (CONFIG_MMS_SINGLE_THREADED == 0) unlockClientConnections(self); #endif -#endif /* (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1) */ Handleset_addSocket(handles, self->serverSocket); result = Handleset_waitReady(handles, timeoutMs); Handleset_destroy(handles);