Anope IRC Services
Version 2.0
|
Public Member Functions | |
MyHTTPClient (HTTPProvider *l, int f, const sockaddrs &a) | |
~MyHTTPClient () | |
bool | ProcessWrite () anope_override |
const Anope::string | GetIP () anope_override |
bool | Read (const char *buffer, size_t l) anope_override |
bool | Read (const Anope::string &buf) |
void | SendError (HTTPError err, const Anope::string &msg) anope_override |
void | SendReply (HTTPReply *msg) anope_override |
![]() | |
HTTPClient (ListenSocket *l, int f, const sockaddrs &a) | |
![]() | |
ClientSocket (ListenSocket *ls, const sockaddrs &addr) | |
bool | Process () anope_override |
void | ProcessError () anope_override |
virtual void | OnAccept () |
virtual void | OnError (const Anope::string &error) |
![]() | |
Socket () | |
Socket (int sock, bool ipv6=false, int type=SOCK_STREAM) | |
virtual | ~Socket () |
int | GetFD () const |
bool | IsIPv6 () const |
bool | SetBlocking (bool state) |
void | Bind (const Anope::string &ip, int port=0) |
![]() | |
BinarySocket () | |
virtual | ~BinarySocket () |
bool | ProcessRead () anope_override |
virtual void | Write (const char *buffer, size_t l) |
void | Write (const char *message,...) |
void | Write (const Anope::string &message) |
![]() | |
Base () | |
virtual | ~Base () |
void | AddReference (ReferenceBase *r) |
void | DelReference (ReferenceBase *r) |
Data Fields | |
time_t | created |
![]() | |
ListenSocket * | ls |
sockaddrs | clientaddr |
![]() | |
std::bitset< SF_SIZE > | flags |
sockaddrs | bindaddr |
SocketIO * | io |
Private Types | |
enum | { ACTION_NONE, ACTION_GET, ACTION_POST } |
Private Member Functions | |
void | Serve () |
Private Attributes | |
HTTPProvider * | provider |
HTTPMessage | message |
bool | header_done |
bool | served |
Anope::string | page_name |
Reference< HTTPPage > | page |
Anope::string | ip |
unsigned | content_length |
enum MyHTTPClient:: { ... } | action |
Additional Inherited Members | |
![]() | |
void | WriteClient (const Anope::string &message) |
![]() | |
int | sock |
bool | ipv6 |
![]() | |
std::deque< DataBlock * > | write_buffer |
Definition at line 39 of file m_httpd.cpp.
|
private |
Enumerator | |
---|---|
ACTION_NONE | |
ACTION_GET | |
ACTION_POST |
Definition at line 50 of file m_httpd.cpp.
|
inline |
Definition at line 96 of file m_httpd.cpp.
References sockaddrs::addr(), and LOG_DEBUG.
|
inline |
Definition at line 101 of file m_httpd.cpp.
References Socket::GetFD(), ip, and LOG_DEBUG.
|
inlinevirtual |
|
inlinevirtual |
Called when the socket is ready to be written to
Reimplemented from BinarySocket.
Definition at line 107 of file m_httpd.cpp.
References BinarySocket::ProcessWrite(), and BinarySocket::write_buffer.
|
inlinevirtual |
Called with data from the socket
buffer | The data |
l | The length of buffer |
Reimplemented from BinarySocket.
Definition at line 117 of file m_httpd.cpp.
References sockaddrs::addr(), Anope::string::append(), ClientSocket::clientaddr, HTTPMessage::content, content_length, Anope::string::empty(), Anope::string::find(), sepstream::GetToken(), Anope::string::length(), LOG_DEBUG_2, Anope::string::npos, HTTPMessage::post_data, Serve(), Anope::string::substr(), Anope::string::trim(), and HTTPUtils::URLDecode().
|
inline |
Definition at line 155 of file m_httpd.cpp.
References action, ACTION_GET, ACTION_NONE, ACTION_POST, sockaddrs::addr(), ClientSocket::clientaddr, HTTPMessage::cookies, Anope::string::find(), HTTPProvider::FindPage(), HTTPMessage::get_data, sepstream::GetTokens(), HTTPMessage::headers, HTTP_BAD_REQUEST, Anope::string::length(), LOG_DEBUG_2, Anope::string::npos, SendError(), Anope::string::substr(), and HTTPUtils::URLDecode().
|
inlinevirtual |
Implements HTTPClient.
Definition at line 235 of file m_httpd.cpp.
References HTTPReply::error, SendReply(), and HTTPReply::Write().
|
inlinevirtual |
Implements HTTPClient.
Definition at line 246 of file m_httpd.cpp.
References HTTPReply::Data::buf, BuildDate(), Anope::string::erase(), GetStatusFromCode(), HTTPReply::Data::len, Anope::string::length(), stringify(), Anope::VersionShort(), BinarySocket::Write(), and HTTPClient::WriteClient().
Referenced by SendError(), and Serve().
|
inlineprivate |
Definition at line 57 of file m_httpd.cpp.
References HTTPReply::content_type, HTTPProvider::ext_headers, HTTPProvider::ext_ip, HTTPPage::GetContentType(), Socket::GetFD(), HTTPMessage::headers, HTTP_PAGE_NOT_FOUND, ip, LOG_DEBUG, HTTPPage::OnRequest(), SendError(), and SendReply().
Referenced by Read().
enum { ... } MyHTTPClient::action |
Referenced by Read().
|
private |
Definition at line 48 of file m_httpd.cpp.
Referenced by Read().
time_t MyHTTPClient::created |
Definition at line 94 of file m_httpd.cpp.
Referenced by MyHTTPProvider::Tick().
|
private |
Definition at line 43 of file m_httpd.cpp.
|
private |
Definition at line 46 of file m_httpd.cpp.
Referenced by GetIP(), Serve(), and ~MyHTTPClient().
|
private |
Definition at line 42 of file m_httpd.cpp.
Definition at line 45 of file m_httpd.cpp.
|
private |
Definition at line 44 of file m_httpd.cpp.
|
private |
Definition at line 41 of file m_httpd.cpp.
|
private |
Definition at line 43 of file m_httpd.cpp.