- MMS server: fixed wrong preprocessor defines that can cause problems in some configurations (unlimited number of client connections/ multi-threaded server)

pull/71/head
Michael Zillgith 7 years ago
parent a7cb12f5b0
commit ab51835377

@ -623,7 +623,9 @@ IsoServer_waitReady(IsoServer self, unsigned int timeoutMs)
IsoConnection_addHandleSet(isoConnection, handles); IsoConnection_addHandleSet(isoConnection, handles);
openConnection = LinkedList_getNext(openConnection); openConnection = LinkedList_getNext(openConnection);
} else { } else {
#if ((CONFIG_MMS_SINGLE_THREADED == 1) || (CONFIG_MMS_THREADLESS_STACK == 1))
IsoConnection_destroy(isoConnection); IsoConnection_destroy(isoConnection);
#endif
lastConnection->next = openConnection->next; lastConnection->next = openConnection->next;
GLOBAL_FREEMEM(openConnection); GLOBAL_FREEMEM(openConnection);
openConnection = lastConnection->next; 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) #if (CONFIG_MMS_THREADLESS_STACK != 1) && (CONFIG_MMS_SINGLE_THREADED == 0)
unlockClientConnections(self); unlockClientConnections(self);
#endif #endif
#endif /* (CONFIG_MAXIMUM_TCP_CLIENT_CONNECTIONS == -1) */
Handleset_addSocket(handles, self->serverSocket); Handleset_addSocket(handles, self->serverSocket);
result = Handleset_waitReady(handles, timeoutMs); result = Handleset_waitReady(handles, timeoutMs);
Handleset_destroy(handles); Handleset_destroy(handles);

Loading…
Cancel
Save