Module: ngircd.git
Branch: master
Commit: b24d645ca183194b0158cd7bba1e0c1f468a7de9
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=b24d645c…
Author: Alexander Barton <alex(a)barton.de>
Date: Wed Jan 4 21:39:46 2012 +0100
Conn_SetPenalty(): Add new "penalty time" on each function call
Until now, the penalty time has only been set when longer as the
already set one, so it didn't accumulate.
And add documentation for and clean up code in Conn_SetPenalty() and
Conn_ResetPenalty() functions.
---
src/ngircd/conn-func.c | 51 +++++++++++++++++++++++++++++++++--------------
1 files changed, 36 insertions(+), 15 deletions(-)
diff --git a/src/ngircd/conn-func.c b/src/ngircd/conn-func.c
index 8b0b6f7..32001f0 100644
--- a/src/ngircd/conn-func.c
+++ b/src/ngircd/conn-func.c
@@ -65,35 +65,56 @@ Conn_LastPing( CONN_ID Idx )
} /* Conn_LastPing */
+/**
+ * Add "penalty time" for a connection.
+ *
+ * During the "penalty time" the socket is ignored completely, no new data
+ * is read. This function only increases the penalty, it is not possible to
+ * decrease the penalty time.
+ *
+ * @param Idex Connection index.
+ * @param Seconds Seconds to add.
+ * @see Conn_ResetPenalty
+ */
GLOBAL void
-Conn_SetPenalty( CONN_ID Idx, time_t Seconds )
+Conn_SetPenalty(CONN_ID Idx, time_t Seconds)
{
- /* set Penalty-Delay for a socket.
- * during the penalty, the socket is ignored completely, no new
- * data is read. This function only increases the penalty, it is
- * not possible to decrease the penalty time.
- */
time_t t;
-
- assert( Idx > NONE );
- assert( Seconds >= 0 );
- t = time( NULL ) + Seconds;
- if (t > My_Connections[Idx].delaytime)
+ assert(Idx > NONE);
+ assert(Seconds >= 0);
+
+ t = time(NULL);
+ if (My_Connections[Idx].delaytime < t)
My_Connections[Idx].delaytime = t;
+ My_Connections[Idx].delaytime += Seconds;
+
#ifdef DEBUG
- Log(LOG_DEBUG, "Add penalty time on connection %d: %ld second(s).",
- Idx, (long)Seconds);
+ Log(LOG_DEBUG,
+ "Add penalty time on connection %d: %ld second%s, total %ld second%s.",
+ Idx, (long)Seconds, Seconds != 1 ? "s" : "",
+ My_Connections[Idx].delaytime - t,
+ My_Connections[Idx].delaytime - t != 1 ? "s" : "");
#endif
} /* Conn_SetPenalty */
+/**
+ * Reset the "penalty time" for one connection.
+ *
+ * @param Idx Connection index.
+ * @see Conn_SetPenalty
+ */
GLOBAL void
-Conn_ResetPenalty( CONN_ID Idx )
+Conn_ResetPenalty(CONN_ID Idx)
{
- assert( Idx > NONE );
+ assert(Idx > NONE);
+
My_Connections[Idx].delaytime = 0;
+#ifdef DEBUG
+ Log(LOG_DEBUG, "Penalty time on connection %d has been reset.");
+#endif
} /* Conn_ResetPenalty */
Module: ngircd.git
Branch: master
Commit: edab86e0f843dc07815477e25a0a6184d7500120
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=edab86e0…
Author: Alexander Barton <alex(a)barton.de>
Date: Tue Jan 3 20:37:41 2012 +0100
Display correct error message when "Server{UID|GID}" is invalid
This partly closes bug #118. ngIRCd still starts up even when
Server{UID|GID} is invalid: then the daemon falls back to "nobody"
when running with root(0) privileges (as before).
---
src/ngircd/conf.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index b0c7fb4..f18016b 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -1308,7 +1308,9 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
else {
Conf_GID = (unsigned int)atoi(Arg);
if (!Conf_GID && strcmp(Arg, "0"))
- Config_Error_NaN(Line, Var);
+ Config_Error(LOG_WARNING,
+ "%s, line %d: Value of \"%s\" is not a valid group name or ID!",
+ NGIRCd_ConfFile, Line, Var);
}
return;
}
@@ -1319,7 +1321,9 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
else {
Conf_UID = (unsigned int)atoi(Arg);
if (!Conf_UID && strcmp(Arg, "0"))
- Config_Error_NaN(Line, Var);
+ Config_Error(LOG_WARNING,
+ "%s, line %d: Value of \"%s\" is not a valid user name or ID!",
+ NGIRCd_ConfFile, Line, Var);
}
return;
}
Module: ngircd.git
Branch: master
Commit: ab188c148659959060fb7a27ffa00214093ced6f
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=ab188c14…
Author: Alexander Barton <alex(a)barton.de>
Date: Tue Jan 3 18:56:31 2012 +0100
README: point to included COPYING file, not gnu.org
---
README | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/README b/README
index 53b4205..f9b3662 100644
--- a/README
+++ b/README
@@ -14,9 +14,10 @@ I. Introduction
ngIRCd is an Open Source server for the Internet Relay Chat (IRC), which
is developed and published under the terms of the GNU General Public
-Licence (URL: http://www.gnu.org/licenses/gpl.html). ngIRCd means "next
-generation IRC daemon", it's written from scratch and not deduced from the
-"grandfather of IRC daemons", the daemon of the IRCNet.
+Licence, see the file COPYING for details. ngIRCd means "next generation
+IRC daemon" (which is a little bit exaggerated, "lightweight Internet Relay
+Chat server" would be better), it's written from scratch and not deduced
+from the "grandfather of IRC daemons", the daemon of the IRCNet.
Please see the INSTALL document for installation and upgrade information!
Module: ngircd.git
Branch: master
Commit: 5eb9f2e7172620874d5ad4c247b82fc2aee3ac1b
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=5eb9f2e7…
Author: Alexander Barton <alex(a)barton.de>
Date: Tue Jan 3 11:30:45 2012 +0100
Update Copyright notices for 2012
---
AUTHORS | 2 +-
INSTALL | 2 +-
NEWS | 2 +-
README | 2 +-
src/ngircd/ngircd.c | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 03a19dd..241d3a4 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,7 +2,7 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
- (c)2001-2011 Alexander Barton and Contributors.
+ (c)2001-2012 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
diff --git a/INSTALL b/INSTALL
index 99fe33d..45ebe99 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,7 +2,7 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
- (c)2001-2011 Alexander Barton and Contributors.
+ (c)2001-2012 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
diff --git a/NEWS b/NEWS
index 3a8d1c5..d44b4a8 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
- (c)2001-2011 Alexander Barton and Contributors.
+ (c)2001-2012 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
diff --git a/README b/README
index 888385c..53b4205 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@
ngIRCd - Next Generation IRC Server
http://ngircd.barton.de/
- (c)2001-2011 Alexander Barton and Contributors.
+ (c)2001-2012 Alexander Barton and Contributors.
ngIRCd is free software and published under the
terms of the GNU General Public License.
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index 3e64f35..a1f1d88 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -1,6 +1,6 @@
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2011 Alexander Barton (alex(a)barton.de) and Contributors.
+ * Copyright (c)2001-2012 Alexander Barton (alex(a)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
@@ -424,7 +424,7 @@ static void
Show_Version( void )
{
puts( NGIRCd_Version );
- puts( "Copyright (c)2001-2011 Alexander Barton (<alex(a)barton.de>) and Contributors." );
+ puts( "Copyright (c)2001-2012 Alexander Barton (<alex(a)barton.de>) and Contributors." );
puts( "Homepage: <http://ngircd.barton.de/>\n" );
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." );