summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-19 14:53:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-19 14:53:06 +0000
commit6824a483e3bc4a584b998929ac066dda2ae24c8b (patch)
tree9e1837d8031169781029b65cb7e4796f15c422e6
parent99e1325d666d9617217cc44d48c1a1c381e83f21 (diff)
Apparently to catch descendent classes we need to catch a reference to the parent, not the parent itself
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3242 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/modules.h4
-rw-r--r--src/helperfuncs.cpp14
-rw-r--r--src/inspircd.cpp4
-rw-r--r--src/userprocess.cpp5
-rw-r--r--src/users.cpp4
5 files changed, 16 insertions, 15 deletions
diff --git a/include/modules.h b/include/modules.h
index 600d51a4c..07da2989f 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -97,7 +97,7 @@ typedef std::deque<userrec*> chanuserlist;
{ \
modules[_i]->x ; \
} \
- catch (ModuleException modexcept) \
+ catch (ModuleException& modexcept) \
{ \
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
} \
@@ -122,7 +122,7 @@ typedef std::deque<userrec*> chanuserlist;
break; \
} \
} \
- catch (ModuleException modexcept) \
+ catch (ModuleException& modexcept) \
{ \
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
} \
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 0255de227..c6e1bcd10 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -139,7 +139,7 @@ void Write_NoFormat(int sock, const char *text)
{
Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
@@ -177,7 +177,7 @@ void Write(int sock,char *text, ...)
{
Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
@@ -206,7 +206,7 @@ void WriteServ_NoFormat(int sock, const char* text)
{
Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
@@ -246,7 +246,7 @@ void WriteServ(int sock, char* text, ...)
{
Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
@@ -275,7 +275,7 @@ void WriteFrom_NoFormat(int sock, userrec *user, const char* text)
{
Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
@@ -315,7 +315,7 @@ void WriteFrom(int sock, userrec *user,char* text, ...)
{
Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
@@ -1386,7 +1386,7 @@ void ShowMOTD(userrec *user)
{
Config->GetIOHook(user->port)->OnRawSocketWrite(user->fd,(char*)WholeMOTD.c_str(),WholeMOTD.length());
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index de9f64781..0f4a9488e 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -524,7 +524,7 @@ bool InspIRCd::LoadModule(const char* filename)
return false;
}
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEFAULT,"Unable to load %s: ",modfile,modexcept.GetReason());
snprintf(MODERR,MAXBUF,"Factory function threw an exception: %s",modexcept.GetReason());
@@ -754,7 +754,7 @@ int InspIRCd::Run()
{
Config->GetIOHook(in_port)->OnRawSocketAccept(incomingSockfd, (char*)inet_ntoa(client.sin_addr), in_port);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
diff --git a/src/userprocess.cpp b/src/userprocess.cpp
index 888d0572f..fae96721d 100644
--- a/src/userprocess.cpp
+++ b/src/userprocess.cpp
@@ -88,12 +88,13 @@ void ProcessUser(userrec* cu)
if (Config->GetIOHook(cu->port))
{
int result2 = 0;
+ int MOD_RESULT = 0;
try
{
- int MOD_RESULT = Config->GetIOHook(cu->port)->OnRawSocketRead(cu->fd,data,65535,result2);
+ MOD_RESULT = Config->GetIOHook(cu->port)->OnRawSocketRead(cu->fd,data,65535,result2);
log(DEBUG,"Data result returned by module: %d",MOD_RESULT);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
diff --git a/src/users.cpp b/src/users.cpp
index f2aa4950f..c89286273 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -413,7 +413,7 @@ void kill_link(userrec *user,const char* r)
{
Config->GetIOHook(user->port)->OnRawSocketClose(user->fd);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}
@@ -483,7 +483,7 @@ void kill_link_silent(userrec *user,const char* r)
{
Config->GetIOHook(user->port)->OnRawSocketClose(user->fd);
}
- catch (ModuleException modexcept)
+ catch (ModuleException& modexcept)
{
log(DEBUG,"Module exception cought: %s",modexcept.GetReason()); \
}