From 139649fd617e42bc8bbeca7d93b15917077d2988 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Wed, 9 Mar 2016 20:22:44 +0100 Subject: [PATCH 1/4] TaskManager::count() now returns std::size_t; release mutex before posting progress notification --- Foundation/include/Poco/TaskManager.h | 6 +++--- Foundation/src/TaskManager.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Foundation/include/Poco/TaskManager.h b/Foundation/include/Poco/TaskManager.h index c4c3aa8e7b..30f95972ed 100644 --- a/Foundation/include/Poco/TaskManager.h +++ b/Foundation/include/Poco/TaskManager.h @@ -86,7 +86,7 @@ class Foundation_API TaskManager TaskList taskList() const; /// Returns a copy of the internal task list. - int count() const; + std::size_t count() const; /// Returns the number of tasks in the internal task list. void addObserver(const AbstractObserver& observer); @@ -125,11 +125,11 @@ class Foundation_API TaskManager // // inlines // -inline int TaskManager::count() const +inline std::size_t TaskManager::count() const { FastMutex::ScopedLock lock(_mutex); - return (int) _taskList.size(); + return _taskList.size(); } diff --git a/Foundation/src/TaskManager.cpp b/Foundation/src/TaskManager.cpp index 1e2e6bc9a1..77f2aa8f0c 100644 --- a/Foundation/src/TaskManager.cpp +++ b/Foundation/src/TaskManager.cpp @@ -115,11 +115,12 @@ void TaskManager::taskStarted(Task* pTask) void TaskManager::taskProgress(Task* pTask, float progress) { - FastMutex::ScopedLock lock(_mutex); + ScopedLockWithUnlock lock(_mutex); if (_lastProgressNotification.isElapsed(MIN_PROGRESS_NOTIFICATION_INTERVAL)) { _lastProgressNotification.update(); + lock.unlock(); _nc.postNotification(new TaskProgressNotification(pTask, progress)); } } From ede77f46eec4dc7607f8c25458ee7ed637c3b05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=A4us=20Mendel?= Date: Wed, 9 Mar 2016 17:20:37 -0300 Subject: [PATCH 2/4] Removed unused variables When compiling with higher warning levels the compiler warns about these unused variables. --- Foundation/include/Poco/NamedEvent_UNIX.h | 2 -- Foundation/include/Poco/NamedMutex_UNIX.h | 2 -- MongoDB/include/Poco/MongoDB/GetMoreRequest.h | 1 - 3 files changed, 5 deletions(-) diff --git a/Foundation/include/Poco/NamedEvent_UNIX.h b/Foundation/include/Poco/NamedEvent_UNIX.h index 63dabcad37..9aba821044 100644 --- a/Foundation/include/Poco/NamedEvent_UNIX.h +++ b/Foundation/include/Poco/NamedEvent_UNIX.h @@ -44,8 +44,6 @@ class Foundation_API NamedEventImpl #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) sem_t* _sem; #else - int _lockfd; // lock file descriptor - int _semfd; // file used to identify semaphore int _semid; // semaphore id #endif }; diff --git a/Foundation/include/Poco/NamedMutex_UNIX.h b/Foundation/include/Poco/NamedMutex_UNIX.h index 6312318672..78515545ba 100644 --- a/Foundation/include/Poco/NamedMutex_UNIX.h +++ b/Foundation/include/Poco/NamedMutex_UNIX.h @@ -47,8 +47,6 @@ class Foundation_API NamedMutexImpl #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) sem_t* _sem; #else - int _lockfd; // lock file descriptor - int _semfd; // file used to identify semaphore int _semid; // semaphore id #endif }; diff --git a/MongoDB/include/Poco/MongoDB/GetMoreRequest.h b/MongoDB/include/Poco/MongoDB/GetMoreRequest.h index 9b2a4c8bd7..e73941e1e4 100644 --- a/MongoDB/include/Poco/MongoDB/GetMoreRequest.h +++ b/MongoDB/include/Poco/MongoDB/GetMoreRequest.h @@ -58,7 +58,6 @@ class MongoDB_API GetMoreRequest : public RequestMessage void buildRequest(BinaryWriter& writer); private: - Int32 _flags; std::string _fullCollectionName; Int32 _numberToReturn; Int64 _cursorID; From f634ab8d6d2430289a21aa324c3be4879fa99975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Math=C3=A4us=20Mendel?= Date: Wed, 9 Mar 2016 17:21:25 -0300 Subject: [PATCH 3/4] Fixed an inline initialization issue in the constructor Class members are initialized in the order they are declared. --- Redis/include/Poco/Redis/AsyncReader.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Redis/include/Poco/Redis/AsyncReader.h b/Redis/include/Poco/Redis/AsyncReader.h index ad99a39753..2a7e3a996d 100644 --- a/Redis/include/Poco/Redis/AsyncReader.h +++ b/Redis/include/Poco/Redis/AsyncReader.h @@ -67,10 +67,8 @@ class Redis_API AsyncReader AsyncReader(const AsyncReader&); AsyncReader& operator = (const AsyncReader&); - - Activity _activity; - Client& _client; + Activity _activity; }; From b2ac8702408f23071af39bf822225ea1a5a291f8 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Thu, 10 Mar 2016 09:54:08 +0100 Subject: [PATCH 4/4] fixed GH# 1184: Attempting to connect via a proxy throws a DNS error "Host not found" --- NetSSL_OpenSSL/src/SecureSocketImpl.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/NetSSL_OpenSSL/src/SecureSocketImpl.cpp b/NetSSL_OpenSSL/src/SecureSocketImpl.cpp index 129a987771..9a81898a75 100644 --- a/NetSSL_OpenSSL/src/SecureSocketImpl.cpp +++ b/NetSSL_OpenSSL/src/SecureSocketImpl.cpp @@ -376,8 +376,15 @@ long SecureSocketImpl::verifyPeerCertificateImpl(const std::string& hostName) bool SecureSocketImpl::isLocalHost(const std::string& hostName) { - SocketAddress addr(hostName, 0); - return addr.host().isLoopback(); + try + { + SocketAddress addr(hostName, 0); + return addr.host().isLoopback(); + } + catch (Poco::Exception&) + { + return false; + } }