mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-11-02 11:38:08 +00:00
Re-add TIP POCO changes.
Signed-off-by: Adam Capparelli <adam.capparelli@alumni.utoronto.ca>
This commit is contained in:
@@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.15.0)
|
||||
|
||||
project(Poco)
|
||||
|
||||
if(APPLE)
|
||||
set(MYSQL_ROOT_DIR /usr/local/opt/mysql-client)
|
||||
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
|
||||
endif()
|
||||
|
||||
file(STRINGS "${PROJECT_SOURCE_DIR}/libversion" SHARED_LIBRARY_VERSION)
|
||||
# Read the version information from the VERSION file
|
||||
file(STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION)
|
||||
@@ -58,6 +63,10 @@ include(GNUInstallDirs)
|
||||
# Include some common macros to simpilfy the Poco CMake files
|
||||
include(PocoMacros)
|
||||
|
||||
if(BROKEN_MYSQL_RESET)
|
||||
add_definitions(-DBROKEN_MYSQL_RESET=1)
|
||||
endif()
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
|
||||
|
||||
set(POCO_SANITIZEFLAGS CACHE STRING "Compiler-dependent sanitizer flags (like -fsanitize=address or /fsanitize=address")
|
||||
|
||||
@@ -188,7 +188,9 @@ void SessionHandle::autoCommit(bool val)
|
||||
|
||||
void SessionHandle::reset()
|
||||
{
|
||||
#if ((defined (MYSQL_VERSION_ID)) && (MYSQL_VERSION_ID >= 50700)) || ((defined (MARIADB_PACKAGE_VERSION_ID)) && (MARIADB_PACKAGE_VERSION_ID >= 30000))
|
||||
#if (defined(BROKEN_MYSQL_RESET))
|
||||
if (mysql_refresh(_pHandle, REFRESH_TABLES | REFRESH_STATUS | REFRESH_THREADS | REFRESH_READ_LOCK) != 0)
|
||||
#elif ((defined (MYSQL_VERSION_ID)) && (MYSQL_VERSION_ID >= 50700)) || ((defined (MARIADB_PACKAGE_VERSION_ID)) && (MARIADB_PACKAGE_VERSION_ID >= 30000))
|
||||
if (mysql_reset_connection(_pHandle) != 0)
|
||||
#else
|
||||
if (mysql_refresh(_pHandle, REFRESH_TABLES | REFRESH_STATUS | REFRESH_THREADS | REFRESH_READ_LOCK) != 0)
|
||||
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
poco_assert_dbg (!pPreparator.isNull());
|
||||
if (obj.isNull())
|
||||
{
|
||||
pPreparator->prepare(pos++, T());
|
||||
pPreparator->prepare(pos++, Poco::Data::Keywords::null));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -91,6 +91,13 @@ public:
|
||||
Poco::Thread::Priority getThreadPriority() const;
|
||||
/// Returns the priority of TCP server threads
|
||||
/// created by TCPServer.
|
||||
|
||||
void setName(const std::string &name);
|
||||
/// Set the name of the underlying thread
|
||||
// created vy TCPserver
|
||||
|
||||
std::string getName() const;
|
||||
/// Get the name of the underlying thread
|
||||
|
||||
protected:
|
||||
virtual ~TCPServerParams();
|
||||
@@ -101,6 +108,7 @@ private:
|
||||
int _maxThreads;
|
||||
int _maxQueued;
|
||||
Poco::Thread::Priority _threadPriority;
|
||||
std::string _name;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -103,6 +103,8 @@ public:
|
||||
/// Returns the maximum payload size for receiveFrame().
|
||||
///
|
||||
/// The default is std::numeric_limits<int>::max().
|
||||
|
||||
auto * streamSocketImpl() { return _pStreamSocketImpl; }
|
||||
|
||||
protected:
|
||||
enum
|
||||
|
||||
@@ -125,6 +125,19 @@ void TCPServer::stop()
|
||||
|
||||
void TCPServer::run()
|
||||
{
|
||||
|
||||
if(!_pDispatcher->params().getName().empty()) {
|
||||
Poco::Thread::current()->setName(_pDispatcher->params().getName());
|
||||
#ifdef __linux__
|
||||
Poco::Thread::current()->setName(_pDispatcher->params().getName());
|
||||
pthread_setname_np(pthread_self(), _pDispatcher->params().getName().c_str());
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
Poco::Thread::current()->setName(_pDispatcher->params().getName());
|
||||
pthread_setname_np(_pDispatcher->params().getName().c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
while (!_stopped)
|
||||
{
|
||||
Poco::Timespan timeout(250000);
|
||||
|
||||
@@ -101,6 +101,18 @@ void TCPServerDispatcher::run()
|
||||
|
||||
int idleTime = (int) _pParams->getThreadIdleTime().totalMilliseconds();
|
||||
|
||||
if(!_pParams->getName().empty()) {
|
||||
Poco::Thread::current()->setName(_pParams->getName());
|
||||
#ifdef __linux__
|
||||
Poco::Thread::current()->setName(_pParams->getName());
|
||||
pthread_setname_np(pthread_self(), _pParams->getName().c_str());
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
Poco::Thread::current()->setName(_pParams->getName());
|
||||
pthread_setname_np(_pParams->getName().c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -60,5 +60,13 @@ void TCPServerParams::setThreadPriority(Poco::Thread::Priority prio)
|
||||
_threadPriority = prio;
|
||||
}
|
||||
|
||||
void TCPServerParams::setName(const std::string &name) {
|
||||
_name = name;
|
||||
}
|
||||
|
||||
std::string TCPServerParams::getName() const {
|
||||
return _name;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Net
|
||||
|
||||
Reference in New Issue
Block a user