From 1fa210c7f91030ac18fd880fcf131e8104c0b889 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 4 Aug 2014 11:16:19 +0200 Subject: Refactored case-conversion functions. StrToLower() returns a modified copy of the string, InPlaceLowercase() modifies the string in-place. --- src/HTTPServer/HTTPMessage.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/HTTPServer') diff --git a/src/HTTPServer/HTTPMessage.cpp b/src/HTTPServer/HTTPMessage.cpp index 4226352e9..65d73fd87 100644 --- a/src/HTTPServer/HTTPMessage.cpp +++ b/src/HTTPServer/HTTPMessage.cpp @@ -35,8 +35,7 @@ cHTTPMessage::cHTTPMessage(eKind a_Kind) : void cHTTPMessage::AddHeader(const AString & a_Key, const AString & a_Value) { - AString Key = a_Key; - StrToLower(Key); + AString Key = StrToLower(a_Key); cNameValueMap::iterator itr = m_Headers.find(Key); if (itr == m_Headers.end()) { -- cgit v1.2.3 From 92f67789fc24572092a70d582aef22d7ef1dd272 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 2 Aug 2014 22:56:08 -0700 Subject: Gave names to unnamed enums --- src/HTTPServer/HTTPMessage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/HTTPServer') diff --git a/src/HTTPServer/HTTPMessage.h b/src/HTTPServer/HTTPMessage.h index e402c8ad6..c0667030f 100644 --- a/src/HTTPServer/HTTPMessage.h +++ b/src/HTTPServer/HTTPMessage.h @@ -18,7 +18,7 @@ class cHTTPMessage { public: - enum + enum eStatus { HTTP_OK = 200, HTTP_BAD_REQUEST = 400, -- cgit v1.2.3 From 64fec204c4c5062461a7188b58026d062519b417 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 21 Aug 2014 22:39:53 +0200 Subject: Added initializers for class members. As reported by Coverity, these weren't initialized. --- src/HTTPServer/HTTPConnection.cpp | 3 ++- src/HTTPServer/HTTPFormParser.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/HTTPServer') diff --git a/src/HTTPServer/HTTPConnection.cpp b/src/HTTPServer/HTTPConnection.cpp index b9c762e7c..bf46bb241 100644 --- a/src/HTTPServer/HTTPConnection.cpp +++ b/src/HTTPServer/HTTPConnection.cpp @@ -15,7 +15,8 @@ cHTTPConnection::cHTTPConnection(cHTTPServer & a_HTTPServer) : m_HTTPServer(a_HTTPServer), m_State(wcsRecvHeaders), - m_CurrentRequest(NULL) + m_CurrentRequest(NULL), + m_CurrentRequestBodyRemaining(0) { // LOGD("HTTP: New connection at %p", this); } diff --git a/src/HTTPServer/HTTPFormParser.cpp b/src/HTTPServer/HTTPFormParser.cpp index 9ddfb82f1..c50c6dcf2 100644 --- a/src/HTTPServer/HTTPFormParser.cpp +++ b/src/HTTPServer/HTTPFormParser.cpp @@ -15,7 +15,9 @@ cHTTPFormParser::cHTTPFormParser(cHTTPRequest & a_Request, cCallbacks & a_Callbacks) : m_Callbacks(a_Callbacks), - m_IsValid(true) + m_IsValid(true), + m_IsCurrentPartFile(false), + m_FileHasBeenAnnounced(false) { if (a_Request.GetMethod() == "GET") { @@ -55,7 +57,9 @@ cHTTPFormParser::cHTTPFormParser(cHTTPRequest & a_Request, cCallbacks & a_Callba cHTTPFormParser::cHTTPFormParser(eKind a_Kind, const char * a_Data, size_t a_Size, cCallbacks & a_Callbacks) : m_Callbacks(a_Callbacks), m_Kind(a_Kind), - m_IsValid(true) + m_IsValid(true), + m_IsCurrentPartFile(false), + m_FileHasBeenAnnounced(false) { Parse(a_Data, a_Size); } -- cgit v1.2.3 From a0feff2734d7591bf4feddbe60145643bdae53df Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 7 Sep 2014 19:42:35 +0200 Subject: WebAdmin: Added HTTPS instructions when cert / key is missing. --- src/HTTPServer/HTTPServer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/HTTPServer') diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp index 8eabe5cb2..c91be677e 100644 --- a/src/HTTPServer/HTTPServer.cpp +++ b/src/HTTPServer/HTTPServer.cpp @@ -171,6 +171,7 @@ bool cHTTPServer::Initialize(const AString & a_PortsIPv4, const AString & a_Port if (m_Cert.get() == NULL) { LOGWARNING("WebServer: The server is running in unsecure HTTP mode."); + LOGINFO("Put a valid HTTPS certificate to file 'webadmin/httpscert.crt' and its corresponding private key to 'httpskey.pem' (without any password) to enable HTTPS support"); } else { -- cgit v1.2.3 From 32002694b09ae147e241c7df49a502b82974af9b Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Wed, 10 Sep 2014 18:47:59 +0100 Subject: Grammar fixes. --- src/HTTPServer/HTTPServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/HTTPServer') diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp index c91be677e..0c41b54b2 100644 --- a/src/HTTPServer/HTTPServer.cpp +++ b/src/HTTPServer/HTTPServer.cpp @@ -170,8 +170,8 @@ bool cHTTPServer::Initialize(const AString & a_PortsIPv4, const AString & a_Port // Notify the admin about the HTTPS / HTTP status if (m_Cert.get() == NULL) { - LOGWARNING("WebServer: The server is running in unsecure HTTP mode."); - LOGINFO("Put a valid HTTPS certificate to file 'webadmin/httpscert.crt' and its corresponding private key to 'httpskey.pem' (without any password) to enable HTTPS support"); + LOGWARNING("WebServer: The server is running in unsecured HTTP mode."); + LOGINFO("Put a valid HTTPS certificate in file 'webadmin/httpscert.crt' and its corresponding private key to 'webadmin/httpskey.pem' (without any password) to enable HTTPS support"); } else { -- cgit v1.2.3