mirror of
https://github.com/znc/znc.git
synced 2026-08-07 09:22:55 +02:00
Added GetPath(), only print headers once, forward declare Cmodule
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1734 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+10
-3
@@ -8,6 +8,7 @@
|
||||
|
||||
#ifdef _MODULES
|
||||
|
||||
#include "Modules.h"
|
||||
#include "HTTPSock.h"
|
||||
#include "znc.h"
|
||||
|
||||
@@ -107,10 +108,12 @@ void CHTTPSock::GetPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (PrintHeader(sPage.length())) {
|
||||
Write(sPage);
|
||||
Close(Csock::CLT_AFTERWRITE);
|
||||
if (!SentHeader()) {
|
||||
PrintHeader(sPage.length());
|
||||
}
|
||||
|
||||
Write(sPage);
|
||||
Close(Csock::CLT_AFTERWRITE);
|
||||
}
|
||||
|
||||
bool CHTTPSock::PrintFile(const CString& sFileName, CString sContentType) {
|
||||
@@ -216,6 +219,10 @@ void CHTTPSock::ParseURI() {
|
||||
m_sURI = m_sURI.Token(0, false, "?");
|
||||
}
|
||||
|
||||
CString CHTTPSock::GetPath() const {
|
||||
return m_sURI.Token(0, false, "?");
|
||||
}
|
||||
|
||||
void CHTTPSock::ParseParams(const CString& sParams) {
|
||||
m_msvsParams.clear();
|
||||
|
||||
|
||||
+3
-2
@@ -11,7 +11,7 @@
|
||||
#ifndef _HTTPSOCK_H
|
||||
#define _HTTPSOCK_H
|
||||
|
||||
#include "Modules.h"
|
||||
class CModule;
|
||||
|
||||
class CHTTPSock : public CSocket {
|
||||
public:
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
void ParseParams(const CString& sParams);
|
||||
void ParseURI();
|
||||
void GetPage();
|
||||
bool PrintFile(const CString& sFileName, CString sContentType = "");
|
||||
virtual bool PrintFile(const CString& sFileName, CString sContentType = "");
|
||||
|
||||
// Setters
|
||||
void SetDocRoot(const CString& s);
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
bool HasParam(const CString& sName) const;
|
||||
CString GetRawParam(const CString& sName) const;
|
||||
CString GetParam(const CString& sName, const CString& sFilter = "\r\n") const;
|
||||
CString GetPath() const;
|
||||
bool IsLoggedIn() const { return m_bLoggedIn; }
|
||||
const CString& GetDocRoot() const;
|
||||
const CString& GetUser() const;
|
||||
|
||||
Reference in New Issue
Block a user