summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-11 14:05:52 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-11 14:05:52 +0000
commit1e4120dd22e70782a72057a0d41f35daffbd6b01 (patch)
treeaa60213c87e48818ef0ba7afade82090da0e6bd9 /src/modules
parent1ce6fe7525c8213682d6cfca2acd9420d4e72f36 (diff)
Craq fixing
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4330 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/httpd.h9
-rw-r--r--src/modules/m_httpd.cpp5
2 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/httpd.h b/src/modules/httpd.h
index 3f8ee215c..5ac4d0c85 100644
--- a/src/modules/httpd.h
+++ b/src/modules/httpd.h
@@ -52,7 +52,10 @@ class HTTPDocument : public classbase
int responsecode;
public:
- HTTPDocument(std::stringstream* doc, int response) : document(doc), responsecode(response)
+
+ void* sock;
+
+ HTTPDocument(void* opaque, std::stringstream* doc, int response) : document(doc), responsecode(response), sock(opaque)
{
}
@@ -61,9 +64,9 @@ class HTTPDocument : public classbase
return this->document;
}
- std::stringstream* GetDocumentSize()
+ unsigned long GetDocumentSize()
{
- return this->document.size();
+ return this->document->str().length();
}
int GetResponseCode()
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index 3bfc8d16a..7d670ea2b 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -232,7 +232,7 @@ class HttpSocket : public InspSocket
void Page(std::stringstream* n, int response)
{
- SendHeaders(n->size(),response);
+ SendHeaders(n->str().length(),response);
this->Write(n->str());
}
};
@@ -284,6 +284,9 @@ class ModuleHttp : public Module
char* OnRequest(Request* request)
{
claimed = true;
+ HTTPDocument* doc = (HTTPDocument*)request->GetData();
+ HttpSocket* sock = (HttpSocket*)doc->sock;
+ sock->Page(doc->GetDocument(), doc->GetResponseCode());
return NULL;
}