mirror of
https://github.com/anope/anope.git
synced 2026-06-29 00:06:39 +02:00
Move HTTP types to the HTTP namespace.
This commit is contained in:
@@ -13,18 +13,18 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
StaticFileServer::StaticFileServer(const Anope::string &f_n, const Anope::string &u, const Anope::string &c_t) : HTTPPage(u, c_t), file_name(f_n)
|
||||
StaticFileServer::StaticFileServer(const Anope::string &f_n, const Anope::string &u, const Anope::string &c_t) : HTTP::Page(u, c_t), file_name(f_n)
|
||||
{
|
||||
}
|
||||
|
||||
bool StaticFileServer::OnRequest(HTTPProvider *server, const Anope::string &page_name, HTTPClient *client, HTTPMessage &message, HTTPReply &reply)
|
||||
bool StaticFileServer::OnRequest(HTTP::Provider *server, const Anope::string &page_name, HTTP::Client *client, HTTP::Message &message, HTTP::Reply &reply)
|
||||
{
|
||||
int fd = open((template_base + "/" + this->file_name).c_str(), O_RDONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
Log(LOG_NORMAL, "httpd") << "Error serving file " << page_name << " (" << (template_base + "/" + this->file_name) << "): " << strerror(errno);
|
||||
|
||||
client->SendError(HTTP_PAGE_NOT_FOUND, "Page not found");
|
||||
client->SendError(HTTP::PAGE_NOT_FOUND, "Page not found");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user