also remove socket from tracked sockets after switching mode to WAITREPLY.

git-svn-id: file:///var/lib/svn/clamav-devel/branches/clamd-proto@4697 77e5149b-7576-45b1-b177-96237e5ba77b
0.95
Török Edvin 17 years ago
parent 869d03832d
commit 07ac8bb23a
  1. 5
      ChangeLog
  2. 4
      clamd/server-th.c
  3. 7
      clamd/session.c

@ -1,3 +1,8 @@
Sat Feb 7 19:00:48 EET 2009 (edwin)
------------------------------------
* clamd/server-th.c, clamd/session.c: also remove socket from
tracked sockets after switching mode to WAITREPLY.
Sat Feb 7 18:54:54 EET 2009 (edwin)
------------------------------------
* clamd/server-th.c: add proto debug messages to LogVerbose

@ -856,18 +856,18 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
}
error = 1;
}
if (error || !conn.group) {
if (error || !conn.group || rc) {
if (rc && thrmgr_group_finished(conn.group, EXIT_OK)) {
logg("*RECVTH: closing conn, group finished\n");
/* if there are no more active jobs */
shutdown(conn.sd, 2);
closesocket(conn.sd);
buf->fd = -1;
} else {
logg("*RECVTH: mode -> MODE_WAITREPLY\n");
/* no more commands are accepted */
conn.mode = MODE_WAITREPLY;
}
buf->fd = -1;
}
pos += cmdlen+1;
if (conn.mode == MODE_STREAM) {

@ -462,11 +462,8 @@ int execute_or_dispatch_command(client_conn_t *conn, enum commands cmd, const ch
conn_reply_single(conn, NULL, "UNKNOWN COMMAND");
return 1;
}
if (thrmgr_group_finished(conn->group, EXIT_OK)) {
/* need to close connection if we were last in group */
return 1;
}
return 0;
/* need to close connection if we were last in group */
return 1;
/*case COMMAND_UNKNOWN:*/
default:
conn_reply_single(conn, NULL, "UNKNOWN COMMAND");

Loading…
Cancel
Save