summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_mysql.cpp11
-rw-r--r--src/modules/extra/m_pgsql.cpp132
-rw-r--r--src/modules/extra/m_sqlauth.cpp25
-rw-r--r--src/modules/extra/m_sqlite3.cpp15
-rw-r--r--src/modules/extra/m_sqllog.cpp11
-rw-r--r--src/modules/extra/m_sqloper.cpp49
-rw-r--r--src/modules/extra/m_sqlutils.cpp38
-rw-r--r--src/modules/m_alias.cpp19
-rw-r--r--src/modules/m_banredirect.cpp9
-rw-r--r--src/modules/m_cban.cpp1
-rw-r--r--src/modules/m_cgiirc.cpp23
-rw-r--r--src/modules/m_dccallow.cpp3
-rw-r--r--src/modules/m_dnsbl.cpp15
-rw-r--r--src/modules/m_http_client.cpp8
-rw-r--r--src/modules/m_httpd.cpp6
-rw-r--r--src/modules/m_httpd_stats.cpp2
-rw-r--r--src/modules/m_ident.cpp5
-rw-r--r--src/modules/m_joinflood.cpp1
-rw-r--r--src/modules/m_kicknorejoin.cpp9
-rw-r--r--src/modules/m_oper_hash.cpp1
-rw-r--r--src/modules/m_remove.cpp8
-rw-r--r--src/modules/m_safelist.cpp5
-rw-r--r--src/modules/m_services.cpp14
23 files changed, 44 insertions, 366 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 0688b1099..7451824bf 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -729,7 +729,6 @@ class Notifier : public InspSocket
Notifier(InspIRCd* SI, int newfd, char* ip) : InspSocket(SI, newfd, ip)
{
- Instance->Log(DEBUG,"Constructor of new socket");
}
/* Using getsockname and ntohs, we can determine which port number we were allocated */
@@ -744,7 +743,6 @@ class Notifier : public InspSocket
virtual int OnIncomingConnection(int newsock, char* ip)
{
- Instance->Log(DEBUG,"Inbound connection on fd %d!",newsock);
Notifier* n = new Notifier(this->Instance, newsock, ip);
n = n; /* Stop bitching at me, GCC */
return true;
@@ -752,18 +750,14 @@ class Notifier : public InspSocket
virtual bool OnDataReady()
{
- Instance->Log(DEBUG,"Inbound data!");
char* data = this->Read();
ConnMap::iterator iter;
if (data && *data)
{
- Instance->Log(DEBUG,"Looking for connection %s",data);
/* We expect to be sent a null terminated string */
if((iter = Connections.find(data)) != Connections.end())
{
- Instance->Log(DEBUG,"Found it!");
-
/* Lock the mutex, send back the data */
pthread_mutex_lock(&results_mutex);
ResultQueue::iterator n = iter->second->rq.begin();
@@ -801,7 +795,6 @@ class ModuleSQL : public Module
SQLModule = this;
MessagePipe = new Notifier(ServerInstance);
- ServerInstance->Log(DEBUG,"Bound notifier to 127.0.0.1:%d",MessagePipe->GetPort());
pthread_attr_t attribs;
pthread_attr_init(&attribs);
@@ -857,8 +850,6 @@ class ModuleSQL : public Module
char* returnval = NULL;
- ServerInstance->Log(DEBUG, "Got query: '%s' with %d replacement parameters on id '%s'", req->query.q.c_str(), req->query.p.size(), req->dbid.c_str());
-
if((iter = Connections.find(req->dbid)) != Connections.end())
{
req->id = NewID();
@@ -876,8 +867,6 @@ class ModuleSQL : public Module
return returnval;
}
- ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId());
-
return NULL;
}
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index 8807d82c5..db0bbc92d 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -117,7 +117,7 @@ class SQLresolver : public Resolver
virtual void OnError(ResolverError e, const std::string &errormessage)
{
- ServerInstance->Log(DEBUG, "DNS lookup failed (%s), dying horribly", errormessage.c_str());
+ ServerInstance->Log(DEBUG, "PgSQL: DNS lookup failed (%s), dying horribly", errormessage.c_str());
}
};
@@ -163,8 +163,6 @@ public:
void push(const SQLrequest &q)
{
- //ServerInstance->Log(DEBUG, "QueryQueue::push(): Adding %s query to queue: %s", ((q.pri) ? "priority" : "non-priority"), q.query.q.c_str());
-
if(q.pri)
priority.push_back(q);
else
@@ -278,8 +276,6 @@ public:
{
rows = PQntuples(res);
cols = PQnfields(res);
-
- //ServerInstance->Log(DEBUG, "Created new PgSQL result; %d rows, %d columns, %s affected", rows, cols, PQcmdTuples(res));
}
~PgSQLresult()
@@ -342,7 +338,6 @@ public:
}
else
{
- //ServerInstance->Log(DEBUG, "PQgetvalue returned a null pointer..nobody wants to tell us what this means");
throw SQLbadColName();
}
}
@@ -509,40 +504,25 @@ class SQLConn : public EventHandler
bool DoConnect()
{
if(!(sql = PQconnectStart(confhost.GetDSN().c_str())))
- {
- Instance->Log(DEBUG, "Couldn't allocate PGconn structure, aborting: %s", PQerrorMessage(sql));
return false;
- }
if(PQstatus(sql) == CONNECTION_BAD)
- {
- Instance->Log(DEBUG, "PQconnectStart failed: %s", PQerrorMessage(sql));
return false;
- }
-
- ShowStatus();
if(PQsetnonblocking(sql, 1) == -1)
- {
- Instance->Log(DEBUG, "Couldn't set connection nonblocking: %s", PQerrorMessage(sql));
return false;
- }
/* OK, we've initalised the connection, now to get it hooked into the socket engine
* and then start polling it.
*/
this->fd = PQsocket(sql);
- Instance->Log(DEBUG, "New SQL socket: %d", this->fd);
if(this->fd <= -1)
- {
- Instance->Log(DEBUG, "PQsocket says we have an invalid FD: %d", this->fd);
return false;
- }
if (!this->Instance->SE->AddFd(this))
{
- Instance->Log(DEBUG, "A PQsocket cant be added to the socket engine!");
+ Instance->Log(DEBUG, "BUG: Couldn't add pgsql socket to socket engine");
return false;
}
@@ -582,26 +562,20 @@ class SQLConn : public EventHandler
if(PQconsumeInput(sql))
{
- Instance->Log(DEBUG, "PQconsumeInput succeeded");
-
/* We just read stuff from the server, that counts as it being alive
* so update the idle-since time :p
*/
idle = this->Instance->Time();
- if(PQisBusy(sql))
+ if (PQisBusy(sql))
{
- //Instance->Log(DEBUG, "Still busy processing command though");
+ /* Nothing happens here */
}
- else if(qinprog)
+ else if (qinprog)
{
- //ServerInstance->Log(DEBUG, "Looks like we have a result to process!");
-
/* Grab the request we're processing */
SQLrequest& query = queue.front();
- Instance->Log(DEBUG, "ID is %lu", query.id);
-
/* Get a pointer to the module we're about to return the result to */
Module* to = query.GetSource();
@@ -628,8 +602,6 @@ class SQLConn : public EventHandler
/* Fix by brain, make sure the original query gets sent back in the reply */
reply.query = query.query.q;
- Instance->Log(DEBUG, "Got result, status code: %s; error message: %s", PQresStatus(PQresultStatus(result)), PQresultErrorMessage(result));
-
switch(PQresultStatus(result))
{
case PGRES_EMPTY_QUERY:
@@ -651,17 +623,12 @@ class SQLConn : public EventHandler
* the pointer to NULL. We cannot just cancel the query as the result will still come
* through at some point...and it could get messy if we play with invalid pointers...
*/
- Instance->Log(DEBUG, "Looks like we're handling a zombie query from a module which unloaded before it got a result..fun. ID: %lu", query.id);
PQclear(result);
}
qinprog = false;
queue.pop();
DoConnectedPoll();
}
- else
- {
- Instance->Log(DEBUG, "Eh!? We just got a read event, and connection isn't busy..but no result :(");
- }
return true;
}
else
@@ -671,7 +638,6 @@ class SQLConn : public EventHandler
* deserves to reconnect [/excuse]
* Returning true so the core doesn't try and close the connection.
*/
- Instance->Log(DEBUG, "PQconsumeInput failed: %s", PQerrorMessage(sql));
DelayReconnect();
return true;
}
@@ -682,85 +648,36 @@ class SQLConn : public EventHandler
switch(PQresetPoll(sql))
{
case PGRES_POLLING_WRITING:
- //ServerInstance->Log(DEBUG, "PGresetPoll: PGRES_POLLING_WRITING");
Instance->SE->WantWrite(this);
status = CWRITE;
return DoPoll();
case PGRES_POLLING_READING:
- //ServerInstance->Log(DEBUG, "PGresetPoll: PGRES_POLLING_READING");
status = CREAD;
return true;
case PGRES_POLLING_FAILED:
- //ServerInstance->Log(DEBUG, "PGresetPoll: PGRES_POLLING_FAILED: %s", PQerrorMessage(sql));
return false;
case PGRES_POLLING_OK:
- //ServerInstance->Log(DEBUG, "PGresetPoll: PGRES_POLLING_OK");
status = WWRITE;
return DoConnectedPoll();
default:
- //ServerInstance->Log(DEBUG, "PGresetPoll: wtf?");
return true;
}
}
- void ShowStatus()
- {
- switch(PQstatus(sql))
- {
- case CONNECTION_OK:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_OK: Can proceed to connect.");
- break;
-
- case CONNECTION_BAD:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_BAD: Connection is closed.");
- break;
-
- case CONNECTION_STARTED:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_STARTED: Waiting for connection to be made.");
- break;
-
- case CONNECTION_MADE:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_MADE: Connection OK; waiting to send.");
- break;
-
- case CONNECTION_AWAITING_RESPONSE:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_AWAITING_RESPONSE: Waiting for a response from the server.");
- break;
-
- case CONNECTION_AUTH_OK:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_AUTH_OK: Received authentication; waiting for backend start-up to finish.");
- break;
-
- case CONNECTION_SSL_STARTUP:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_SSL_STARTUP: Negotiating SSL encryption.");
- break;
-
- case CONNECTION_SETENV:
- Instance->Log(DEBUG, "PQstatus: CONNECTION_SETENV: Negotiating environment-driven parameter settings.");
- break;
-
- default:
- Instance->Log(DEBUG, "PQstatus: ???");
- }
- }
-
bool OnDataReady()
{
/* Always return true here, false would close the socket - we need to do that ourselves with the pgsql API */
- Instance->Log(DEBUG, "OnDataReady(): status = %s", StatusStr());
return DoEvent();
}
bool OnWriteReady()
{
/* Always return true here, false would close the socket - we need to do that ourselves with the pgsql API */
- Instance->Log(DEBUG, "OnWriteReady(): status = %s", StatusStr());
return DoEvent();
}
bool OnConnected()
{
- Instance->Log(DEBUG, "OnConnected(): status = %s", StatusStr());
return DoEvent();
}
@@ -785,15 +702,6 @@ class SQLConn : public EventHandler
return ret;
}
- const char* StatusStr()
- {
- if(status == CREAD) return "CREAD";
- if(status == CWRITE) return "CWRITE";
- if(status == WREAD) return "WREAD";
- if(status == WWRITE) return "WWRITE";
- return "Err...what, erm..BUG!";
- }
-
SQLerror DoQuery(SQLrequest &req)
{
if((status == WREAD) || (status == WWRITE))
@@ -852,11 +760,9 @@ class SQLConn : public EventHandler
#endif
if(error)
{
- Instance->Log(DEBUG, "Apparently PQescapeStringConn() failed somehow...don't know how or what to do...");
+ Instance->Log(DEBUG, "BUG: Apparently PQescapeStringConn() failed somehow...don't know how or what to do...");
}
- Instance->Log(DEBUG, "Appended %d bytes of escaped string onto the query", len);
-
/* Incremenet queryend to the end of the newly escaped parameter */
queryend += len;
@@ -865,7 +771,7 @@ class SQLConn : public EventHandler
}
else
{
- Instance->Log(DEBUG, "Found a substitution location but no parameter to substitute :|");
+ Instance->Log(DEBUG, "BUG: Found a substitution location but no parameter to substitute :|");
break;
}
}
@@ -878,21 +784,16 @@ class SQLConn : public EventHandler
/* Null-terminate the query */
*queryend = 0;
-
- Instance->Log(DEBUG, "Attempting to dispatch query: %s", query);
-
req.query.q = query;
if(PQsendQuery(sql, query))
{
- Instance->Log(DEBUG, "Dispatched query successfully");
qinprog = true;
delete[] query;
return SQLerror();
}
else
{
- Instance->Log(DEBUG, "Failed to dispatch query: %s", PQerrorMessage(sql));
delete[] query;
return SQLerror(QSEND_FAIL, PQerrorMessage(sql));
}
@@ -928,23 +829,17 @@ class SQLConn : public EventHandler
}
void Close() {
- Instance->Log(DEBUG, "SQLConn::Close - socket: %d", this->fd);
-
if (!this->Instance->SE->DelFd(this))
{
if (sql && PQstatus(sql) == CONNECTION_BAD)
{
- Instance->Log(DEBUG, "PQsocket was already removed. Forcing removal from socket engine!");
this->Instance->SE->DelFd(this, true);
}
else
{
- Instance->Log(DEBUG, "PQsocket cant be removed from socket engine!");
+ Instance->Log(DEBUG, "BUG: PQsocket cant be removed from socket engine!");
}
}
- else {
- Instance->Log(DEBUG, "PQsocket removed from socket engine!");
- }
if(sql)
{
@@ -975,7 +870,7 @@ class ModulePgSQL : public Module
if (!ServerInstance->PublishFeature("SQL", this))
{
- throw ModuleException("m_pgsql: Unable to publish feature 'SQL'");
+ throw ModuleException("BUG: PgSQL Unable to publish feature 'SQL'");
}
ReadConf();
@@ -1077,13 +972,12 @@ class ModulePgSQL : public Module
catch(...)
{
/* THE WORLD IS COMING TO AN END! */
- ServerInstance->Log(DEBUG, "Couldn't make a SQLresolver..this connection is gonna diiiiiie...actually we just won't create it");
}
}
else
{
/* Invalid address family, die horribly. */
- ServerInstance->Log(DEBUG, "insp_aton failed returning -1, oh noes.");
+ ServerInstance->Log(DEBUG, "BUG: insp_aton failed returning -1, oh noes.");
}
}
}
@@ -1150,9 +1044,6 @@ class ModulePgSQL : public Module
{
SQLrequest* req = (SQLrequest*)request;
ConnMap::iterator iter;
-
- ServerInstance->Log(DEBUG, "Got query: '%s' with %d replacement parameters on id '%s'", req->query.q.c_str(), req->query.p.size(), req->dbid.c_str());
-
if((iter = connections.find(req->dbid)) != connections.end())
{
/* Execute query */
@@ -1167,9 +1058,6 @@ class ModulePgSQL : public Module
return NULL;
}
}
-
- ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId());
-
return NULL;
}
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp
index 7130439e0..8b1b4a5ea 100644
--- a/src/modules/extra/m_sqlauth.cpp
+++ b/src/modules/extra/m_sqlauth.cpp
@@ -120,19 +120,14 @@ public:
* association. This means that if the user quits during a query we will just get a failed lookup from m_sqlutils - telling
* us to discard the query.
*/
- ServerInstance->Log(DEBUG, "Sent query, got given ID %lu", req.id);
-
AssociateUser(this, SQLutils, req.id, user).Send();
return true;
}
else
{
- ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str());
-
if (verbose)
Srv->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, req.error.Str());
-
return false;
}
}
@@ -147,22 +142,15 @@ public:
{
if(strcmp(SQLRESID, request->GetId()) == 0)
{
- SQLresult* res;
-
- res = static_cast<SQLresult*>(request);
-
- ServerInstance->Log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id);
-
+ SQLresult* res = static_cast<SQLresult*>(request);
+
userrec* user = GetAssocUser(this, SQLutils, res->id).S().user;
UnAssociate(this, SQLutils, res->id).S();
if(user)
{
if(res->error.Id() == NO_ERROR)
- {
- ServerInstance->Log(DEBUG, "Associated query ID %lu with user %s", res->id, user->nick);
- ServerInstance->Log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols());
-
+ {
if(res->Rows())
{
/* We got a row in the result, this is enough really */
@@ -177,14 +165,12 @@ public:
}
else if (verbose)
{
- ServerInstance->Log(DEBUG, "Query failed: %s", res->error.Str());
Srv->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str());
user->Extend("sqlauth_failed");
}
}
else
{
- ServerInstance->Log(DEBUG, "Got query with unknown ID, this probably means the user quit while the query was in progress");
return NULL;
}
@@ -193,10 +179,7 @@ public:
userrec::QuitUser(Srv,user,killreason);
}
return SQLSUCCESS;
- }
-
- ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId());
-
+ }
return NULL;
}
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp
index 9c66c4f11..4a46108ef 100644
--- a/src/modules/extra/m_sqlite3.cpp
+++ b/src/modules/extra/m_sqlite3.cpp
@@ -64,7 +64,6 @@ class ResultNotifier : public InspSocket
ResultNotifier(InspIRCd* SI, Module* m, int newfd, char* ip) : InspSocket(SI, newfd, ip), mod(m)
{
- Instance->Log(DEBUG,"Constructor of new socket");
}
/* Using getsockname and ntohs, we can determine which port number we were allocated */
@@ -79,7 +78,6 @@ class ResultNotifier : public InspSocket
virtual int OnIncomingConnection(int newsock, char* ip)
{
- Instance->Log(DEBUG,"Inbound connection on fd %d!",newsock);
Dispatch();
return false;
}
@@ -269,11 +267,7 @@ class SQLConn : public classbase
SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
: Instance(SI), mod(m), host(hi)
{
- if (OpenDB() == SQLITE_OK)
- {
- Instance->Log(DEBUG, "Opened sqlite DB: " + host.host);
- }
- else
+ if (OpenDB() != SQLITE_OK)
{
Instance->Log(DEFAULT, "WARNING: Could not open DB with id: " + host.id);
CloseDB();
@@ -355,12 +349,10 @@ class SQLConn : public classbase
{
std::string error(errmsg);
sqlite3_free(errmsg);
- Instance->Log(DEBUG, "Query failed: " + ConvToStr(errmsg));
delete[] query;
delete res;
return SQLerror(QSEND_FAIL, error);
}
- Instance->Log(DEBUG, "Dispatched query successfully. ID: %d resulting rows %d", req.id, res->Rows());
delete[] query;
results.push_back(res);
@@ -400,7 +392,6 @@ class SQLConn : public classbase
{
sqlite3_interrupt(conn);
sqlite3_close(conn);
- Instance->Log(DEBUG, "Closed sqlite DB: " + host.host);
}
SQLhost GetConfHost()
@@ -423,7 +414,6 @@ class SQLConn : public classbase
* the pointer to NULL. We cannot just cancel the query as the result will still come
* through at some point...and it could get messy if we play with invalid pointers...
*/
- Instance->Log(DEBUG, "Looks like we're handling a zombie query from a module which unloaded before it got a result..fun. ID: " + ConvToStr(res->GetId()));
delete res;
}
results.pop_front();
@@ -491,7 +481,6 @@ class ModuleSQLite3 : public Module
}
resultnotify = new ResultNotifier(ServerInstance, this);
- ServerInstance->Log(DEBUG,"Bound notifier to 127.0.0.1:%d",resultnotify->GetPort());
ReadConf();
@@ -637,7 +626,6 @@ class ModuleSQLite3 : public Module
{
SQLrequest* req = (SQLrequest*)request;
ConnMap::iterator iter;
- ServerInstance->Log(DEBUG, "Got query: '%s' with %d replacement parameters on id '%s'", req->query.q.c_str(), req->query.p.size(), req->dbid.c_str());
if((iter = connections.find(req->dbid)) != connections.end())
{
req->id = NewID();
@@ -650,7 +638,6 @@ class ModuleSQLite3 : public Module
return NULL;
}
}
- ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId());
return NULL;
}
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index 78c2164aa..1202ac2d3 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -231,15 +231,11 @@ class ModuleSQLLog : public Module
std::map<unsigned long, QueryInfo*>::iterator n;
res = static_cast<SQLresult*>(request);
- ServerInstance->Log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id);
-
n = active_queries.find(res->id);
if (n != active_queries.end())
{
- ServerInstance->Log(DEBUG,"This is an active query");
n->second->Go(res);
-
std::map<unsigned long, QueryInfo*>::iterator n = active_queries.find(res->id);
active_queries.erase(n);
}
@@ -247,8 +243,6 @@ class ModuleSQLLog : public Module
return SQLSUCCESS;
}
- ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId());
-
return NULL;
}
@@ -264,11 +258,6 @@ class ModuleSQLLog : public Module
QueryInfo* i = new QueryInfo(nick, source, host, req.id, category);
i->qs = FIND_SOURCE;
active_queries[req.id] = i;
- ServerInstance->Log(DEBUG,"Active query id %d",req.id);
- }
- else
- {
- ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str());
}
}
diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp
index 5d56b0fad..df99a6dc4 100644
--- a/src/modules/extra/m_sqloper.cpp
+++ b/src/modules/extra/m_sqloper.cpp
@@ -102,6 +102,10 @@ public:
/* Make an MD5 hash of the password for using in the query */
std::string md5_pass_hash = HashSumRequest(this, HashModule, password.c_str()).Send();
+ /* We generate our own MD5 sum here because some database providers (e.g. SQLite) dont have a builtin md5 function,
+ * also hashing it in the module and only passing a remote query containing a hash is more secure.
+ */
+
SQLrequest req = SQLreq(this, target, databaseid, "SELECT username, password, hostname, type FROM ircd_opers WHERE username = '?' AND password='?'", username, md5_pass_hash);
if (req.Send())
@@ -113,8 +117,6 @@ public:
* association. This means that if the user quits during a query we will just get a failed lookup from m_sqlutils - telling
* us to discard the query.
*/
- ServerInstance->Log(DEBUG, "Sent query, got given ID %lu", req.id);
-
AssociateUser(this, SQLutils, req.id, user).Send();
user->Extend("oper_user", strdup(username.c_str()));
@@ -124,8 +126,6 @@ public:
}
else
{
- ServerInstance->Log(DEBUG, "SQLrequest failed: %s", req.error.Str());
-
return false;
}
}
@@ -140,12 +140,8 @@ public:
{
if (strcmp(SQLRESID, request->GetId()) == 0)
{
- SQLresult* res;
-
- res = static_cast<SQLresult*>(request);
-
- ServerInstance->Log(DEBUG, "Got SQL result (%s) with ID %lu", res->GetId(), res->id);
-
+ SQLresult* res = static_cast<SQLresult*>(request);
+
userrec* user = GetAssocUser(this, SQLutils, res->id).S().user;
UnAssociate(this, SQLutils, res->id).S();
@@ -158,10 +154,7 @@ public:
if (user)
{
if (res->error.Id() == NO_ERROR)
- {
- ServerInstance->Log(DEBUG, "Associated query ID %lu with user %s", res->id, user->nick);
- ServerInstance->Log(DEBUG, "Got result with %d rows and %d columns", res->Rows(), res->Cols());
-
+ {
if (res->Rows())
{
/* We got a row in the result, this means there was a record for the oper..
@@ -178,9 +171,7 @@ public:
*/
for (SQLfieldMap& row = res->GetRowMap(); row.size(); row = res->GetRowMap())
- {
- ServerInstance->Log(DEBUG, "Trying to oper user %s with username = '%s', passhash = '%s', hostname = '%s', type = '%s'", user->nick, row["username"].d.c_str(), row["password"].d.c_str(), row["hostname"].d.c_str(), row["type"].d.c_str());
-
+ {
if (OperUser(user, row["username"].d, row["password"].d, row["hostname"].d, row["type"].d))
{
/* If/when one of the rows matches, stop checking and return */
@@ -218,8 +209,6 @@ public:
* We have to fail the /oper request and give them the same error
* as above.
*/
- ServerInstance->Log(DEBUG, "Query failed: %s", res->error.Str());
-
if (tried_user && tried_pass)
{
LoginFail(user, tried_user, tried_pass);
@@ -231,15 +220,9 @@ public:
}
}
- else
- {
- ServerInstance->Log(DEBUG, "Got query with unknown ID, this probably means the user quit while the query was in progress");
- }
return SQLSUCCESS;
}
-
- ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId());
return NULL;
}
@@ -255,7 +238,7 @@ public:
}
else
{
- ServerInstance->Log(DEBUG, "WHAT?! Why do we have no OPER command?!");
+ ServerInstance->Log(DEBUG, "BUG: WHAT?! Why do we have no OPER command?!");
}
}
@@ -266,28 +249,24 @@ public:
for (int j = 0; j < Conf.Enumerate("type"); j++)
{
std::string tname = Conf.ReadValue("type","name",j);
-
- ServerInstance->Log(DEBUG, "Scanning opertype: %s", tname.c_str());
-
std::string hostname(user->ident);
+
hostname.append("@").append(user->host);
if ((tname == type) && OneOfMatches(hostname.c_str(), user->GetIPString(), pattern.c_str()))
{
/* Opertype and host match, looks like this is it. */
- ServerInstance->Log(DEBUG, "Host (%s matched %s OR %s) and type (%s)", pattern.c_str(), hostname.c_str(), user->GetIPString(), type.c_str());
-
std::string operhost = Conf.ReadValue("type", "host", j);
-
+
if (operhost.size())
user->ChangeDisplayedHost(operhost.c_str());
-
+
Srv->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s", user->nick, user->ident, user->host, type.c_str());
user->WriteServ("381 %s :You are now an IRC operator of type %s", user->nick, type.c_str());
-
+
if (!user->modes[UM_OPERATOR])
user->Oper(type);
-
+
return true;
}
}
diff --git a/src/modules/extra/m_sqlutils.cpp b/src/modules/extra/m_sqlutils.cpp
index bec8a4450..131e20e5e 100644
--- a/src/modules/extra/m_sqlutils.cpp
+++ b/src/modules/extra/m_sqlutils.cpp
@@ -61,8 +61,6 @@ public:
{
AssociateUser* req = (AssociateUser*)request;
- ServerInstance->Log(DEBUG, "Associated ID %lu with user %s", req->id, req->user->nick);
-
iduser.insert(std::make_pair(req->id, req->user));
AttachList(req->user, req->id);
@@ -70,8 +68,6 @@ public:
else if(strcmp(SQLUTILAC, request->GetId()) == 0)
{
AssociateChan* req = (AssociateChan*)request;
-
- ServerInstance->Log(DEBUG, "Associated ID %lu with channel %s", req->id, req->chan->name);
idchan.insert(std::make_pair(req->id, req->chan));
@@ -85,8 +81,6 @@ public:
* it is associated with.
*/
- ServerInstance->Log(DEBUG, "Unassociating ID %lu with all users and channels", req->id);
-
DoUnAssociate(iduser, req->id);
DoUnAssociate(idchan, req->id);
}
@@ -96,11 +90,8 @@ public:
IdUserMap::iterator iter = iduser.find(req->id);
- ServerInstance->Log(DEBUG, "Looking up user associated with ID %lu", req->id);
-
if(iter != iduser.end())
{
- ServerInstance->Log(DEBUG, "Found user %s", iter->second->nick);
req->user = iter->second;
}
}
@@ -110,19 +101,11 @@ public:
IdChanMap::iterator iter = idchan.find(req->id);
- ServerInstance->Log(DEBUG, "Looking up channel associated with ID %lu", req->id);
-
if(iter != idchan.end())
{
- ServerInstance->Log(DEBUG, "Found channel %s", iter->second->name);
req->chan = iter->second;
}
}
- else
- {
- ServerInstance->Log(DEBUG, "Got unsupported API version string: %s", request->GetId());
- return NULL;
- }
return SQLUTILSUCCESS;
}
@@ -145,16 +128,12 @@ public:
if(iter != iduser.end())
{
- if(iter->second == user)
- {
- ServerInstance->Log(DEBUG, "Erased query from map associated with quitting user %s", user->nick);
- }
- else
+ if(iter->second != user)
{
ServerInstance->Log(DEBUG, "BUG: ID associated with user %s doesn't have the same userrec* associated with it in the map (erasing anyway)", user->nick);
}
- iduser.erase(iter);
+ iduser.erase(iter);
}
else
{
@@ -215,12 +194,6 @@ public:
* to the value.
*/
RemoveFromList(iter->second, id);
-
- ServerInstance->Log(DEBUG, "Removed query %lu from map and removed references to it on value", id);
- }
- else
- {
- ServerInstance->Log(DEBUG, "Nothing associated with query %lu", id);
}
}
@@ -242,15 +215,10 @@ public:
if(iter != idchan.end())
{
- if(iter->second == chan)
- {
- ServerInstance->Log(DEBUG, "Erased query from map associated with dying channnel %s", chan->name);
- }
- else
+ if(iter->second != chan)
{
ServerInstance->Log(DEBUG, "BUG: ID associated with channel %s doesn't have the same chanrec* associated with it in the map (erasing anyway)", chan->name);
}
-
idchan.erase(iter);
}
else
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index e8fe736c4..858a7883d 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -104,8 +104,6 @@ class ModuleAlias : public Module
bool everything_after = (varname == "-");
std::string word = "";
- ServerInstance->Log(DEBUG,"Get var %d%s", index , everything_after ? " and all after it" : "");
-
for (int j = 0; j < index; j++)
word = ss.GetToken();
@@ -119,8 +117,6 @@ class ModuleAlias : public Module
}
}
- ServerInstance->Log(DEBUG,"Var is '%s'", word.c_str());
-
return word;
}
@@ -200,18 +196,15 @@ class ModuleAlias : public Module
if (crlf == std::string::npos)
{
- ServerInstance->Log(DEBUG,"Single line alias: '%s'", Aliases[i].replace_with.c_str());
DoCommand(Aliases[i].replace_with, user, safe);
return 1;
}
else
{
- ServerInstance->Log(DEBUG,"Multi line alias: '%s'", Aliases[i].replace_with.c_str());
irc::sepstream commands(Aliases[i].replace_with, '\n');
std::string command = "*";
while ((command = commands.GetToken()) != "")
{
- ServerInstance->Log(DEBUG,"Execute: '%s'", command.c_str());
DoCommand(command, user, safe);
}
return 1;
@@ -265,20 +258,10 @@ class ModuleAlias : public Module
while ((pars[x] = ss.GetToken()) != "")
{
parv[x] = pars[x].c_str();
- ServerInstance->Log(DEBUG,"Parameter %d: %s", x, parv[x]);
x++;
}
- ServerInstance->Log(DEBUG,"Call command handler on %s", parv[0]);
-
- if (ServerInstance->Parser->CallHandler(parv[0], &parv[1], x-1, user) == CMD_INVALID)
- {
- ServerInstance->Log(DEBUG,"Unknown command or not enough parameters");
- }
- else
- {
- ServerInstance->Log(DEBUG,"Command handler called successfully.");
- }
+ ServerInstance->Parser->CallHandler(parv[0], &parv[1], x-1, user);
}
virtual void OnRehash(userrec* user, const std::string &parameter)
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index 773badb57..cb1d0a907 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -46,8 +46,6 @@ class BanRedirect : public ModeWatcher
bool BeforeMode(userrec* source, userrec* dest, chanrec* channel, std::string &param, bool adding, ModeType type)
{
- // Srv->Log(DEBUG, "BeforeMode(%s, %s, %s, %s, %s, %s)", ((source && source->nick) ? source->nick : "NULL"), ((dest && dest->nick) ? dest->nick : "NULL"), ((channel && channel->name) ? channel->name : "NULL"), param.c_str(), (adding ? "true" : "false"), ((type == MODETYPE_CHANNEL) ? "MODETYPE_CHANNEL" : "MODETYPE_USER"));
-
/* nick!ident@host -> nick!ident@host
* nick!ident@host#chan -> nick!ident@host#chan
* nick@host#chan -> nick!*@host#chan
@@ -113,8 +111,6 @@ class BanRedirect : public ModeWatcher
}
param.assign(mask[NICK]).append(1, '!').append(mask[IDENT]).append(1, '@').append(mask[HOST]);
-
- // Srv->Log(DEBUG, "mask[NICK] = '%s', mask[IDENT] = '%s', mask[HOST] = '%s', mask[CHAN] = '%s'", mask[NICK].c_str(), mask[IDENT].c_str(), mask[HOST].c_str(), mask[CHAN].c_str());
if(mask[CHAN].length())
{
@@ -178,8 +174,6 @@ class BanRedirect : public ModeWatcher
return false;
}
}
-
- Srv->Log(DEBUG, "Changed param to: %s", param.c_str());
}
return true;
@@ -272,15 +266,12 @@ class ModuleBanRedirect : public Module
*/
std::string ipmask(user->nick);
ipmask.append(1, '!').append(user->MakeHostIP());
- Srv->Log(DEBUG, "Matching against %s, %s and %s", user->GetFullRealHost(), user->GetFullHost(), ipmask.c_str());
for(BanRedirectList::iterator redir = redirects->begin(); redir != redirects->end(); redir++)
{
if(Srv->MatchText(user->GetFullRealHost(), redir->banmask) || Srv->MatchText(user->GetFullHost(), redir->banmask) || Srv->MatchText(ipmask, redir->banmask))
{
/* tell them they're banned and are being transferred */
- Srv->Log(DEBUG, "%s matches ban on %s -- might transferred to %s", user->nick, chan->name, redir->targetchan.c_str());
-
chanrec* destchan = Srv->FindChan(redir->targetchan);
if(destchan && Srv->FindModule("m_redirect.so") && destchan->IsModeSet('L') && destchan->limit && (destchan->GetUserCounter() >= destchan->limit))
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 6d13b59a5..32cd40d83 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -233,7 +233,6 @@ class ModuleCBan : public Module
{
if (iter->set_on + iter->length <= ServerInstance->Time())
{
- ServerInstance->Log(DEBUG, "m_cban.so: Ban on %s expired, removing...", iter->chname.c_str());
ServerInstance->WriteOpers("*** %li second CBAN on %s (%s) set %u seconds ago expired", iter->length, iter->chname.c_str(), iter->reason.c_str(), ServerInstance->Time() - iter->set_on);
cbans.erase(iter);
go_again = true;
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 437ce3190..30147c4cb 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -132,7 +132,7 @@ public:
}
else
{
- ServerInstance->Log(DEBUG, "m_cgiirc.so: Invalid <cgihost:mask> value in config: %s", hostmask.c_str());
+ ServerInstance->Log(DEFAULT, "m_cgiirc.so: Invalid <cgihost:mask> value in config: %s", hostmask.c_str());
continue;
}
}
@@ -193,18 +193,12 @@ public:
virtual int OnUserRegister(userrec* user)
- {
- ServerInstance->Log(DEBUG, "m_cgiirc.so: User %s registering, %s %s", user->nick,user->host,user->GetIPString());
-
+ {
for(CGIHostlist::iterator iter = Hosts.begin(); iter != Hosts.end(); iter++)
- {
- ServerInstance->Log(DEBUG, "m_cgiirc.so: Matching %s against (%s or %s)", iter->hostmask.c_str(), user->host, user->GetIPString());
-
+ {
if(ServerInstance->MatchText(user->host, iter->hostmask) || ServerInstance->MatchText(user->GetIPString(), iter->hostmask))
{
// Deal with it...
- ServerInstance->Log(DEBUG, "m_cgiirc.so: Handling CGI:IRC user: %s (%s) matched %s", user->GetFullRealHost(), user->GetIPString(), iter->hostmask.c_str());
-
if(iter->type == PASS)
{
CheckPass(user); // We do nothing if it fails so...
@@ -231,8 +225,6 @@ public:
bool CheckPass(userrec* user)
{
- ServerInstance->Log(DEBUG, "m_cgiirc.so: CheckPass(%s) - %s", user->nick, user->password);
-
if(IsValidHost(user->password))
{
user->Extend("cgiirc_realhost", new std::string(user->host));
@@ -247,16 +239,12 @@ public:
#endif
{
/* We were given a IP in the password, we don't do DNS so they get this is as their host as well. */
- ServerInstance->Log(DEBUG, "m_cgiirc.so: Got an IP in the user's password");
-
if(NotifyOpers)
ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password);
}
else
{
/* We got as resolved hostname in the password. */
- ServerInstance->Log(DEBUG, "m_cgiirc.so: Got a hostname in the user's password");
-
try
{
bool cached;
@@ -277,10 +265,6 @@ public:
return true;
}
- else
- {
- ServerInstance->Log(DEBUG, "m_cgiirc.so: User's password was not a valid host");
- }
return false;
}
@@ -315,7 +299,6 @@ public:
try
{
- ServerInstance->Log(DEBUG,"MAKE RESOLVER: %s %d %s",newip, user->GetFd(), "IDENT");
bool cached;
CGIResolver* r = new CGIResolver(this, ServerInstance, NotifyOpers, newip, false, user, user->GetFd(), "IDENT", cached);
ServerInstance->AddResolver(r, cached);
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index c8459a705..76c8ccf81 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -94,7 +94,6 @@ class cmd_dccallow : public command_t
if (target)
{
- ServerInstance->Log(DEBUG, "m_dccallow.so: got target %s and action %c", target->nick, action);
if (action == '-')
{
@@ -347,7 +346,6 @@ class ModuleDCCAllow : public Module
tokens.push_back(buf);
irc::string type = tokens[1].c_str();
- ServerInstance->Log(DEBUG, "m_dccallow.so: got DCC type %s", type.c_str());
bool blockchat = Conf->ReadFlag("dccallow", "blockchat", 0);
@@ -424,7 +422,6 @@ class ModuleDCCAllow : public Module
else
{
RemoveFromUserlist(u);
- ServerInstance->Log(DEBUG, "m_dccallow.so: UH OH! Couldn't get DCCALLOW list for %s", u->nick);
}
}
}
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index 713924110..4391272e1 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -59,8 +59,6 @@ class DNSBLResolver : public Resolver
/* Check the user still exists */
if ((them) && (them == ServerInstance->SE->GetRef(theirfd)))
{
- ServerInstance->Log(DEBUG, "m_dnsbl: %s got a result from dnsbl %s", them->nick, ConfEntry->name.c_str());
-
// Now we calculate the bitmask: 256*(256*(256*a+b)+c)+d
if(result.length())
{
@@ -139,17 +137,6 @@ class DNSBLResolver : public Resolver
virtual void OnError(ResolverError e, const std::string &errormessage)
{
- /*
- this just means they don't appear in the respective dnsbl
- if ((them) && (them == ServerInstance->SE->GetRef(theirfd)))
- {
- }
- */
- /* Check the user still exists */
- if ((them) && (them == ServerInstance->SE->GetRef(theirfd)))
- {
- ServerInstance->Log(DEBUG, "m_dnsbl: %s got an error while resolving for dnsbl %s", them->nick, ConfEntry->name.c_str());
- }
}
virtual ~DNSBLResolver()
@@ -304,8 +291,6 @@ class ModuleDNSBL : public Module
// Fill hostname with a dnsbl style host (d.c.b.a.domain.tld)
std::string hostname=reversedip+"."+ (*i)->domain;
- ServerInstance->Log(DEBUG, "m_dnsbl: sending %s for resolution", hostname.c_str());
-
/* now we'd need to fire off lookups for `hostname'. */
bool cached;
DNSBLResolver *r = new DNSBLResolver(this, ServerInstance, hostname, user, user->GetFd(), *i, cached);
diff --git a/src/modules/m_http_client.cpp b/src/modules/m_http_client.cpp
index 4b3edca55..b0fcccd47 100644
--- a/src/modules/m_http_client.cpp
+++ b/src/modules/m_http_client.cpp
@@ -231,7 +231,6 @@ void HTTPSocket::Connect(const string &ip)
if (!this->DoConnect())
{
- Server->Log(DEBUG, "Unable to connect HTTPSocket to %s", this->host);
delete this;
}
}
@@ -311,12 +310,9 @@ bool HTTPSocket::OnDataReady()
void HTTPSocket::OnClose()
{
- if (!data.length())
- {
- Server->Log(DEBUG, "HTTP socket closed unexpectedly (no content recieved)");
+ if (data.empty())
return;
- }
- Server->Log(DEBUG, "Got file from HTTP successfully");
+
response->data = data;
response->Send();
delete response;
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index dc1785af5..b2ede6619 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -73,7 +73,6 @@ class HttpServerSocket : public InspSocket
HttpServerSocket(InspIRCd* SI, std::string host, int port, bool listening, unsigned long maxtime, FileReader* index_page) : InspSocket(SI, host, port, listening, maxtime), index(index_page), postsize(0)
{
- SI->Log(DEBUG,"HttpServerSocket constructor");
InternalState = HTTP_LISTEN;
Timeout = NULL;
}
@@ -267,11 +266,9 @@ class HttpServerSocket : public InspSocket
}
else
{
- Instance->Log(DEBUG,"%d bytes to read for POST",postsize);
std::string::size_type x = headers.str().find("\r\n\r\n");
postdata = headers.str().substr(x+4, headers.str().length());
/* Get content length and store */
- Instance->Log(DEBUG,"Initial postdata: '%s'", postdata.c_str());
if (postdata.length() >= postsize)
ServeData();
}
@@ -325,7 +322,6 @@ class HttpServerSocket : public InspSocket
if (!claimed)
{
SendHeaders(0, 404, "");
- Instance->Log(DEBUG,"Page not claimed, 404");
}
}
}
@@ -335,7 +331,6 @@ class HttpServerSocket : public InspSocket
void Page(std::stringstream* n, int response, std::string& extraheaders)
{
- Instance->Log(DEBUG,"Sending page");
SendHeaders(n->str().length(), response, extraheaders);
this->Write(n->str());
}
@@ -392,7 +387,6 @@ class ModuleHttpServer : public Module
char* OnRequest(Request* request)
{
- ServerInstance->Log(DEBUG,"Got HTTPDocument object");
claimed = true;
HTTPDocument* doc = (HTTPDocument*)request->GetData();
HttpServerSocket* sock = (HttpServerSocket*)doc->sock;
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index eb9933ecc..961885677 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -164,8 +164,6 @@ class ModuleHttpStats : public Module
HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/html; charset=iso-8859-1\r\n");
Request req((char*)&response, (Module*)this, event->GetSource());
req.Send();
-
- ServerInstance->Log(DEBUG,"Sent");
}
}
}
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index 579fa8816..01b268edd 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -87,7 +87,6 @@ class RFC1413 : public InspSocket
if (this->Instance->IsIdent(section))
{
strlcpy(u->ident,section,IDENTMAX);
- Instance->Log(DEBUG,"IDENT SET: "+std::string(u->ident));
u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Found your ident: "+std::string(u->ident));
}
}
@@ -139,14 +138,13 @@ class RFC1413 : public InspSocket
virtual bool OnConnected()
{
- Instance->Log(DEBUG,"Ident: connected");
if (u && (Instance->SE->GetRef(ufd) == u))
{
uslen = sizeof(sock_us);
themlen = sizeof(sock_them);
if ((getsockname(this->u->GetFd(),(sockaddr*)&sock_us,&uslen) || getpeername(this->u->GetFd(), (sockaddr*)&sock_them, &themlen)))
{
- Instance->Log(DEBUG,"Ident: failed to get socket names, bailing");
+ Instance->Log(DEBUG,"BUG: Ident: failed to get socket names");
return false;
}
else
@@ -158,7 +156,6 @@ class RFC1413 : public InspSocket
snprintf(ident_request,127,"%d,%d\r\n",ntohs(sock_them.sin_port),ntohs(sock_us.sin_port));
#endif
this->Write(ident_request);
- Instance->Log(DEBUG,"Sent ident request, waiting for reply");
return true;
}
}
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index 1410c7d98..ed67a880a 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -117,7 +117,6 @@ class JoinFlood : public ModeHandler
if (adding)
{
- ServerInstance->Log(DEBUG,"Got parameter: '%s'",parameter.c_str());
char ndata[MAXBUF];
char* data = ndata;
strlcpy(ndata,parameter.c_str(),MAXBUF);
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index 68f3e53b4..4bb9f9dc1 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -80,8 +80,6 @@ class KickRejoin : public ModeHandler
}
else if (atoi(parameter.c_str()) > 0)
{
- ServerInstance->Log(DEBUG,"Got parameter: '%s'",parameter.c_str());
-
if (!channel->IsModeSet('J'))
{
parameter = ConvToStr(atoi(parameter.c_str()));
@@ -146,18 +144,14 @@ public:
delaylist* dl;
if (chan->GetExt("norejoinusers", dl))
{
- ServerInstance->Log(DEBUG, "m_kicknorejoin.so: got delay list, iterating over it");
std::vector<userrec*> itemstoremove;
for (delaylist::iterator iter = dl->begin(); iter != dl->end(); iter++)
{
- ServerInstance->Log(DEBUG, "m_kicknorejoin.so:\t[%s] => %d", iter->first->nick, iter->second);
if (iter->second > time(NULL))
{
- ServerInstance->Log(DEBUG, "m_kicknorejoin.so: still inside time slot");
if (iter->first == user)
{
- ServerInstance->Log(DEBUG, "m_kicknorejoin.so: and we have the right user");
user->WriteServ( "495 %s %s :You cannot rejoin this channel yet after being kicked (+J)", user->nick, chan->name);
return 1;
}
@@ -165,7 +159,6 @@ public:
else
{
// Expired record, remove.
- ServerInstance->Log(DEBUG, "m_kicknorejoin.so: record expired");
itemstoremove.push_back(iter->first);
}
}
@@ -194,8 +187,6 @@ public:
dl = new delaylist;
chan->Extend("norejoinusers", dl);
}
-
- ServerInstance->Log(DEBUG, "m_kicknorejoin.so: setting record for %s, %d second delay", user->nick, strtoint(chan->GetModeParameter('J')));
(*dl)[user] = time(NULL) + strtoint(chan->GetModeParameter('J'));
}
}
diff --git a/src/modules/m_oper_hash.cpp b/src/modules/m_oper_hash.cpp
index 23de60a7d..8c9ca0556 100644
--- a/src/modules/m_oper_hash.cpp
+++ b/src/modules/m_oper_hash.cpp
@@ -104,7 +104,6 @@ class ModuleOperHash : public Module
/* Build a map of them */
hashers[name.c_str()] = *m;
names.push_back(name);
- ServerInstance->Log(DEBUG, "Found HashRequest interface: '%s' -> '%08x'", name.c_str(), *m);
}
}
else
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index 16cc8a679..23fee34c3 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -121,44 +121,36 @@ class RemoveBase
if (ServerInstance->ULine(user->server) || ServerInstance->ULine(user->nick))
{
- ServerInstance->Log(DEBUG, "Setting ulevel to U");
ulevel = chartolevel("U");
}
if (user->GetExt(founderkey))
{
- ServerInstance->Log(DEBUG, "Setting ulevel to ~");
ulevel = chartolevel("~");
}
else if (user->GetExt(protectkey))
{
- ServerInstance->Log(DEBUG, "Setting ulevel to &");
ulevel = chartolevel("&");
}
else
{
- ServerInstance->Log(DEBUG, "Setting ulevel to %s", channel->GetPrefixChar(user));
ulevel = chartolevel(channel->GetPrefixChar(user));
}
/* Now it's the same idea, except for the target. If they're ulined make sure they get a higher level than the sender can */
if (ServerInstance->ULine(target->server) || ServerInstance->ULine(target->nick))
{
- ServerInstance->Log(DEBUG, "Setting tlevel to U");
tlevel = chartolevel("U");
}
else if (target->GetExt(founderkey))
{
- ServerInstance->Log(DEBUG, "Setting tlevel to ~");
tlevel = chartolevel("~");
}
else if (target->GetExt(protectkey))
{
- ServerInstance->Log(DEBUG, "Setting tlevel to &");
tlevel = chartolevel("&");
}
else
{
- ServerInstance->Log(DEBUG, "Setting tlevel to %s", channel->GetPrefixChar(target));
tlevel = chartolevel(channel->GetPrefixChar(target));
}
diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp
index 7441f0ea5..f718fbc88 100644
--- a/src/modules/m_safelist.cpp
+++ b/src/modules/m_safelist.cpp
@@ -86,14 +86,11 @@ class ListTimer : public InspTimer
go_again = true;
break;
}
-
- ServerInstance->Log(DEBUG, "m_safelist.so: resuming spool of list to client %s at channel %ld", u->nick, ld->list_position);
chan = NULL;
/* Attempt to fill up to 25% the user's sendq with /LIST output */
long amount_sent = 0;
do
{
- ServerInstance->Log(DEBUG,"Channel %ld",ld->list_position);
if (!ld->list_position)
u->WriteServ("321 %s Channel :Users Name",u->nick);
chan = ServerInstance->GetChannelIndex(ld->list_position);
@@ -107,7 +104,6 @@ class ListTimer : public InspTimer
{
int counter = snprintf(buffer, MAXBUF, "322 %s *", u->nick);
amount_sent += counter + ServerNameSize;
- ServerInstance->Log(DEBUG, "m_safelist.so: Sent %ld of safe %ld / 4", amount_sent, u->sendqmax);
u->WriteServ(std::string(buffer));
}
}
@@ -121,7 +117,6 @@ class ListTimer : public InspTimer
int counter = snprintf(buffer, MAXBUF, "322 %s %s %ld :[+%s] %s",u->nick, chan->name, users, chan->ChanModes(has_user), chan->topic);
/* Increment total plus linefeed */
amount_sent += counter + ServerNameSize;
- ServerInstance->Log(DEBUG, "m_safelist.so: Sent %ld of safe %ld / 4", amount_sent, u->sendqmax);
u->WriteServ(std::string(buffer));
}
}
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index 1eb089d0c..207079da0 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -33,14 +33,12 @@ class Channel_r : public ModeHandler
// only a u-lined server may add or remove the +r mode.
if ((ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server || (strchr(source->nick,'.'))))
{
- ServerInstance->Log(DEBUG,"Allowing cmode +r, server and nick are: '%s','%s'",source->nick,source->server);
channel->SetMode('r',adding);
return MODEACTION_ALLOW;
}
else
{
- ServerInstance->Log(DEBUG,"Only a server can set chanmode +r, server and nick are: '%s','%s'",source->nick,source->server);
- source->WriteServ("500 "+std::string(source->nick)+" :Only a server may modify the +r channel mode");
+ source->WriteServ("500 %s :Only a server may modify the +r channel mode", source->nick);
return MODEACTION_DENY;
}
}
@@ -60,7 +58,6 @@ class User_r : public ModeHandler
{
if ((adding && !dest->IsModeSet('r')) || (!adding && dest->IsModeSet('r')))
{
- ServerInstance->Log(DEBUG,"Allowing umode +r, server and nick are: '%s','%s'",source->nick,source->server);
dest->SetMode('r',adding);
return MODEACTION_ALLOW;
}
@@ -68,8 +65,7 @@ class User_r : public ModeHandler
}
else
{
- ServerInstance->Log(DEBUG,"Only a server can set umode +r, server and nick are: '%s','%s'",source->nick, source->server);
- source->WriteServ("500 "+std::string(source->nick)+" :Only a server may modify the +r user mode");
+ source->WriteServ("500 %s :Only a server may modify the +r user mode", source->nick);
return MODEACTION_DENY;
}
}
@@ -237,7 +233,7 @@ class ModuleServices : public Module
return 0;
}
// user messaging a +M channel and is not registered
- user->WriteServ("477 "+std::string(user->nick)+" "+std::string(c->name)+" :You need a registered nickname to speak on this channel");
+ user->WriteServ("477 %s %s :You need a registered nickname to speak on this channel", user->nick, c->name);
return 1;
}
}
@@ -252,7 +248,7 @@ class ModuleServices : public Module
return 0;
}
// user messaging a +R user and is not registered
- user->WriteServ("477 "+std::string(user->nick)+" "+std::string(u->nick)+" :You need a registered nickname to message this user");
+ user->WriteServ("477 %s %s :You need a registered nickname to message this user", user->nick, u->nick);
return 1;
}
}
@@ -278,7 +274,7 @@ class ModuleServices : public Module
return 0;
}
// joining a +R channel and not identified
- user->WriteServ("477 "+std::string(user->nick)+" "+std::string(chan->name)+" :You need a registered nickname to join this channel");
+ user->WriteServ("477 %s %s :You need a registered nickname to join this channel", user->nick, chan->name);
return 1;
}
}