summaryrefslogtreecommitdiff
path: root/modules/extra
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-09-16 06:28:48 -0400
committerAdam <Adam@anope.org>2013-09-16 06:47:42 -0400
commite3c05efe5e5085f3db14f1532a92de460b899ab5 (patch)
treea486474c1eff7e04a7167c1d069d23a93406e171 /modules/extra
parent8cbaf7e9904e3cc6aca22566c83ea25959357d48 (diff)
Remove static variables from functions in modules which causes them to be marked as gnu unique objects, which breaks dlclose()/dlopen() on g++ 4.5+
Diffstat (limited to 'modules/extra')
-rw-r--r--modules/extra/m_ldap.cpp4
-rw-r--r--modules/extra/m_xmlrpc.cpp44
2 files changed, 24 insertions, 24 deletions
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp
index 4bceb0a61..01e927633 100644
--- a/modules/extra/m_ldap.cpp
+++ b/modules/extra/m_ldap.cpp
@@ -80,7 +80,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition
int i = ldap_initialize(&this->con, this->server.c_str());
if (i != LDAP_SUCCESS)
throw LDAPException("Unable to connect to LDAP service " + this->name + ": " + ldap_err2string(i));
- static const int version = LDAP_VERSION3;
+ const int version = LDAP_VERSION3;
i = ldap_set_option(this->con, LDAP_OPT_PROTOCOL_VERSION, &version);
if (i != LDAP_OPT_SUCCESS)
throw LDAPException("Unable to set protocol version for " + this->name + ": " + ldap_err2string(i));
@@ -269,7 +269,7 @@ class LDAPService : public LDAPProvider, public Thread, public Condition
break;
}
- static struct timeval tv = { 1, 0 };
+ struct timeval tv = { 1, 0 };
LDAPMessage *result;
int rtype = ldap_result(this->con, LDAP_RES_ANY, 1, &tv, &result);
if (rtype <= 0 || this->GetExitState())
diff --git a/modules/extra/m_xmlrpc.cpp b/modules/extra/m_xmlrpc.cpp
index 3c16f997e..36401b800 100644
--- a/modules/extra/m_xmlrpc.cpp
+++ b/modules/extra/m_xmlrpc.cpp
@@ -3,6 +3,28 @@
#include "modules/xmlrpc.h"
#include "modules/httpd.h"
+static struct special_chars
+{
+ Anope::string character;
+ Anope::string replace;
+
+ special_chars(const Anope::string &c, const Anope::string &r) : character(c), replace(r) { }
+}
+special[] = {
+ special_chars("&", "&amp;"),
+ special_chars("\"", "&quot;"),
+ special_chars("<", "&lt;"),
+ special_chars(">", "&qt;"),
+ special_chars("'", "&#39;"),
+ special_chars("\n", "&#xA;"),
+ special_chars("\002", ""), // bold
+ special_chars("\003", ""), // color
+ special_chars("\035", ""), // italics
+ special_chars("\037", ""), // underline
+ special_chars("\026", ""), // reverses
+ special_chars("", "")
+};
+
class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage
{
std::deque<XMLRPCEvent *> events;
@@ -25,28 +47,6 @@ class MyXMLRPCServiceInterface : public XMLRPCServiceInterface, public HTTPPage
Anope::string Sanitize(const Anope::string &string) anope_override
{
- static struct special_chars
- {
- Anope::string character;
- Anope::string replace;
-
- special_chars(const Anope::string &c, const Anope::string &r) : character(c), replace(r) { }
- }
- special[] = {
- special_chars("&", "&amp;"),
- special_chars("\"", "&quot;"),
- special_chars("<", "&lt;"),
- special_chars(">", "&qt;"),
- special_chars("'", "&#39;"),
- special_chars("\n", "&#xA;"),
- special_chars("\002", ""), // bold
- special_chars("\003", ""), // color
- special_chars("\035", ""), // italics
- special_chars("\037", ""), // underline
- special_chars("\026", ""), // reverses
- special_chars("", "")
- };
-
Anope::string ret = string;
for (int i = 0; special[i].character.empty() == false; ++i)
ret = ret.replace_all_cs(special[i].character, special[i].replace);