git-svn: trunk@1047
remotes/push_mirror/metadata
Nigel Horne 21 years ago
parent f2a2360337
commit 4ec64d5716
  1. 23
      clamav-devel/clamav-milter/clamav-milter.c

@ -26,6 +26,9 @@
* *
* Change History: * Change History:
* $Log: clamav-milter.c,v $ * $Log: clamav-milter.c,v $
* Revision 1.146 2004/10/30 07:01:55 nigelhorne
* Tidy
*
* Revision 1.145 2004/10/30 06:49:08 nigelhorne * Revision 1.145 2004/10/30 06:49:08 nigelhorne
* Fix crash when a server can't be contacted * Fix crash when a server can't be contacted
* *
@ -446,7 +449,7 @@
* Revision 1.6 2003/09/28 16:37:23 nigelhorne * Revision 1.6 2003/09/28 16:37:23 nigelhorne
* Added -f flag use MaxThreads if --max-children not set * Added -f flag use MaxThreads if --max-children not set
*/ */
static char const rcsid[] = "$Id: clamav-milter.c,v 1.145 2004/10/30 06:49:08 nigelhorne Exp $"; static char const rcsid[] = "$Id: clamav-milter.c,v 1.146 2004/10/30 07:01:55 nigelhorne Exp $";
#define CM_VERSION "0.80n" #define CM_VERSION "0.80n"
@ -1643,8 +1646,10 @@ createSession(int session)
char *hostname = cli_strtok(serverHostNames, serverNumber, ":"); char *hostname = cli_strtok(serverHostNames, serverNumber, ":");
#endif #endif
if(cmdSockets[session] >= 0) if(cmdSockets[session] >= 0) {
close(cmdSockets[session]); close(cmdSockets[session]);
cmdSockets[session] = -1;
}
cli_warnmsg(_("Check clamd server %s - it may be down\n"), hostname); cli_warnmsg(_("Check clamd server %s - it may be down\n"), hostname);
#ifndef MAXHOSTNAMELEN #ifndef MAXHOSTNAMELEN
@ -3577,12 +3582,12 @@ connect2clamd(struct privdata *privdata)
#else #else
syslog(LOG_ERR, _("Failed to connect to port %d given by clamd: %s"), p, strerror(errno)); syslog(LOG_ERR, _("Failed to connect to port %d given by clamd: %s"), p, strerror(errno));
#endif #endif
}
#ifdef SESSION #ifdef SESSION
pthread_mutex_lock(&sstatus_mutex); pthread_mutex_lock(&sstatus_mutex);
cmdSocketsStatus[privdata->serverNumber] = CMDSOCKET_DOWN; cmdSocketsStatus[privdata->serverNumber] = CMDSOCKET_DOWN;
pthread_mutex_unlock(&sstatus_mutex); pthread_mutex_unlock(&sstatus_mutex);
#endif #endif
}
return 0; return 0;
} }
} }
@ -4069,8 +4074,10 @@ watchdog(void *a)
* The END command probably won't get through, * The END command probably won't get through,
* but let's give it a go anyway * but let's give it a go anyway
*/ */
send(sock, "END\n", 4, 0); if(sock >= 0) {
close(sock); send(sock, "END\n", 4, 0);
close(sock);
}
cli_dbgmsg("Trying to restart session %d\n", i); cli_dbgmsg("Trying to restart session %d\n", i);
if(createSession(i) == 0) { if(createSession(i) == 0) {

Loading…
Cancel
Save