mirror of
https://github.com/znc/znc.git
synced 2026-07-30 13:33:42 +02:00
CHTTPSock: Print warnings if one tries to send multiple pages
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1837 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+6
-1
@@ -132,6 +132,8 @@ void CHTTPSock::GetPage() {
|
||||
void CHTTPSock::PrintPage(const CString& sPage) {
|
||||
if (!SentHeader()) {
|
||||
PrintHeader(sPage.length());
|
||||
} else {
|
||||
DEBUG("PrintPage(): Header was already sent");
|
||||
}
|
||||
|
||||
Write(sPage);
|
||||
@@ -359,6 +361,7 @@ bool CHTTPSock::PrintNotFound() {
|
||||
|
||||
bool CHTTPSock::PrintErrorPage(unsigned int uStatusId, const CString& sStatusMsg, const CString& sMessage) {
|
||||
if (SentHeader()) {
|
||||
DEBUG("PrintErrorPage(): Header was already sent");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -385,6 +388,7 @@ bool CHTTPSock::ForceLogin() {
|
||||
}
|
||||
|
||||
if (SentHeader()) {
|
||||
DEBUG("ForceLogin(): Header was already sent!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -407,7 +411,7 @@ bool CHTTPSock::SentHeader() const {
|
||||
|
||||
bool CHTTPSock::PrintHeader(off_t uContentLength, const CString& sContentType, unsigned int uStatusId, const CString& sStatusMsg) {
|
||||
if (SentHeader()) {
|
||||
DEBUG("- Header already sent!");
|
||||
DEBUG("PrintHeader(): Header was already sent!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -457,6 +461,7 @@ void CHTTPSock::AddHeader(const CString& sName, const CString& sValue) {
|
||||
|
||||
bool CHTTPSock::Redirect(const CString& sURL) {
|
||||
if (SentHeader()) {
|
||||
DEBUG("Redirect() - Header was already sent");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user