* ---------------------------------------------------
*/
-#include "inspircd_config.h"
-#include "configreader.h"
+#include "inspircd.h"
#include "users.h"
#include "channels.h"
#include "modules.h"
#include "hashcomp.h"
-#include "inspircd.h"
/* $ModDesc: Provides XMLSocket support for clients */
public:
ModuleXMLSocket(InspIRCd* Me)
- : Module::Module(Me)
+ : Module(Me)
{
OnRehash(NULL,"");
}
for (int i = 0; i < Conf->Enumerate("bind"); i++)
{
// For each <bind> tag
- if (((Conf->ReadValue("bind", "type", i) == "") || (Conf->ReadValue("bind", "type", i) == "clients")) && (Conf->ReadFlag("bind", "xmlsocket", i)))
+ std::string x = Conf->ReadValue("bind", "type", i);
+ if (((x.empty()) || (x == "clients")) && (Conf->ReadFlag("bind", "xmlsocket", i)))
{
// Get the port we're meant to be listening on with SSL
std::string port = Conf->ReadValue("bind", "port", i);
return -1;
/* We want to alter the buffer, so we have to make a copy */
- char tmpbuffer[count+1];
+ char * tmpbuffer = new char[count + 1];
memcpy(tmpbuffer, buffer, count);
/* XXX: This will actually generate lines "looking\0\0like\0\0this"
tmpbuffer[n] = 0;
user->AddWriteBuf(std::string(tmpbuffer,count));
+ delete [] tmpbuffer;
return 1;
}
};
-class ModuleXMLSocketFactory : public ModuleFactory
-{
- public:
- ModuleXMLSocketFactory()
- {
- }
+MODULE_INIT(ModuleXMLSocket)
- ~ModuleXMLSocketFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleXMLSocket(Me);
- }
-};
-
-
-extern "C" void * init_module( void )
-{
- return new ModuleXMLSocketFactory;
-}