#include "inspircd.h"
#include <sqlite3.h>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
#include "m_sqlv2.h"
/* $ModDesc: sqlite3 provider */
virtual bool OnDataReady()
{
char data = 0;
- if (Instance->SE->Recv(this, &data, 1, 0) > 0)
+ if (ServerInstance->SE->Recv(this, &data, 1, 0) > 0)
{
Dispatch();
return true;
class SQLiteListener : public ListenSocketBase
{
ModuleSQLite3* Parent;
- insp_sockaddr sock_us;
+ irc::sockets::insp_sockaddr sock_us;
socklen_t uslen;
FileReader* index;
{
private:
ResultQueue results;
- InspIRCd* Instance;
+ InspIRCd* ServerInstance;
Module* mod;
SQLhost host;
sqlite3* conn;
public:
SQLConn(InspIRCd* SI, Module* m, const SQLhost& hi)
- : Instance(SI), mod(m), host(hi)
+ : ServerInstance(SI), mod(m), host(hi)
{
if (OpenDB() != SQLITE_OK)
{
- Instance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + host.id);
+ ServerInstance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + host.id);
CloseDB();
}
}
/* Total length of the unescaped parameters */
unsigned long paramlen;
- /* Total length of query, used for binary-safety in mysql_real_query */
+ /* Total length of query, used for binary-safety */
unsigned long querylength = 0;
paramlen = 0;
/* To avoid a lot of allocations, allocate enough memory for the biggest the escaped query could possibly be.
* sizeofquery + (totalparamlength*2) + 1
*
- * The +1 is for null-terminating the string for mysql_real_escape_string
+ * The +1 is for null-terminating the string
*/
query = new char[req.query.q.length() + (paramlen*2) + 1];
queryend = query;
return;
}
- insp_sockaddr addr;
+ irc::sockets::insp_sockaddr addr;
#ifdef IPV6
- insp_aton("::1", &addr.sin6_addr);
+ irc::sockets::insp_aton("::1", &addr.sin6_addr);
addr.sin6_family = AF_FAMILY;
addr.sin6_port = htons(listener->GetPort());
#else
- insp_inaddr ia;
- insp_aton("127.0.0.1", &ia);
+ irc::sockets::insp_inaddr ia;
+ irc::sockets::insp_aton("127.0.0.1", &ia);
addr.sin_family = AF_FAMILY;
addr.sin_addr = ia;
addr.sin_port = htons(listener->GetPort());
ClearAllConnections();
ServerInstance->SE->DelFd(listener);
- //listener->Close();
ServerInstance->BufferedSocketCull();
if (QueueFD >= 0)