17 #ifndef ZNC_HTTPSOCK_H
18 #define ZNC_HTTPSOCK_H
20 #include <znc/zncconfig.h>
30 const CString& sHostname,
unsigned short uPort,
35 void ReadData(
const char* data,
size_t len)
override;
52 unsigned int uStatusId = 200,
53 const CString& sStatusMsg =
"OK");
62 std::map<CString, VCString>& msvsParams);
93 const CString& sFilter =
"\r\n")
const;
96 const std::map<CString, VCString>&
GetParams(
bool bPost =
true)
const;
99 const CString& sFilter =
"\r\n")
const;
102 const CString& sFilter =
"\r\n")
const;
106 const std::map<CString, VCString>& msvsParams);
108 const std::map<CString, VCString>& msvsParams,
111 const std::map<CString, VCString>& msvsParams,
114 const std::map<CString, VCString>& msvsParams,
117 void WriteFileUncompressed(
CFile& File);
118 void WriteFileGzipped(
CFile& File);
std::vector< CString > VCString
Definition: ZNCString.h:38
Definition: FileUtils.h:30
Definition: HTTPSock.h:26
Csock * GetSockObj(const CString &sHost, unsigned short uPort) override=0
std::map< CString, VCString > m_msvsPOSTParams
Definition: HTTPSock.h:138
MCString m_msRequestCookies
Definition: HTTPSock.h:144
void AddHeader(const CString &sName, const CString &sValue)
bool HasParam(const CString &sName, bool bPost=true) const
CString m_sUser
Definition: HTTPSock.h:133
void ReadData(const char *data, size_t len) override
Ready to read data event.
bool m_bHTTP10Client
Definition: HTTPSock.h:141
CString m_sPostData
Definition: HTTPSock.h:131
const CString & GetContentType() const
const CString & GetURIPrefix() const
bool m_bAcceptGzip
Definition: HTTPSock.h:143
CString m_sDocRoot
Definition: HTTPSock.h:136
bool m_bDone
Definition: HTTPSock.h:128
bool PrintErrorPage(unsigned int uStatusId, const CString &sStatusMsg, const CString &sMessage)
CString m_sPass
Definition: HTTPSock.h:134
CHTTPSock(CModule *pMod, const CString &sURIPrefix, const CString &sHostname, unsigned short uPort, int iTimeout=60)
CHTTPSock(CModule *pMod, const CString &sURIPrefix)
bool Redirect(const CString &sURL)
CString GetRawParam(const CString &sName, bool bPost=true) const
CString m_sIfNoneMatch
Definition: HTTPSock.h:142
virtual bool OnLogin(const CString &sUser, const CString &sPass, bool bBasic)
void Connected() override
Connected event.
const CString & GetURI() const
MCString m_msResponseCookies
Definition: HTTPSock.h:145
const CString & GetParamString() const
bool PrintHeader(off_t uContentLength, const CString &sContentType="", unsigned int uStatusId=200, const CString &sStatusMsg="OK")
virtual bool ForceLogin()
bool m_bSentHeader
Definition: HTTPSock.h:124
std::map< CString, VCString > m_msvsGETParams
Definition: HTTPSock.h:139
virtual void OnPageRequest(const CString &sURI)=0
CString m_sURIPrefix
Definition: HTTPSock.h:146
bool IsLoggedIn() const
Definition: HTTPSock.h:80
void SetDocRoot(const CString &s)
virtual bool PrintFile(const CString &sFileName, CString sContentType="")
const CString & GetUser() const
static CString GetDate(time_t tm=0)
void SetContentType(const CString &sContentType)
const std::map< CString, VCString > & GetParams(bool bPost=true) const
void ReadLine(const CString &sData) override
size_t GetParamValues(const CString &sName, std::set< CString > &ssRet, bool bPost=true, const CString &sFilter="\r\n") const
CString m_sURI
Definition: HTTPSock.h:132
unsigned long m_uPostLen
Definition: HTTPSock.h:130
const CString & GetDocRoot() const
bool m_bBasicAuth
Definition: HTTPSock.h:129
bool m_bGotHeader
Definition: HTTPSock.h:125
CString m_sContentType
Definition: HTTPSock.h:135
const CString & GetPass() const
void SetLoggedIn(bool b)
Definition: HTTPSock.h:75
bool SendCookie(const CString &sKey, const CString &sValue)
bool m_bLoggedIn
Definition: HTTPSock.h:126
void PrintPage(const CString &sPage)
bool m_bPost
Definition: HTTPSock.h:127
static void ParseParams(const CString &sParams, std::map< CString, VCString > &msvsParams)
size_t GetParamValues(const CString &sName, VCString &vsRet, bool bPost=true, const CString &sFilter="\r\n") const
CString GetRemoteIP() const override
MCString m_msHeaders
Definition: HTTPSock.h:140
CString m_sForwardedIP
Definition: HTTPSock.h:137
CString GetRequestCookie(const CString &sKey) const
CString GetParam(const CString &sName, bool bPost=true, const CString &sFilter="\r\n") const
The base class for your own ZNC modules.
Definition: Modules.h:420
Base Csock implementation to be used by modules.
Definition: Socket.h:247
String class that is used inside ZNC.
Definition: ZNCString.h:68
Basic socket class.
Definition: Csocket.h:564
A dictionary for strings.
Definition: ZNCString.h:595