mirror of
https://github.com/osmarks/ngircd.git
synced 2025-10-14 14:17:38 +00:00
Compare commits
16 Commits
rel-16-rc1
...
rel-16
Author | SHA1 | Date | |
---|---|---|---|
![]() |
defd7e09af | ||
![]() |
29d448ed63 | ||
![]() |
bdec5ac1f3 | ||
![]() |
73fd26e9fa | ||
![]() |
79e1ec2b1e | ||
![]() |
615d09459e | ||
![]() |
1338ade650 | ||
![]() |
21140500f1 | ||
![]() |
77ceb9f8ab | ||
![]() |
b042363e88 | ||
![]() |
6b0bb665c3 | ||
![]() |
1caa3fb94b | ||
![]() |
025342fe46 | ||
![]() |
628c6c962b | ||
![]() |
1ed49de83a | ||
![]() |
bb914b93e9 |
18
ChangeLog
18
ChangeLog
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
ngIRCd - Next Generation IRC Server
|
ngIRCd - Next Generation IRC Server
|
||||||
|
|
||||||
(c)2001-2009 Alexander Barton,
|
(c)2001-2010 Alexander Barton,
|
||||||
alex@barton.de, http://www.barton.de/
|
alex@barton.de, http://www.barton.de/
|
||||||
|
|
||||||
ngIRCd is free software and published under the
|
ngIRCd is free software and published under the
|
||||||
@@ -10,7 +10,21 @@
|
|||||||
-- ChangeLog --
|
-- ChangeLog --
|
||||||
|
|
||||||
|
|
||||||
ngIRCd Release 16
|
ngIRCd Release 16 (2010-05-02)
|
||||||
|
|
||||||
|
- doc/SSL: remove line continuation marker
|
||||||
|
|
||||||
|
ngIRCd 16~rc2 (2010-04-25)
|
||||||
|
- Updated some more copyright notices, it's 2010 already :-)
|
||||||
|
- Only compile in Get_Error() if really needed
|
||||||
|
- Fix gcc warning "ignoring return value of ..."
|
||||||
|
- Include netinet/in_systm.h alongside netinet/ip.h
|
||||||
|
- Include netinet/{in.h, in_systm.h} when checking for netinet/ip.h
|
||||||
|
- Only include <netinet/in_systm.h> if it exists
|
||||||
|
- Updated doc/Platforms.txt
|
||||||
|
- Enhace connection statistics counters: display total number of served
|
||||||
|
connections on daemon shutdown and when a new client connects using
|
||||||
|
the new numeric RPL_STATSCONN (250).
|
||||||
|
|
||||||
ngIRCd 16~rc1 (2010-03-25)
|
ngIRCd 16~rc1 (2010-03-25)
|
||||||
- Various fixes to the build system and code cleanups.
|
- Various fixes to the build system and code cleanups.
|
||||||
|
7
NEWS
7
NEWS
@@ -10,7 +10,12 @@
|
|||||||
-- NEWS --
|
-- NEWS --
|
||||||
|
|
||||||
|
|
||||||
ngIRCd Release 16
|
ngIRCd Release 16 (2010-05-02)
|
||||||
|
|
||||||
|
ngIRCd 16~rc2 (2010-04-25)
|
||||||
|
- Enhace connection statistics counters: display total number of served
|
||||||
|
connections on daemon shutdown and when a new client connects using
|
||||||
|
the new numeric RPL_STATSCONN (250).
|
||||||
|
|
||||||
ngIRCd 16~rc1 (2010-03-25)
|
ngIRCd 16~rc1 (2010-03-25)
|
||||||
- Implement WEBIRC command used by some Web-IRC frontends. The password
|
- Implement WEBIRC command used by some Web-IRC frontends. The password
|
||||||
|
15
configure.in
15
configure.in
@@ -12,7 +12,7 @@
|
|||||||
# -- Initialisation --
|
# -- Initialisation --
|
||||||
|
|
||||||
AC_PREREQ(2.50)
|
AC_PREREQ(2.50)
|
||||||
AC_INIT(ngircd, 16~rc1)
|
AC_INIT(ngircd, 16)
|
||||||
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
|
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
|
||||||
AC_CANONICAL_TARGET
|
AC_CANONICAL_TARGET
|
||||||
AM_INIT_AUTOMAKE(1.6)
|
AM_INIT_AUTOMAKE(1.6)
|
||||||
@@ -101,12 +101,19 @@ AC_HEADER_TIME
|
|||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
|
|
||||||
AC_CHECK_HEADERS([ \
|
AC_CHECK_HEADERS([ \
|
||||||
ctype.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h string.h \
|
ctype.h errno.h fcntl.h netdb.h netinet/in.h netinet/in_systm.h \
|
||||||
strings.h sys/socket.h sys/time.h unistd.h \
|
stdlib.h string.h strings.h sys/socket.h sys/time.h unistd.h \
|
||||||
],,AC_MSG_ERROR([required C header missing!]))
|
],,AC_MSG_ERROR([required C header missing!]))
|
||||||
|
|
||||||
AC_CHECK_HEADERS([ \
|
AC_CHECK_HEADERS([ \
|
||||||
arpa/inet.h ctype.h malloc.h netinet/ip.h stdbool.h stddef.h varargs.h])
|
arpa/inet.h ctype.h malloc.h netinet/ip.h stdbool.h stddef.h varargs.h \
|
||||||
|
],[],[],[[
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#ifdef HAVE_NETINET_IN_SYSTM_H
|
||||||
|
#include <netinet/in_systm.h>
|
||||||
|
#endif
|
||||||
|
]]
|
||||||
|
)
|
||||||
|
|
||||||
# -- Datatypes --
|
# -- Datatypes --
|
||||||
|
|
||||||
|
@@ -1,8 +1,20 @@
|
|||||||
|
ngircd (16-0ab1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New "upstream" release: ngIRCd 16.
|
||||||
|
|
||||||
|
-- Alexander Barton <alex@barton.de> Sun, 02 May 2010 13:32:41 +0200
|
||||||
|
|
||||||
|
ngircd (16~rc2-0ab1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New "upstream" release candidate 2 for ngIRCd Release 16.
|
||||||
|
|
||||||
|
-- Alexander Barton <alex@barton.de> Sun, 25 Apr 2010 13:12:42 +0200
|
||||||
|
|
||||||
ngircd (16~rc1-0ab1) unstable; urgency=low
|
ngircd (16~rc1-0ab1) unstable; urgency=low
|
||||||
|
|
||||||
* New "upstream" release candidate 1 for ngIRCd Release 16.
|
* New "upstream" release candidate 1 for ngIRCd Release 16.
|
||||||
|
|
||||||
-- Alexander Barton <alex@barton.de> Thu, 25 Mar 2010 15:56:03 +0100
|
-- Alexander Barton <alex@barton.de> Thu, 25 Mar 2010 15:56:03 +0200
|
||||||
|
|
||||||
ngircd (15-0ab1) unstable; urgency=low
|
ngircd (15-0ab1) unstable; urgency=low
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
|
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural
|
||||||
|
|
||||||
\f0\i\fs24 \cf0 ngIRCd -- The Next Generation IRC Daemon\
|
\f0\i\fs24 \cf0 ngIRCd -- The Next Generation IRC Daemon\
|
||||||
Copyright (c)2001-2009 Alexander Barton and Contributors.\
|
Copyright (c)2001-2010 Alexander Barton and Contributors.\
|
||||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
|
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
|
||||||
|
|
||||||
\i0 \cf0 \
|
\i0 \cf0 \
|
||||||
@@ -187,4 +187,4 @@ To disable automatic starting of ngIRCd, use this command:\
|
|||||||
\ls2\ilvl0
|
\ls2\ilvl0
|
||||||
\f1\fs24 \cf0 sudo launchctl unload -w \\\
|
\f1\fs24 \cf0 sudo launchctl unload -w \\\
|
||||||
/Library/LaunchDaemons/de.barton.ngircd.plist\
|
/Library/LaunchDaemons/de.barton.ngircd.plist\
|
||||||
}]]></resource></locale></resources><flags/><item type="file">01ngircd.xml</item><item type="file">02de.xml</item><mod>properties.customizeOption</mod><mod>properties.title</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
|
}]]></resource></locale></resources><flags/><item type="file">01ngircd.xml</item><item type="file">02de.xml</item><mod>properties.customizeOption</mod><mod>properties.title</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
%define name ngircd
|
%define name ngircd
|
||||||
%define version 16~rc1
|
%define version 16
|
||||||
%define release 1
|
%define release 1
|
||||||
%define prefix %{_prefix}
|
%define prefix %{_prefix}
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
ngIRCd - Next Generation IRC Server
|
ngIRCd - Next Generation IRC Server
|
||||||
|
|
||||||
(c)2001-2009 Alexander Barton
|
(c)2001-2010 Alexander Barton
|
||||||
alex@barton.de, http://www.barton.de/
|
alex@barton.de, http://www.barton.de/
|
||||||
|
|
||||||
ngIRCd is free software and published under the
|
ngIRCd is free software and published under the
|
||||||
@@ -32,23 +32,24 @@ hppa1.1/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
|
|||||||
hppa2.0/unknown/linux-gnu gcc 3.3.5 13~rc1 08-12-02 alex Y Y Y Y
|
hppa2.0/unknown/linux-gnu gcc 3.3.5 13~rc1 08-12-02 alex Y Y Y Y
|
||||||
hppa2.0w-hp-hpux11.11 gcc 4.2.3 14.1 09-07-22 goetz Y Y Y Y
|
hppa2.0w-hp-hpux11.11 gcc 4.2.3 14.1 09-07-22 goetz Y Y Y Y
|
||||||
i386/apple/darwin9.7.0 gcc 4.0.1 14.1 09-08-04 alex Y Y Y Y (3)
|
i386/apple/darwin9.7.0 gcc 4.0.1 14.1 09-08-04 alex Y Y Y Y (3)
|
||||||
i386/apple/darwin10.0.0b2 gcc 4.2.1 14.1 09-07-27 alex Y Y Y Y (3)
|
i386/apple/darwin10.3.0 gcc 4.2.1 16 10-04-23 alex Y Y Y Y (3)
|
||||||
i386/pc/solaris2.9 gcc 3.2.2 CVSHEAD 04-02-24 alex Y Y Y Y
|
i386/pc/solaris2.9 gcc 3.2.2 CVSHEAD 04-02-24 alex Y Y Y Y
|
||||||
i386/pc/solaris2.11 gcc 3.4.3 14.1 09-08-03 alex Y Y Y Y (4)
|
i386/pc/solaris2.11 gcc 3.4.3 14.1 09-08-03 alex Y Y Y Y (4)
|
||||||
i386/unknown/freebsd5.2.1 gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
|
i386/unknown/freebsd5.2.1 gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||||
i386/unknown/freebsd6.0 gcc 3.4.4 0.10.0-p1 06-08-04 alex Y Y Y Y (3)
|
i386/unknown/freebsd6.0 gcc 3.4.4 0.10.0-p1 06-08-04 alex Y Y Y Y (3)
|
||||||
i386/unknown/freebsd6.1 gcc 3.4.4 CVSHEAD 06-05-07 fw Y Y Y Y (3)
|
i386/unknown/freebsd6.1 gcc 3.4.4 CVSHEAD 06-05-07 fw Y Y Y Y (3)
|
||||||
i386/unknown/freebsd6.2 gcc 3.4.6 14.1 09-07-27 alex Y Y Y Y (3)
|
i386/unknown/freebsd6.2 gcc 3.4.6 16 10-04-11 alex Y Y Y Y (3)
|
||||||
i386/unknown/freebsd7.0 gcc 4.2.1 14.1 09-07-28 alex Y Y Y Y (3)
|
i386/unknown/freebsd7.0 gcc 4.2.1 14.1 09-07-28 alex Y Y Y Y (3)
|
||||||
i386/unknown/freebsd7.2 gcc 4.2.1 14.1 09-08-03 alex Y Y Y Y (3)
|
i386/unknown/freebsd7.2 gcc 4.2.1 14.1 09-08-03 alex Y Y Y Y (3)
|
||||||
|
i386/unknown/freebsd7.3 gcc 4.2.1 16 10-04-11 alex Y Y Y Y (3)
|
||||||
i386/unknown/gnu0.3 gcc 3.3.3 0.8.0 04-05-30 alex Y Y n Y
|
i386/unknown/gnu0.3 gcc 3.3.3 0.8.0 04-05-30 alex Y Y n Y
|
||||||
i686/unknown/gnu0.3 gcc 4.3.1 14.1 09-07-28 alex Y Y Y Y
|
i686/unknown/gnu0.3 gcc 4.3.1 14.1 09-07-28 alex Y Y Y Y
|
||||||
i686/unkn./kfreebsd7.2-gnu gcc 4.3.4 15 09-12-02 alex Y Y Y Y (3)
|
i686/unkn./kfreebsd7.2-gnu gcc 4.3.4 15 09-12-02 alex Y Y Y Y (3)
|
||||||
i386/unknown/netbsdelf1.6.1 gcc 2.95.3 CVSHEAD 04-02-24 alex Y Y Y Y
|
i386/unknown/netbsdelf1.6.1 gcc 2.95.3 CVSHEAD 04-02-24 alex Y Y Y Y
|
||||||
i386/unknown/netbsdelf3.0.1 gcc 3.3.3 0.10.0-p1 06-08-30 alex Y Y Y Y (3)
|
i386/unknown/netbsdelf3.0.1 gcc 3.3.3 0.10.0-p1 06-08-30 alex Y Y Y Y (3)
|
||||||
i386/unknown/netbsdelf4.0 gcc 4.1.2 14.1 09-07-28 alex Y Y Y Y (3)
|
i386/unknown/netbsdelf4.0 gcc 4.1.2 16 10-04-11 alex Y Y Y Y (3)
|
||||||
i386/unknown/openbsd3.9 gcc 3.3.5 0.10.0-p1 06-08-30 alex Y Y Y Y (3)
|
i386/unknown/openbsd3.9 gcc 3.3.5 0.10.0-p1 06-08-30 alex Y Y Y Y (3)
|
||||||
i386/unknown/openbsd4.1 gcc 3.3.5 14.1 09-07-28 alex Y Y Y Y (3)
|
i386/unknown/openbsd4.1 gcc 3.3.5 16 10-04-11 alex Y Y Y Y (3)
|
||||||
i586/pc/interix3.5 gcc 3.3 15 10-01-22 alex Y Y N Y
|
i586/pc/interix3.5 gcc 3.3 15 10-01-22 alex Y Y N Y
|
||||||
i686/pc/cygwin gcc 3.3.1 0.8.0 04-05-30 alex Y Y n Y
|
i686/pc/cygwin gcc 3.3.1 0.8.0 04-05-30 alex Y Y n Y
|
||||||
i686/pc/linux-gnu gcc 2.95.4 0.8.0 04-05-30 alex Y Y Y Y (1)
|
i686/pc/linux-gnu gcc 2.95.4 0.8.0 04-05-30 alex Y Y Y Y (1)
|
||||||
@@ -67,7 +68,8 @@ powerpc/unknown/openbsd3.6 gcc 2.95.3 0.10.0 06-10-08 alex Y Y n Y
|
|||||||
sparc/sun/solaris2.6 gcc 2.95.3 0.7.x-CVS 03-04-22 alex Y Y Y Y
|
sparc/sun/solaris2.6 gcc 2.95.3 0.7.x-CVS 03-04-22 alex Y Y Y Y
|
||||||
sparc/sun/solaris2.7 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
|
sparc/sun/solaris2.7 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||||
sparc/unkn./netbsdelf1.6.1 gcc 2.95.3 0.8.0 04-05-30 alex Y Y Y Y
|
sparc/unkn./netbsdelf1.6.1 gcc 2.95.3 0.8.0 04-05-30 alex Y Y Y Y
|
||||||
x86_64/unknown/linux-gnu gcc 4.3.2 14.1 09-08-04 alex Y Y Y Y (1)
|
x86_64/unknown/freebsd8.0 gcc 4.2.1 16 10-04-23 alex Y Y Y Y (3)
|
||||||
|
x86_64/unknown/linux-gnu gcc 4.3.2 16 10-04-23 alex Y Y Y Y (1)
|
||||||
|
|
||||||
|
|
||||||
Notes
|
Notes
|
||||||
|
@@ -49,8 +49,7 @@ Creating a self-signed certificate
|
|||||||
OpenSSL:
|
OpenSSL:
|
||||||
|
|
||||||
Creating a self-signed certificate and key:
|
Creating a self-signed certificate and key:
|
||||||
$ openssl req -newkey rsa:2048 -x509 -keyout server-key.pem \
|
$ openssl req -newkey rsa:2048 -x509 -keyout server-key.pem -out server-cert.pem -days 1461
|
||||||
-out server-cert.pem -days 1461
|
|
||||||
Create DH parameters (optional):
|
Create DH parameters (optional):
|
||||||
$ openssl dhparam -2 -out dhparams.pem 2048
|
$ openssl dhparam -2 -out dhparams.pem 2048
|
||||||
|
|
||||||
@@ -58,8 +57,7 @@ GnuTLS:
|
|||||||
|
|
||||||
Creating a self-signed certificate and key:
|
Creating a self-signed certificate and key:
|
||||||
$ certtool --generate-privkey --bits 2048 --outfile server-key.pem
|
$ certtool --generate-privkey --bits 2048 --outfile server-key.pem
|
||||||
$ certtool --generate-self-signed --load-privkey server-key.pem \
|
$ certtool --generate-self-signed --load-privkey server-key.pem --outfile server-cert.pem
|
||||||
--outfile server-cert.pem
|
|
||||||
Create DH parameters (optional):
|
Create DH parameters (optional):
|
||||||
$ certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
|
$ certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ngIRCd -- The Next Generation IRC Daemon
|
* ngIRCd -- The Next Generation IRC Daemon
|
||||||
* Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
|
* Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -37,6 +37,9 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#ifdef HAVE_NETINET_IP_H
|
#ifdef HAVE_NETINET_IP_H
|
||||||
|
# ifdef HAVE_NETINET_IN_SYSTM_H
|
||||||
|
# include <netinet/in_systm.h>
|
||||||
|
# endif
|
||||||
# include <netinet/ip.h>
|
# include <netinet/ip.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -92,10 +95,12 @@ static bool Init_Socket PARAMS(( int Sock ));
|
|||||||
static void New_Server PARAMS(( int Server, ng_ipaddr_t *dest ));
|
static void New_Server PARAMS(( int Server, ng_ipaddr_t *dest ));
|
||||||
static void Simple_Message PARAMS(( int Sock, const char *Msg ));
|
static void Simple_Message PARAMS(( int Sock, const char *Msg ));
|
||||||
static int NewListener PARAMS(( const char *listen_addr, UINT16 Port ));
|
static int NewListener PARAMS(( const char *listen_addr, UINT16 Port ));
|
||||||
|
static void Account_Connection PARAMS((void));
|
||||||
|
|
||||||
|
|
||||||
static array My_Listeners;
|
static array My_Listeners;
|
||||||
static array My_ConnArray;
|
static array My_ConnArray;
|
||||||
static size_t NumConnections;
|
static size_t NumConnections, NumConnectionsMax, NumConnectionsAccepted;
|
||||||
|
|
||||||
#ifdef TCPWRAP
|
#ifdef TCPWRAP
|
||||||
int allow_severity = LOG_INFO;
|
int allow_severity = LOG_INFO;
|
||||||
@@ -366,8 +371,8 @@ Conn_Init( void )
|
|||||||
Pool_Size = Conf_MaxConnections;
|
Pool_Size = Conf_MaxConnections;
|
||||||
|
|
||||||
if (!array_alloc(&My_ConnArray, sizeof(CONNECTION), (size_t)Pool_Size)) {
|
if (!array_alloc(&My_ConnArray, sizeof(CONNECTION), (size_t)Pool_Size)) {
|
||||||
Log( LOG_EMERG, "Can't allocate memory! [Conn_Init]" );
|
Log(LOG_EMERG, "Can't allocate memory! [Conn_Init]");
|
||||||
exit( 1 );
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: My_Connetions/Pool_Size is needed by other parts of the
|
/* FIXME: My_Connetions/Pool_Size is needed by other parts of the
|
||||||
@@ -375,17 +380,15 @@ Conn_Init( void )
|
|||||||
My_Connections = (CONNECTION*) array_start(&My_ConnArray);
|
My_Connections = (CONNECTION*) array_start(&My_ConnArray);
|
||||||
|
|
||||||
LogDebug("Allocated connection pool for %d items (%ld bytes).",
|
LogDebug("Allocated connection pool for %d items (%ld bytes).",
|
||||||
array_length(&My_ConnArray, sizeof( CONNECTION )), array_bytes(&My_ConnArray));
|
array_length(&My_ConnArray, sizeof(CONNECTION)),
|
||||||
|
array_bytes(&My_ConnArray));
|
||||||
|
|
||||||
assert( array_length(&My_ConnArray, sizeof( CONNECTION )) >= (size_t) Pool_Size);
|
assert(array_length(&My_ConnArray, sizeof(CONNECTION)) >= (size_t)Pool_Size);
|
||||||
|
|
||||||
array_free( &My_Listeners );
|
array_free( &My_Listeners );
|
||||||
|
|
||||||
/* Connection-Struktur initialisieren */
|
for (i = 0; i < Pool_Size; i++)
|
||||||
for( i = 0; i < Pool_Size; i++ ) Init_Conn_Struct( i );
|
Init_Conn_Struct(i);
|
||||||
|
|
||||||
/* Global write counter */
|
|
||||||
WCounter = 0;
|
|
||||||
} /* Conn_Init */
|
} /* Conn_Init */
|
||||||
|
|
||||||
|
|
||||||
@@ -1098,6 +1101,27 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
|
|||||||
} /* Conn_Close */
|
} /* Conn_Close */
|
||||||
|
|
||||||
|
|
||||||
|
GLOBAL long
|
||||||
|
Conn_Count(void)
|
||||||
|
{
|
||||||
|
return NumConnections;
|
||||||
|
} /* Conn_Count */
|
||||||
|
|
||||||
|
|
||||||
|
GLOBAL long
|
||||||
|
Conn_CountMax(void)
|
||||||
|
{
|
||||||
|
return NumConnectionsMax;
|
||||||
|
} /* Conn_CountMax */
|
||||||
|
|
||||||
|
|
||||||
|
GLOBAL long
|
||||||
|
Conn_CountAccepted(void)
|
||||||
|
{
|
||||||
|
return NumConnectionsAccepted;
|
||||||
|
} /* Conn_CountAccepted */
|
||||||
|
|
||||||
|
|
||||||
GLOBAL void
|
GLOBAL void
|
||||||
Conn_SyncServerStruct( void )
|
Conn_SyncServerStruct( void )
|
||||||
{
|
{
|
||||||
@@ -1238,6 +1262,7 @@ New_Connection(int Sock)
|
|||||||
Log(LOG_CRIT, "Can't accept connection: %s!", strerror(errno));
|
Log(LOG_CRIT, "Can't accept connection: %s!", strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
NumConnectionsAccepted++;
|
||||||
|
|
||||||
if (!ng_ipaddr_tostr_r(&new_addr, ip_str)) {
|
if (!ng_ipaddr_tostr_r(&new_addr, ip_str)) {
|
||||||
Log(LOG_CRIT, "fd %d: Can't convert IP address!", new_sock);
|
Log(LOG_CRIT, "fd %d: Can't convert IP address!", new_sock);
|
||||||
@@ -1357,12 +1382,22 @@ New_Connection(int Sock)
|
|||||||
* If there are results earlier, the delay is aborted. */
|
* If there are results earlier, the delay is aborted. */
|
||||||
Conn_SetPenalty(new_sock, 4);
|
Conn_SetPenalty(new_sock, 4);
|
||||||
|
|
||||||
NumConnections++;
|
Account_Connection();
|
||||||
LogDebug("Total number of connections now %ld.", NumConnections);
|
|
||||||
return new_sock;
|
return new_sock;
|
||||||
} /* New_Connection */
|
} /* New_Connection */
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
Account_Connection(void)
|
||||||
|
{
|
||||||
|
NumConnections++;
|
||||||
|
if (NumConnections > NumConnectionsMax)
|
||||||
|
NumConnectionsMax = NumConnections;
|
||||||
|
LogDebug("Total number of connections now %lu (max %lu).",
|
||||||
|
NumConnections, NumConnectionsMax);
|
||||||
|
} /* Account_Connection */
|
||||||
|
|
||||||
|
|
||||||
static CONN_ID
|
static CONN_ID
|
||||||
Socket2Index( int Sock )
|
Socket2Index( int Sock )
|
||||||
{
|
{
|
||||||
@@ -1802,7 +1837,7 @@ New_Server( int Server , ng_ipaddr_t *dest)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Conn_Close() decrements this counter again */
|
/* Conn_Close() decrements this counter again */
|
||||||
NumConnections++;
|
Account_Connection();
|
||||||
Client_SetIntroducer( c, c );
|
Client_SetIntroducer( c, c );
|
||||||
Client_SetToken( c, TOKEN_OUTBOUND );
|
Client_SetToken( c, TOKEN_OUTBOUND );
|
||||||
|
|
||||||
@@ -2025,20 +2060,32 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
|
|||||||
} /* cb_Read_Resolver_Result */
|
} /* cb_Read_Resolver_Result */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write a "simple" (error) message to a socket.
|
||||||
|
* The message is sent without using the connection write buffers, without
|
||||||
|
* compression/encryption, and even without any error reporting. It is
|
||||||
|
* designed for error messages of e.g. New_Connection(). */
|
||||||
static void
|
static void
|
||||||
Simple_Message( int Sock, const char *Msg )
|
Simple_Message(int Sock, const char *Msg)
|
||||||
{
|
{
|
||||||
char buf[COMMAND_LEN];
|
char buf[COMMAND_LEN];
|
||||||
size_t len;
|
size_t len;
|
||||||
/* Write "simple" message to socket, without using compression
|
|
||||||
* or even the connection write buffers. Used e.g. for error
|
|
||||||
* messages by New_Connection(). */
|
|
||||||
assert( Sock > NONE );
|
|
||||||
assert( Msg != NULL );
|
|
||||||
|
|
||||||
strlcpy( buf, Msg, sizeof buf - 2);
|
assert(Sock > NONE);
|
||||||
len = strlcat( buf, "\r\n", sizeof buf);
|
assert(Msg != NULL);
|
||||||
(void)write(Sock, buf, len);
|
|
||||||
|
strlcpy(buf, Msg, sizeof buf - 2);
|
||||||
|
len = strlcat(buf, "\r\n", sizeof buf);
|
||||||
|
if (write(Sock, buf, len) < 0) {
|
||||||
|
/* Because this function most probably got called to log
|
||||||
|
* an error message, any write error is ignored here to
|
||||||
|
* avoid an endless loop. But casting the result of write()
|
||||||
|
* to "void" doesn't satisfy the GNU C code attribute
|
||||||
|
* "warn_unused_result" which is used by some versions of
|
||||||
|
* glibc (e.g. 2.11.1), therefore this silly error
|
||||||
|
* "handling" code here :-( */
|
||||||
|
return;
|
||||||
|
}
|
||||||
} /* Simple_Error */
|
} /* Simple_Error */
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ngIRCd -- The Next Generation IRC Daemon
|
* ngIRCd -- The Next Generation IRC Daemon
|
||||||
* Copyright (c)2001-2009 by Alexander Barton (alex@barton.de)
|
* Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -122,5 +122,9 @@ static inline bool Conn_UsesSSL(UNUSED CONN_ID Idx) { return false; }
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
GLOBAL long Conn_Count PARAMS((void));
|
||||||
|
GLOBAL long Conn_CountMax PARAMS((void));
|
||||||
|
GLOBAL long Conn_CountAccepted PARAMS((void));
|
||||||
|
|
||||||
|
|
||||||
/* -eof- */
|
/* -eof- */
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ngIRCd -- The Next Generation IRC Daemon
|
* ngIRCd -- The Next Generation IRC Daemon
|
||||||
* Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
|
* Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -1176,6 +1176,10 @@ IRC_Send_LUSERS( CLIENT *Client )
|
|||||||
if(! IRC_WriteStrClient(Client, RPL_NETUSERS_MSG, Client_ID(Client),
|
if(! IRC_WriteStrClient(Client, RPL_NETUSERS_MSG, Client_ID(Client),
|
||||||
cnt, max, cnt, max))
|
cnt, max, cnt, max))
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
|
/* Connection counters */
|
||||||
|
if (! IRC_WriteStrClient(Client, RPL_STATSCONN_MSG, Client_ID(Client),
|
||||||
|
Conn_CountMax(), Conn_CountAccepted()))
|
||||||
|
return DISCONNECTED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
|
@@ -146,8 +146,8 @@ GLOBAL void
|
|||||||
Log_Exit( void )
|
Log_Exit( void )
|
||||||
{
|
{
|
||||||
/* Good Bye! */
|
/* Good Bye! */
|
||||||
if( NGIRCd_SignalRestart ) Log( LOG_NOTICE, "%s done (restarting).", PACKAGE_NAME );
|
Log(LOG_NOTICE, "%s done%s, served %lu connections.", PACKAGE_NAME,
|
||||||
else Log( LOG_NOTICE, "%s done.", PACKAGE_NAME );
|
NGIRCd_SignalRestart ? " (restarting)" : "", Conn_CountAccepted());
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if( Error_File[0] )
|
if( Error_File[0] )
|
||||||
|
@@ -46,6 +46,7 @@
|
|||||||
#define RPL_TRACEEND_MSG "262 %s %s %s-%s.%s :End of TRACE"
|
#define RPL_TRACEEND_MSG "262 %s %s %s-%s.%s :End of TRACE"
|
||||||
#define RPL_LOCALUSERS_MSG "265 %s %lu %lu :Current local users: %lu, Max: %lu"
|
#define RPL_LOCALUSERS_MSG "265 %s %lu %lu :Current local users: %lu, Max: %lu"
|
||||||
#define RPL_NETUSERS_MSG "266 %s %lu %lu :Current global users: %lu, Max: %lu"
|
#define RPL_NETUSERS_MSG "266 %s %lu %lu :Current global users: %lu, Max: %lu"
|
||||||
|
#define RPL_STATSCONN_MSG "250 %s :Highest connection count: %lu (%lu connections received)"
|
||||||
|
|
||||||
#define RPL_AWAY_MSG "301 %s %s :%s"
|
#define RPL_AWAY_MSG "301 %s %s :%s"
|
||||||
#define RPL_USERHOST_MSG "302 %s :"
|
#define RPL_USERHOST_MSG "302 %s :"
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* ngIRCd -- The Next Generation IRC Daemon
|
* ngIRCd -- The Next Generation IRC Daemon
|
||||||
* Copyright (c)2001-2009 Alexander Barton (alex@barton.de).
|
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de).
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -562,7 +562,7 @@ static void
|
|||||||
Show_Version( void )
|
Show_Version( void )
|
||||||
{
|
{
|
||||||
puts( NGIRCd_Version );
|
puts( NGIRCd_Version );
|
||||||
puts( "Copyright (c)2001-2009 Alexander Barton (<alex@barton.de>) and Contributors." );
|
puts( "Copyright (c)2001-2010 Alexander Barton (<alex@barton.de>) and Contributors." );
|
||||||
puts( "Homepage: <http://ngircd.barton.de/>\n" );
|
puts( "Homepage: <http://ngircd.barton.de/>\n" );
|
||||||
puts( "This is free software; see the source for copying conditions. There is NO" );
|
puts( "This is free software; see the source for copying conditions. There is NO" );
|
||||||
puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." );
|
puts( "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." );
|
||||||
@@ -798,7 +798,9 @@ NGIRCd_Init( bool NGIRCd_NoDaemon )
|
|||||||
#else
|
#else
|
||||||
setpgrp(0, getpid());
|
setpgrp(0, getpid());
|
||||||
#endif
|
#endif
|
||||||
chdir( "/" );
|
if (chdir( "/" ) != 0)
|
||||||
|
Log(LOG_ERR, "Can't change directory to '/': %s",
|
||||||
|
strerror(errno));
|
||||||
|
|
||||||
/* Detach stdin, stdout and stderr */
|
/* Detach stdin, stdout and stderr */
|
||||||
Setup_FDStreams( );
|
Setup_FDStreams( );
|
||||||
|
@@ -144,8 +144,8 @@ Resolve_Init(RES_STAT *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef WANT_IPV6
|
#if !defined(HAVE_GETADDRINFO) || !defined(HAVE_GETNAMEINFO)
|
||||||
#ifdef h_errno
|
#if !defined(WANT_IPV6) && defined(h_errno)
|
||||||
static char *
|
static char *
|
||||||
Get_Error( int H_Error )
|
Get_Error( int H_Error )
|
||||||
{
|
{
|
||||||
@@ -162,8 +162,8 @@ Get_Error( int H_Error )
|
|||||||
}
|
}
|
||||||
return "unknown error";
|
return "unknown error";
|
||||||
}
|
}
|
||||||
#endif /* h_errno */
|
#endif
|
||||||
#endif /* WANT_IPV6 */
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Do "IDENT" (aka "AUTH") lookup and append result to resolved_addr array */
|
/* Do "IDENT" (aka "AUTH") lookup and append result to resolved_addr array */
|
||||||
|
Reference in New Issue
Block a user