diff options
| author | DukePyrolator <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-31 06:15:29 +0000 |
|---|---|---|
| committer | DukePyrolator <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-31 06:15:29 +0000 |
| commit | aa4b3e256377030d291fc2d5f4db94985ce04395 (patch) | |
| tree | 993302c0cbe754612f69c22bbbc57d00220cabd4 /src/sessions.c | |
| parent | 47504c9de5accda45a19627fd2b6ec13baa6ba95 (diff) | |
replaced the alog() command with a new type-safe and stream-based Alog()
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2777 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/sessions.c')
| -rw-r--r-- | src/sessions.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/sessions.c b/src/sessions.c index 867373f27..b0ca9b374 100644 --- a/src/sessions.c +++ b/src/sessions.c @@ -160,12 +160,10 @@ int add_session(const char *nick, const char *host, char *hostip) if (Config.MaxSessionKill && session->hits >= Config.MaxSessionKill) { char akillmask[BUFSIZE]; snprintf(akillmask, sizeof(akillmask), "*@%s", host); - add_akill(NULL, akillmask, Config.s_OperServ, - time(NULL) + Config.SessionAutoKillExpiry, - "Session limit exceeded"); + add_akill(NULL, akillmask, Config.s_OperServ, + time(NULL) + Config.SessionAutoKillExpiry, "Session limit exceeded"); ircdproto->SendGlobops(findbot(Config.s_OperServ), - "Added a temporary AKILL for \2%s\2 due to excessive connections", - akillmask); + "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask); } return 0; } else { @@ -194,31 +192,24 @@ void del_session(const char *host) Session *session; if (!Config.LimitSessions) { - if (debug) { - alog("debug: del_session called when LimitSessions is disabled"); - } + Alog(LOG_DEBUG) << "del_session called when LimitSessions is disabled"; return; } if (!host || !*host) { - if (debug) { - alog("debug: del_session called with NULL values"); - } + Alog(LOG_DEBUG) << "del_session called with NULL values"; return; } - if (debug >= 2) - alog("debug: del_session() called"); + Alog(LOG_DEBUG_2) << "del_session() called"; session = findsession(host); if (!session) { - if (debug) { - ircdproto->SendGlobops(findbot(Config.s_OperServ), - "WARNING: Tried to delete non-existant session: \2%s", - host); - alog("session: Tried to delete non-existant session: %s", - host); + if (debug) + { + ircdproto->SendGlobops(findbot(Config.s_OperServ), "WARNING: Tried to delete non-existant session: \2%s", host); + Alog(LOG_DEBUG) << "session: Tried to delete non-existant session: " << host; } return; } @@ -235,16 +226,14 @@ void del_session(const char *host) if (session->next) session->next->prev = session->prev; - if (debug >= 2) - alog("debug: del_session(): free session structure"); + Alog(LOG_DEBUG_2) << "del_session(): free session structure"; delete [] session->host; delete session; nsessions--; - if (debug >= 2) - alog("debug: del_session() done"); + Alog(LOG_DEBUG_2) << "del_session() done"; } |
