From 1a14ec45780a3a09498711547d10335e9715b9c5 Mon Sep 17 00:00:00 2001 From: Marian Krivos Date: Sun, 7 Dec 2014 20:49:12 +0100 Subject: [PATCH 1/5] Change MAX_URI_LENGTH for HTTPRequest from 4 to 16kb - 4kb is too small for todays internet --- Net/include/Poco/Net/HTTPRequest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Net/include/Poco/Net/HTTPRequest.h b/Net/include/Poco/Net/HTTPRequest.h index 79cd722b0..497ff26c6 100644 --- a/Net/include/Poco/Net/HTTPRequest.h +++ b/Net/include/Poco/Net/HTTPRequest.h @@ -159,7 +159,7 @@ private: enum Limits { MAX_METHOD_LENGTH = 32, - MAX_URI_LENGTH = 4096, + MAX_URI_LENGTH = 16384, MAX_VERSION_LENGTH = 8 }; From e5cdb74bb0c069e9a4d7e7750a960470c64b837a Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 8 Dec 2014 00:00:40 -0600 Subject: [PATCH 2/5] supress LogStream empty line log entries; ignore VS profiler files --- .gitignore | 2 ++ Foundation/src/LogStream.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 44ceff1e2..bfe4dfef7 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ *.la *.a *.d +*.vsp +*.psess # Make # ######## diff --git a/Foundation/src/LogStream.cpp b/Foundation/src/LogStream.cpp index 4ff724fce..6cc307a0b 100644 --- a/Foundation/src/LogStream.cpp +++ b/Foundation/src/LogStream.cpp @@ -47,9 +47,12 @@ int LogStreamBuf::writeToDevice(char c) { if (c == '\n' || c == '\r') { - Message msg(_logger.name(), _message, _priority); - _message.clear(); - _logger.log(msg); + if (_message.find_first_not_of("\r\n") != std::string::npos) + { + Message msg(_logger.name(), _message, _priority); + _message.clear(); + _logger.log(msg); + } } else _message += c; return c; From 10aedfe5adc118f89e7ace1b11d51b0542bd0827 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Mon, 8 Dec 2014 20:13:20 -0600 Subject: [PATCH 3/5] supress gcc warning avalanche --- Foundation/include/Poco/Bugcheck.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Foundation/include/Poco/Bugcheck.h b/Foundation/include/Poco/Bugcheck.h index 3683ac98d..904200fc2 100644 --- a/Foundation/include/Poco/Bugcheck.h +++ b/Foundation/include/Poco/Bugcheck.h @@ -43,7 +43,7 @@ public: static void assertion(const char* cond, const char* file, int line, const char* text = 0); /// An assertion failed. Break into the debugger, if /// possible, then throw an AssertionViolationException. - + static void nullPointer(const char* ptr, const char* file, int line); /// An null pointer was encountered. Break into the debugger, if /// possible, then throw an NullPointerException. @@ -111,8 +111,8 @@ protected: #define poco_bugcheck_msg(msg) \ Poco::Bugcheck::bugcheck(msg, __FILE__, __LINE__) - - + + #define poco_unexpected() \ Poco::Bugcheck::unexpected(__FILE__, __LINE__); @@ -143,22 +143,25 @@ protected: // // poco_static_assert -// +// // The following was ported from // +GCC_DIAG_OFF(unused-local-typedefs) // supress numerous gcc warnings + + template struct POCO_STATIC_ASSERTION_FAILURE; -template <> -struct POCO_STATIC_ASSERTION_FAILURE +template <> +struct POCO_STATIC_ASSERTION_FAILURE { - enum - { - value = 1 - }; + enum + { + value = 1 + }; }; From a5c8b751d9038740a6bd7f2b2ede3e3473e84a0d Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Tue, 9 Dec 2014 10:38:11 +0100 Subject: [PATCH 4/5] fixed #627: Poco::Path::home() returns c:\windows\system32 instead home directory --- Foundation/src/Path_WIN32.cpp | 10 ++++++---- Foundation/src/Path_WIN32U.cpp | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Foundation/src/Path_WIN32.cpp b/Foundation/src/Path_WIN32.cpp index 76165821c..259c7c1ab 100644 --- a/Foundation/src/Path_WIN32.cpp +++ b/Foundation/src/Path_WIN32.cpp @@ -55,14 +55,16 @@ std::string PathImpl::systemImpl() std::string PathImpl::homeImpl() { std::string result; - - // windows service has no home dir, return system directory instead - try + if (EnvironmentImpl::hasImpl("HOMEDRIVE") && EnvironmentImpl::hasImpl("HOMEPATH")) { result = EnvironmentImpl::getImpl("HOMEDRIVE"); result.append(EnvironmentImpl::getImpl("HOMEPATH")); } - catch (NotFoundException&) + else if (EnvironmentImpl::hasImpl("USERPROFILE")) + { + result = EnvironmentImpl::getImpl("USERPROFILE"); + } + else { result = systemImpl(); } diff --git a/Foundation/src/Path_WIN32U.cpp b/Foundation/src/Path_WIN32U.cpp index 10d2b7fc4..799231717 100644 --- a/Foundation/src/Path_WIN32U.cpp +++ b/Foundation/src/Path_WIN32U.cpp @@ -65,14 +65,16 @@ std::string PathImpl::systemImpl() std::string PathImpl::homeImpl() { std::string result; - - // windows service has no home dir, return system directory instead - try + if (EnvironmentImpl::hasImpl("HOMEDRIVE") && EnvironmentImpl::hasImpl("HOMEPATH")) { result = EnvironmentImpl::getImpl("HOMEDRIVE"); result.append(EnvironmentImpl::getImpl("HOMEPATH")); } - catch (NotFoundException&) + else if (EnvironmentImpl::hasImpl("USERPROFILE")) + { + result = EnvironmentImpl::getImpl("USERPROFILE"); + } + else { result = systemImpl(); } From b8181e4ddb1cb63a6e49b7d7527245062e3394c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Tue, 9 Dec 2014 11:03:09 +0100 Subject: [PATCH 5/5] check USERPROFILE before HOMEDRIVE/HOMEPATH --- Foundation/src/Path_WIN32.cpp | 10 +++++----- Foundation/src/Path_WIN32U.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Foundation/src/Path_WIN32.cpp b/Foundation/src/Path_WIN32.cpp index 259c7c1ab..ba0465b57 100644 --- a/Foundation/src/Path_WIN32.cpp +++ b/Foundation/src/Path_WIN32.cpp @@ -55,15 +55,15 @@ std::string PathImpl::systemImpl() std::string PathImpl::homeImpl() { std::string result; - if (EnvironmentImpl::hasImpl("HOMEDRIVE") && EnvironmentImpl::hasImpl("HOMEPATH")) + if (EnvironmentImpl::hasImpl("USERPROFILE")) + { + result = EnvironmentImpl::getImpl("USERPROFILE"); + } + else if (EnvironmentImpl::hasImpl("HOMEDRIVE") && EnvironmentImpl::hasImpl("HOMEPATH")) { result = EnvironmentImpl::getImpl("HOMEDRIVE"); result.append(EnvironmentImpl::getImpl("HOMEPATH")); } - else if (EnvironmentImpl::hasImpl("USERPROFILE")) - { - result = EnvironmentImpl::getImpl("USERPROFILE"); - } else { result = systemImpl(); diff --git a/Foundation/src/Path_WIN32U.cpp b/Foundation/src/Path_WIN32U.cpp index 799231717..0c37063ff 100644 --- a/Foundation/src/Path_WIN32U.cpp +++ b/Foundation/src/Path_WIN32U.cpp @@ -65,15 +65,15 @@ std::string PathImpl::systemImpl() std::string PathImpl::homeImpl() { std::string result; - if (EnvironmentImpl::hasImpl("HOMEDRIVE") && EnvironmentImpl::hasImpl("HOMEPATH")) + if (EnvironmentImpl::hasImpl("USERPROFILE")) + { + result = EnvironmentImpl::getImpl("USERPROFILE"); + } + else if (EnvironmentImpl::hasImpl("HOMEDRIVE") && EnvironmentImpl::hasImpl("HOMEPATH")) { result = EnvironmentImpl::getImpl("HOMEDRIVE"); result.append(EnvironmentImpl::getImpl("HOMEPATH")); } - else if (EnvironmentImpl::hasImpl("USERPROFILE")) - { - result = EnvironmentImpl::getImpl("USERPROFILE"); - } else { result = systemImpl();