Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clamd/server-th.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ static void *acceptloop_th(void *arg)
/* don't accept unlimited number of connections, or
* we'll run out of file descriptors */
pthread_mutex_lock(recv_fds->buf_mutex);
while (recv_fds->nfds > (unsigned)max_queue) {
while (recv_fds->nfds >= (unsigned)max_queue) {
pthread_mutex_lock(&exit_mutex);
if (progexit) {
pthread_mutex_unlock(&exit_mutex);
Expand Down Expand Up @@ -1580,7 +1580,7 @@ int recvloop(int *socketds, unsigned nsockets, struct cl_engine *engine, unsigne
pthread_mutex_lock(fds->buf_mutex);
fds_cleanup(fds);
/* signal that we can accept more connections */
if (fds->nfds <= (unsigned)max_queue)
if (fds->nfds < (unsigned)max_queue)
pthread_cond_signal(&acceptdata.cond_nfds);
new_sd = fds_poll_recv(fds, selfchk ? (int)selfchk : -1, 1, event_wake_recv);
#ifdef _WIN32
Expand Down
Loading