Fixed a problem where child threads would not be closed if they had been
created after the initial creation. Also fixed a problem where the status of the threads were not going back to T_WAITING if MaxRequestsPerChild was 0.
This commit is contained in:
parent
af10311eaf
commit
7fe7ee2828
15
src/thread.c
15
src/thread.c
@ -1,4 +1,4 @@
|
||||
/* $Id: thread.c,v 1.5 2001-05-27 02:33:35 rjkaes Exp $
|
||||
/* $Id: thread.c,v 1.6 2001-08-26 21:14:30 rjkaes Exp $
|
||||
*
|
||||
* Handles the creation/destruction of the various threads required for
|
||||
* processing incoming connections.
|
||||
@ -109,12 +109,11 @@ static void *thread_main(void *arg)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for ( ; ; ) {
|
||||
while (!config.quit) {
|
||||
clilen = addrlen;
|
||||
pthread_mutex_lock(&mlock);
|
||||
connfd = accept(listenfd, cliaddr, &clilen);
|
||||
pthread_mutex_unlock(&mlock);
|
||||
|
||||
ptr->status = T_CONNECTED;
|
||||
|
||||
SERVER_DEC();
|
||||
@ -129,13 +128,15 @@ static void *thread_main(void *arg)
|
||||
log_message(LOG_NOTICE, "Thread has reached MaxRequestsPerChild... closing.");
|
||||
ptr->status = T_EMPTY;
|
||||
return NULL;
|
||||
} else {
|
||||
ptr->status = T_WAITING;
|
||||
|
||||
SERVER_INC();
|
||||
}
|
||||
}
|
||||
|
||||
ptr->status = T_WAITING;
|
||||
|
||||
SERVER_INC();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user