/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
+ * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "ngircd.h"
#include "array.h"
#include "client.h"
+#include "class.h"
#include "conf.h"
#include "conn-ssl.h"
#include "conn-zip.h"
/**
- * Initialite connecion module.
+ * Initialize connecion module.
*/
GLOBAL void
Conn_Init( void )
* they don't hold connections open that the main process wants to close.
*/
GLOBAL void
-Conn_CloseAllSockets(void)
+Conn_CloseAllSockets(int ExceptOf)
{
CONN_ID idx;
for(idx = 0; idx < Pool_Size; idx++) {
- if(My_Connections[idx].sock > NONE)
+ if(My_Connections[idx].sock > NONE &&
+ My_Connections[idx].sock != ExceptOf)
close(My_Connections[idx].sock);
}
}
Check_Servers();
Check_Connections();
+ /* Expire outdated class/list items */
+ Class_Expire();
+
/* Look for non-empty read buffers ... */
for (i = 0; i < Pool_Size; i++) {
if ((My_Connections[i].sock > NONE)
GLOBAL void
Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClient )
{
- /* Close connection. Open pipes of asyncronous resolver
+ /* Close connection. Open pipes of asynchronous resolver
* sub-processes are closed down. */
CLIENT *c;
if (!array_catb(&My_Connections[Idx].zip.rbuf, readbuf,
(size_t) len)) {
Log(LOG_ERR,
- "Could not append recieved data to zip input buffer (connn %d): %d bytes!",
+ "Could not append recieved data to zip input buffer (connection %d): %d bytes!",
Idx, len);
Conn_Close(Idx, "Receive buffer space exhausted", NULL,
false);
#endif
{
if (!array_catb( &My_Connections[Idx].rbuf, readbuf, len)) {
- Log( LOG_ERR, "Could not append recieved data to input buffer (connn %d): %d bytes!", Idx, len );
+ Log(LOG_ERR,
+ "Could not append recieved data to input buffer (connection %d): %d bytes!",
+ Idx, len);
Conn_Close(Idx, "Receive buffer space exhausted", NULL, false );
}
}
/* Read result from pipe */
len = Proc_Read(&Conf_Server[i].res_stat, dest_addrs, sizeof(dest_addrs));
+ Proc_Close(&Conf_Server[i].res_stat);
if (len == 0) {
/* Error resolving hostname: reset server structure */
Conf_Server[i].conn_id = NONE;
/* Read result from pipe */
len = Proc_Read(&My_Connections[i].proc_stat, readbuf, sizeof readbuf -1);
+ Proc_Close(&My_Connections[i].proc_stat);
if (len == 0)
return;