diff options
| author | Adam <Adam@anope.org> | 2012-10-07 22:39:58 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-10-07 22:39:58 -0400 |
| commit | b8b63ff115f0daddf479b0da507a2f731255a06d (patch) | |
| tree | d6b82bf0dfc39fdfe6a6a23ba318bb0c2906d6c1 /modules/extra/httpd.h | |
| parent | 0a111c19764ed14ab5f724c78d9dd8c08a3c124f (diff) | |
Remove the asynchronous identifing hack and replace it with something better. Fixes m_*_authentication only being able to properly work when people identify normally using nickserv/identify
Diffstat (limited to 'modules/extra/httpd.h')
| -rw-r--r-- | modules/extra/httpd.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/modules/extra/httpd.h b/modules/extra/httpd.h index 684c11512..d9e800d13 100644 --- a/modules/extra/httpd.h +++ b/modules/extra/httpd.h @@ -21,6 +21,23 @@ struct HTTPReply HTTPReply() : error(HTTP_ERROR_OK), length(0) { } + HTTPReply(const HTTPReply& other) : error(other.error), length(other.length) + { + content_type = other.content_type; + headers = other.headers; + cookies = other.cookies; + + for (unsigned i = 0; i < other.out.size(); ++i) + out.push_back(new Data(other.out[i]->buf, other.out[i]->len)); + } + + ~HTTPReply() + { + for (unsigned i = 0; i < out.size(); ++i) + delete out[i]; + out.clear(); + } + struct Data { char *buf; @@ -87,10 +104,10 @@ class HTTPPage : public Base * @param The HTTP header sent from the client to request the page * @param The HTTP header that will be sent back to the client */ - virtual void OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0; + virtual bool OnRequest(HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) = 0; }; -class HTTPClient : public ClientSocket, public BufferedSocket, public BinarySocket +class HTTPClient : public ClientSocket, public BufferedSocket, public BinarySocket, public Base { protected: void WriteClient(const Anope::string &message) |
