From 5e1904b5f8fbeee9ad009cd63ed3c968e4c0cd10 Mon Sep 17 00:00:00 2001 From: Aleksandar Fabijanic Date: Mon, 16 Oct 2023 00:16:06 +0200 Subject: [PATCH] fix: Sync 1.11.-1.12-devel(1.13) #4187 --- Crypto/Makefile | 1 - .../include/Poco/Data/PostgreSQL/Extractor.h | 4 +-- .../Compiler/src/TextEncodingCompiler.cpp | 4 +-- Foundation/src/FileChannel.cpp | 4 +++ Foundation/src/NumberParser.cpp | 2 +- .../testsuite/src/LocalDateTimeTest.cpp | 2 +- .../Poco/MongoDB/PoolableConnectionFactory.h | 4 --- Net/include/Poco/Net/SocketDefs.h | 2 ++ Net/src/HTTPDigestCredentials.cpp | 9 +++--- Net/testsuite/src/DialogServer.cpp | 1 - PDF/include/Poco/PDF/Page.h | 28 +++++++++---------- Redis/include/Poco/Redis/Command.h | 3 ++ Redis/src/Command.cpp | 10 +++++++ doc/99150-WindowsPlatformNotes.page | 2 +- 14 files changed, 45 insertions(+), 31 deletions(-) diff --git a/Crypto/Makefile b/Crypto/Makefile index 6542b5b7b..e5dc42588 100644 --- a/Crypto/Makefile +++ b/Crypto/Makefile @@ -6,7 +6,6 @@ include $(POCO_BASE)/build/rules/global -# see https://github.com/pocoproject/poco/issues/3073 GLOBAL_SYSLIBS := $(SYSLIBS) ifeq ($(findstring AIX, $(POCO_CONFIG)), AIX) SYSLIBS = -lssl_a -lcrypto_a diff --git a/Data/PostgreSQL/include/Poco/Data/PostgreSQL/Extractor.h b/Data/PostgreSQL/include/Poco/Data/PostgreSQL/Extractor.h index dc9a57b14..fabe39c29 100644 --- a/Data/PostgreSQL/include/Poco/Data/PostgreSQL/Extractor.h +++ b/Data/PostgreSQL/include/Poco/Data/PostgreSQL/Extractor.h @@ -354,9 +354,9 @@ private: // // inlines // -inline bool Extractor::isColumnNull(const OutputParameter& anOutputParameter) const +inline bool Extractor::isColumnNull(const OutputParameter& outputParameter) const { - return anOutputParameter.isNull() || 0 == anOutputParameter.pData(); + return outputParameter.isNull() || 0 == outputParameter.pData(); } diff --git a/Encodings/Compiler/src/TextEncodingCompiler.cpp b/Encodings/Compiler/src/TextEncodingCompiler.cpp index ff1e410c9..3286324c5 100644 --- a/Encodings/Compiler/src/TextEncodingCompiler.cpp +++ b/Encodings/Compiler/src/TextEncodingCompiler.cpp @@ -117,8 +117,8 @@ protected: helpFormatter.setHeader( "\n" "The POCO C++ Text Encodings Compiler.\n" - "Copyright (c) 2018-2022 by Applied Informatics Software Engineering GmbH.\n" - "All rights reserved.\n\n" + "Copyright (c) 2018-2023 by Applied Informatics Software Engineering GmbH.\n" + "and Contributors.\n\n" "This program compiles Unicode character encoding tables " "from http://www.unicode.org/Public/MAPPINGS/ to TextEncoding " "classes for the Poco Encodings library. \n\n" diff --git a/Foundation/src/FileChannel.cpp b/Foundation/src/FileChannel.cpp index 94c8f7991..c176c64b0 100644 --- a/Foundation/src/FileChannel.cpp +++ b/Foundation/src/FileChannel.cpp @@ -351,6 +351,7 @@ void FileChannel::setArchive(const std::string& archive) void FileChannel::setCompress(const std::string& compress) { _compress = icompare(compress, "true") == 0; + if (_pArchiveStrategy) _pArchiveStrategy->compress(_compress); } @@ -391,6 +392,8 @@ void FileChannel::setRotateOnOpen(const std::string& rotateOnOpen) void FileChannel::purge() { + if (_pPurgeStrategy) + { try { _pPurgeStrategy->purge(_path); @@ -398,6 +401,7 @@ void FileChannel::purge() catch (...) { } + } } diff --git a/Foundation/src/NumberParser.cpp b/Foundation/src/NumberParser.cpp index bb73ce4c3..ab3ec14f8 100644 --- a/Foundation/src/NumberParser.cpp +++ b/Foundation/src/NumberParser.cpp @@ -188,7 +188,7 @@ double NumberParser::parseFloat(const std::string& s, char decSep, char thSep) bool NumberParser::tryParseFloat(const std::string& s, double& value, char decSep, char thSep) { - return strToDouble(s, value, decSep, thSep); + return strToDouble(s.c_str(), value, decSep, thSep); } diff --git a/Foundation/testsuite/src/LocalDateTimeTest.cpp b/Foundation/testsuite/src/LocalDateTimeTest.cpp index 3e12c3940..c1b8d4f08 100644 --- a/Foundation/testsuite/src/LocalDateTimeTest.cpp +++ b/Foundation/testsuite/src/LocalDateTimeTest.cpp @@ -479,7 +479,7 @@ void LocalDateTimeTest::testTimezone2() then = *std::localtime(&t); #if POCO_OS == POCO_OS_SOLARIS assertTrue((mktime(&then)-t) * 1000 == ldt.tzd()); -#else +#else assertTrue (then.tm_gmtoff == ldt.tzd()); #endif } diff --git a/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h b/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h index f5c52a246..58b81ee94 100644 --- a/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h +++ b/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h @@ -116,7 +116,6 @@ public: return _connection; } -#if defined(POCO_ENABLE_CPP11) // Disable copy to prevent unwanted release of resources: C++11 way PooledConnection(const PooledConnection&) = delete; PooledConnection& operator=(const PooledConnection&) = delete; @@ -124,15 +123,12 @@ public: // Enable move semantics PooledConnection(PooledConnection&& other) = default; PooledConnection& operator=(PooledConnection&&) = default; -#endif private: -#if ! defined(POCO_ENABLE_CPP11) // Disable copy to prevent unwanted release of resources: pre C++11 way PooledConnection(const PooledConnection&); PooledConnection& operator=(const PooledConnection&); -#endif Poco::ObjectPool& _pool; Connection::Ptr _connection; diff --git a/Net/include/Poco/Net/SocketDefs.h b/Net/include/Poco/Net/SocketDefs.h index bcae65680..46bfe2116 100644 --- a/Net/include/Poco/Net/SocketDefs.h +++ b/Net/include/Poco/Net/SocketDefs.h @@ -370,11 +370,13 @@ inline int SocketBufVecSize(const SocketBufVec& sbv) { std::size_t sz = 0; for (const auto& v : sbv) + { #if defined(POCO_OS_FAMILY_WINDOWS) sz += v.len; #elif defined(POCO_OS_FAMILY_UNIX) sz += v.iov_len; #endif + } return static_cast(sz); } diff --git a/Net/src/HTTPDigestCredentials.cpp b/Net/src/HTTPDigestCredentials.cpp index b8543c56e..068dbb9f5 100644 --- a/Net/src/HTTPDigestCredentials.cpp +++ b/Net/src/HTTPDigestCredentials.cpp @@ -304,8 +304,8 @@ void HTTPDigestCredentials::updateAuthParams(const HTTPRequest& request) if (qop.empty()) { - /// Assume that https://tools.ietf.org/html/rfc7616 does not supported - /// and still using https://tools.ietf.org/html/rfc2069#section-2.4 + /// Assume that https://tools.ietf.org/html/rfc7616 is not supported + /// and still using https://tools.ietf.org/html/rfc2069#section-2.4 MD5Engine engine; @@ -407,8 +407,9 @@ int HTTPDigestCredentials::updateNonceCounter(const std::string& nonce) bool HTTPDigestCredentials::isAlgorithmSupported(const std::string& algorithm) const { bool isAlgorithmSupported = std::find_if(std::begin(SUPPORTED_ALGORITHMS), - std::end(SUPPORTED_ALGORITHMS), - [&algorithm](const std::string& supportedAlgorithm) { + std::end(SUPPORTED_ALGORITHMS), + [&algorithm](const std::string& supportedAlgorithm) + { return icompare(algorithm, supportedAlgorithm) == 0; }) != std::end(SUPPORTED_ALGORITHMS); diff --git a/Net/testsuite/src/DialogServer.cpp b/Net/testsuite/src/DialogServer.cpp index 5efce4ca5..74a36a26b 100644 --- a/Net/testsuite/src/DialogServer.cpp +++ b/Net/testsuite/src/DialogServer.cpp @@ -109,7 +109,6 @@ const std::string& DialogServer::lastCommand() const const std::vector& DialogServer::lastCommands() const { FastMutex::ScopedLock lock(_mutex); - return _lastCommands; } diff --git a/PDF/include/Poco/PDF/Page.h b/PDF/include/Poco/PDF/Page.h index 846a6bb79..80b745522 100644 --- a/PDF/include/Poco/PDF/Page.h +++ b/PDF/include/Poco/PDF/Page.h @@ -49,21 +49,21 @@ public: enum Size { PAGE_SIZE_LETTER = HPDF_PAGE_SIZE_LETTER, - /// 8� x 11 (Inches), 612 x 792 px + /// 8½ x 11 (Inches), 612 x 792 px PAGE_SIZE_LEGAL = HPDF_PAGE_SIZE_LEGAL, - /// 8� x 14 (Inches), 612 x 1008 px + /// 8½ x 14 (Inches), 612 x 1008 px PAGE_SIZE_A3 = HPDF_PAGE_SIZE_A3, - /// 297 � 420 (mm), 841.89 x 1199.551 px + /// 297 × 420 (mm), 841.89 x 1199.551 px PAGE_SIZE_A4 = HPDF_PAGE_SIZE_A4, - /// 210 � 297 (mm), 595.276 x 841.89 px + /// 210 × 297 (mm), 595.276 x 841.89 px PAGE_SIZE_A5 = HPDF_PAGE_SIZE_A5, - /// 148 � 210 (mm), 419.528 x 595.276 px + /// 148 × 210 (mm), 419.528 x 595.276 px PAGE_SIZE_B4 = HPDF_PAGE_SIZE_B4, - /// 250 � 353 (mm), 708.661 x 1000.63 px + /// 250 × 353 (mm), 708.661 x 1000.63 px PAGE_SIZE_B5 = HPDF_PAGE_SIZE_B5, - /// 176 � 250 (mm), 498.898 x 708.661 px + /// 176 × 250 (mm), 498.898 x 708.661 px PAGE_SIZE_EXECUTIVE = HPDF_PAGE_SIZE_EXECUTIVE, - /// 7� x 10� (Inches), 522 x 756 px + /// 7½ x 10½ (Inches), 522 x 756 px PAGE_SIZE_US4x6 = HPDF_PAGE_SIZE_US4x6, /// 4 x 6 (Inches), 288 x 432 px PAGE_SIZE_US4x8 = HPDF_PAGE_SIZE_US4x8, @@ -301,19 +301,19 @@ public: /// Appends a path from the current point to the specified point.. void curveTo(const std::vector& values); - /// Appends a B�zier curve to the current path using two specified points. + /// Appends a Bézier curve to the current path using two specified points. /// The point (x1, y1) and the point (x2, y2) are used as the control points - /// for a B�zier curve and current point is moved to the point (x3, y3) + /// for a Bézier curve and current point is moved to the point (x3, y3) void curveToRight(float x2, float y2, float x3, float y3); - /// Appends a B�zier curve to the right of the current point using two specified points. + /// Appends a Bézier curve to the right of the current point using two specified points. /// The current point and the point (x2, y2) are used as the control points - /// for a B�zier curve and current point is moved to the point (x3, y3) + /// for a Bézier curve and current point is moved to the point (x3, y3) void curveToLeft(float x2, float y2, float x3, float y3); - /// Appends a B�zier curve to the left of the current point using two specified points. + /// Appends a Bézier curve to the left of the current point using two specified points. /// The current point and the point (x2, y2) are used as the control points - /// for a B�zier curve and current point is moved to the point (x3, y3) + /// for a Bézier curve and current point is moved to the point (x3, y3) void closePath(); /// Appends a straight line from the current point to the start point of sub path. diff --git a/Redis/include/Poco/Redis/Command.h b/Redis/include/Poco/Redis/Command.h index 5c0a5d38e..23d4da002 100644 --- a/Redis/include/Poco/Redis/Command.h +++ b/Redis/include/Poco/Redis/Command.h @@ -132,6 +132,9 @@ public: static Command incr(const std::string& key, Int64 by = 0); /// Creates and returns an INCR or INCRBY command. Calls INCR when by is omitted or zero. + static Command keys(const std::string& pattern); + /// Creates and returns a KEYS command. + static Command lindex(const std::string& list, Int64 index = 0); /// Creates and returns a LINDEX command. diff --git a/Redis/src/Command.cpp b/Redis/src/Command.cpp index ac34ac454..de660c81b 100644 --- a/Redis/src/Command.cpp +++ b/Redis/src/Command.cpp @@ -269,6 +269,16 @@ Command Command::hvals(const std::string& hash) } +Command Command::keys(const std::string& pattern) +{ + Command cmd("KEYS"); + + cmd << pattern; + + return cmd; +} + + Command Command::incr(const std::string& key, Int64 by) { Command cmd(by == 0 ? "INCR" : "INCRBY"); diff --git a/doc/99150-WindowsPlatformNotes.page b/doc/99150-WindowsPlatformNotes.page index 96e6ac7d1..78b99cb50 100644 --- a/doc/99150-WindowsPlatformNotes.page +++ b/doc/99150-WindowsPlatformNotes.page @@ -53,7 +53,7 @@ and PocoLIB64d.dll for debug, respectively. In order to work around that, `/Zc:__cplusplus` compiler flag is necesary. -See following issues for details and explanations: +See the following issues for details and explanations: * https://github.com/pocoproject/poco/issues/3665 * https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/