mirror of
https://github.com/sigmasternchen/CFloor
synced 2025-03-15 04:18:55 +00:00
cleanup should be done now
This commit is contained in:
parent
d12a968cc2
commit
7490e0a739
1 changed files with 11 additions and 0 deletions
|
@ -690,6 +690,8 @@ void startRequestHandler(struct connection* connection) {
|
|||
pthread_t dataThreadId;
|
||||
|
||||
void dataHandler(int signo) {
|
||||
pthread_t self = pthread_self();
|
||||
|
||||
debug("networking: data handler got called.");
|
||||
|
||||
for(link_t* link = linked_first(&connectionList); link != NULL; link = linked_next(link)) {
|
||||
|
@ -704,6 +706,15 @@ void dataHandler(int signo) {
|
|||
connection->inUse++;
|
||||
pthread_mutex_unlock(&(connection->lock));
|
||||
|
||||
// if the connection is persistent there could be still
|
||||
// unjoined threads -> join them
|
||||
if (connection->threads.response != PTHREAD_NULL) {
|
||||
stopThread(self, &(connection->threads.response), false);
|
||||
}
|
||||
if (connection->threads.encoder != PTHREAD_NULL) {
|
||||
stopThread(self, &(connection->threads.encoder), false);
|
||||
}
|
||||
|
||||
int tmp;
|
||||
char c;
|
||||
char buffer[BUFFER_LENGTH];
|
||||
|
|
Loading…
Reference in a new issue