public:
- HttpServerSocket(InspIRCd* SI, std::string host, int port, bool listening, unsigned long maxtime, FileReader* index_page) : BufferedSocket(SI, host, port, listening, maxtime), index(index_page), postsize(0)
+ HttpServerSocket(InspIRCd* SI, std::string shost, int iport, bool listening, unsigned long maxtime, FileReader* index_page) : BufferedSocket(SI, shost, iport, listening, maxtime), index(index_page), postsize(0)
{
InternalState = HTTP_LISTEN;
Timeout = NULL;
virtual bool OnDataReady()
{
- char* data = this->Read();
+ const char* data = this->Read();
/* Check that the data read is a valid pointer and it has some content */
if (!data || !*data)
if (reqbuffer.length() >= 8192)
{
- Instance->Log(DEBUG, "m_httpd dropped connection due to an oversized request buffer");
+ Instance->Logs->Log("m_httpd",DEBUG, "m_httpd dropped connection due to an oversized request buffer");
reqbuffer.clear();
return false;
}
}
}
- void Page(std::stringstream* n, int response, HTTPHeaders *headers)
+ void Page(std::stringstream* n, int response, HTTPHeaders *hheaders)
{
- SendHeaders(n->str().length(), response, *headers);
+ SendHeaders(n->str().length(), response, *hheaders);
this->Write(n->str());
if (!keepalive)
ServerInstance->Modules->Attach(eventlist, this, 1);
}
- char* OnRequest(Request* request)
+ virtual const char* OnRequest(Request* request)
{
claimed = true;
HTTPDocument* doc = (HTTPDocument*)request->GetData();
virtual Version GetVersion()
{
- return Version(1,1,0,0,VF_VENDOR|VF_SERVICEPROVIDER,API_VERSION);
+ return Version(1,2,0,0,VF_VENDOR|VF_SERVICEPROVIDER,API_VERSION);
}
};