introduce RR of connections.

git-svn-id: file:///var/lib/svn/clamav-devel/branches/clamd-proto@4713 77e5149b-7576-45b1-b177-96237e5ba77b
0.95
Török Edvin 17 years ago
parent fdbaba8d49
commit 76f21b4a30
  1. 4
      ChangeLog
  2. 6
      clamd/server-th.c

@ -1,3 +1,7 @@
Sun Feb 8 23:34:24 EET 2009 (edwin)
------------------------------------
* clamd/server-th.c: introduce RR of connections.
Sun Feb 8 23:34:15 EET 2009 (edwin)
------------------------------------
* clamd/session.c, clamd/thrmgr.c, clamd/thrmgr.h: always allocate a

@ -420,7 +420,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
int idletimeout;
uint32_t val32;
uint64_t val64;
size_t i;
size_t i, j, rr_last = 0;
pthread_t accept_th;
struct acceptdata acceptdata;
struct fd_data *fds = &acceptdata.recv_fds;
@ -778,7 +778,8 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
pthread_mutex_unlock(&exit_mutex);
}
for (i=0;i < fds->nfds && new_sd >= 0; i++) {
i = (rr_last + 1) % fds->nfds;
for (j = 0; j < fds->nfds && new_sd >= 0; j++, i = (i+1) % fds->nfds) {
size_t pos = 0;
int error = 0;
struct fd_buf *buf = &fds->buf[i];
@ -804,6 +805,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
}
}
rr_last = i;
if (buf->mode == MODE_WAITANCILL) {
buf->mode = MODE_COMMAND;
logg("*RECVTH: mode -> MODE_COMMAND\n");

Loading…
Cancel
Save