Anope IRC Services  Version 2.0
Public Member Functions | Private Attributes
StaticFileServer Class Reference

#include <static_fileserver.h>

Inheritance diagram for StaticFileServer:
Inheritance graph
Collaboration diagram for StaticFileServer:
Collaboration graph

Public Member Functions

 StaticFileServer (const Anope::string &f_n, const Anope::string &u, const Anope::string &c_t)
bool OnRequest (HTTPProvider *, const Anope::string &, HTTPClient *, HTTPMessage &, HTTPReply &) anope_override
- Public Member Functions inherited from HTTPPage
 HTTPPage (const Anope::string &u, const Anope::string &ct="text/html")
const Anope::stringGetURL () const
const Anope::stringGetContentType () const
- Public Member Functions inherited from Base
 Base ()
virtual ~Base ()
void AddReference (ReferenceBase *r)
void DelReference (ReferenceBase *r)

Private Attributes

Anope::string file_name

Detailed Description

Definition at line 11 of file static_fileserver.h.

Constructor & Destructor Documentation

◆ StaticFileServer()

StaticFileServer::StaticFileServer ( const Anope::string f_n,
const Anope::string u,
const Anope::string c_t 

Definition at line 16 of file static_fileserver.cpp.

Member Function Documentation

◆ OnRequest()

bool StaticFileServer::OnRequest ( HTTPProvider ,
const Anope::string ,
HTTPClient ,
HTTPMessage ,

Called when this page is requested

Theserver this page is on
Thepage name
Theclient requesting the page
TheHTTP header sent from the client to request the page
TheHTTP header that will be sent back to the client

Implements HTTPPage.

Definition at line 20 of file static_fileserver.cpp.

References BUFSIZE, HTTPReply::content_type, file_name, HTTPPage::GetContentType(), HTTPReply::headers, HTTP_PAGE_NOT_FOUND, LOG_NORMAL, read, HTTPClient::SendError(), template_base, and HTTPReply::Write().

Field Documentation

◆ file_name

Anope::string StaticFileServer::file_name

Definition at line 13 of file static_fileserver.h.

Referenced by OnRequest().

The documentation for this class was generated from the following files: