summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/inspsocket.cpp2
-rw-r--r--src/modules/m_http.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp
index 4264700f5..cc0368525 100644
--- a/src/inspsocket.cpp
+++ b/src/inspsocket.cpp
@@ -73,12 +73,12 @@ InspSocket::InspSocket(const std::string &ahost, int aport, bool listening, unsi
{
if (!BindSocket(this->fd,this->client,this->server,aport,(char*)ahost.c_str()))
{
+ log(DEBUG,"BindSocket() error %s",strerror(errno));
this->Close();
this->fd = -1;
this->state = I_ERROR;
this->OnError(I_ERR_BIND);
this->ClosePending = true;
- log(DEBUG,"BindSocket() error %s",strerror(errno));
return;
}
else
diff --git a/src/modules/m_http.cpp b/src/modules/m_http.cpp
index 59293e7a9..6cb95fa55 100644
--- a/src/modules/m_http.cpp
+++ b/src/modules/m_http.cpp
@@ -20,6 +20,8 @@ using namespace std;
#include "users.h"
#include "channels.h"
#include "modules.h"
+#include "inspsocket.h"
+#include "helperfuncs.h"
/* $ModDesc: Provides HTTP serving facilities to modules */
@@ -42,6 +44,7 @@ class HttpSocket : public InspSocket
HttpSocket(std::string host, int port, bool listening, unsigned long maxtime, FileReader* index_page) : InspSocket(host, port, listening, maxtime), index(index_page)
{
+ log(DEBUG,"HttpSocket constructor");
InternalState = HTTP_LISTEN;
}
@@ -57,6 +60,7 @@ class HttpSocket : public InspSocket
HttpSocket* s = new HttpSocket(newsock, ip);
Srv->AddSocket(s);
}
+ return true;
}
virtual void OnClose()
@@ -78,6 +82,7 @@ class HttpSocket : public InspSocket
this->Write("<HTML><H1>COWS.</H1></HTML>");
}
}
+ return true;
}
};
@@ -107,7 +112,7 @@ class ModuleHttp : public Module
void CreateListener()
{
- http = new HttpSocket(this->host, this->port, true, 0, &index);
+ http = new HttpSocket(this->bindip, this->port, true, 0, &index);
Srv->AddSocket(http);
}