summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_sql.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-21 12:15:56 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-21 12:15:56 +0000
commit2eafeefbb1d2f96a5c59874a93d22cd6721ecde4 (patch)
tree0799ee94c32714f2ac6ce2d8c2dc450473ccfbbf /src/modules/extra/m_sql.cpp
parentf7a0c180d8d6dc4618b53892c04ca7af64e0841e (diff)
New stuff actually compiles now
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1150 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_sql.cpp')
-rw-r--r--src/modules/extra/m_sql.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/modules/extra/m_sql.cpp b/src/modules/extra/m_sql.cpp
index 489f2ddd4..d2b5802de 100644
--- a/src/modules/extra/m_sql.cpp
+++ b/src/modules/extra/m_sql.cpp
@@ -220,13 +220,13 @@ class ModuleSQL : public Module
{
for (ConnectionList::iterator i = Connections.begin(); i != Connections.end(); i++)
{
- if ((i->GetID() == r->GetConnID()) && (i->Enabled()))
+ if ((i->GetID() == r->GetConnID()) && (i->IsEnabled()))
{
bool xr = i->QueryResult(r->GetQuery());
if (!xr)
{
res->SetType(SQL_ERROR);
- res->SetError(r->GetError());
+ res->SetError(i->GetError());
return;
}
}
@@ -237,7 +237,7 @@ class ModuleSQL : public Module
{
for (ConnectionList::iterator i = Connections.begin(); i != Connections.end(); i++)
{
- if ((i->GetID() == r->GetConnID()) && (i->Enabled()))
+ if ((i->GetID() == r->GetConnID()) && (i->IsEnabled()))
{
res->SetType(SQL_COUNT);
res->SetCount(i->QueryCount(r->GetQuery()));
@@ -250,7 +250,7 @@ class ModuleSQL : public Module
{
for (ConnectionList::iterator i = Connections.begin(); i != Connections.end(); i++)
{
- if ((i->GetID() == r->GetConnID()) && (i->Enabled()))
+ if ((i->GetID() == r->GetConnID()) && (i->IsEnabled()))
{
std::map<std::string,std::string> row = i->GetRow();
res->SetRow(row);
@@ -264,21 +264,25 @@ class ModuleSQL : public Module
char* OnRequest(Request* request)
{
- SQLResult Result = new SQLResult();
- SQLRequest *r = (SQLRequest*)request;
- switch (r->GetRequest())
+ if (request)
{
- case SQL_RESULT:
- ResultType(r,Result);
- break;
- case SQL_COUNT:
- CountType(r,Result);
- break;
- case SQL_ROW:
- RowType(r,Result);
- break;
+ SQLResult* Result = new SQLResult();
+ SQLRequest *r = (SQLRequest*)request->GetData();
+ switch (r->GetQueryType())
+ {
+ case SQL_RESULT:
+ ResultType(r,Result);
+ break;
+ case SQL_COUNT:
+ CountType(r,Result);
+ break;
+ case SQL_ROW:
+ RowType(r,Result);
+ break;
+ }
+ return (char*)Result;
}
- return Result;
+ return NULL;
}
ModuleSQL()