backport leftover 1.12 changes

This commit is contained in:
Alex Fabijanic 2023-12-22 20:22:33 +01:00
parent bdf38b5bac
commit 9c7cba6d6c
7 changed files with 35 additions and 8 deletions

View File

@ -94,6 +94,22 @@ void CppParserTest::testExtractName()
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "std::function<bool> func";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "std::function<void(bool)> func";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "std::function<std::vector<int>(std::vector<bool>)> func";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "std::function<void*(std::function<const int*(void)>)> func";
name = Symbol::extractName(decl);
assertTrue (name == "func");
decl = "const std::vector<NS::MyType>* var";
name = Symbol::extractName(decl);
assertTrue (name == "var");

View File

@ -317,6 +317,8 @@ void SessionPool::shutdown()
if (_shutdown.exchange(true)) return;
_shutdown = true;
_janitorTimer.stop();
Poco::Mutex::ScopedLock lock(_mutex);
closeAll(_idleSessions);
closeAll(_activeSessions);
}

View File

@ -462,6 +462,7 @@ protected:
~Logger();
void log(const std::string& text, Message::Priority prio);
void logNPC(const std::string& text, Message::Priority prio);
void log(const std::string& text, Message::Priority prio, const char* file, int line);
static std::string format(const std::string& fmt, int argc, std::string argv[]);
@ -789,6 +790,15 @@ inline void Logger::log(const std::string& text, Message::Priority prio)
}
inline void Logger::logNPC(const std::string& text, Message::Priority prio)
{
if (_pChannel)
{
_pChannel->log(Message(_name, text, prio));
}
}
inline void Logger::log(const std::string& text, Message::Priority prio, const char* file, int line)
{
if (_level >= prio && _pChannel)

View File

@ -262,12 +262,12 @@ void ThreadImpl::setSignalMaskImpl(uint32_t sigMask)
sigset_t sset;
sigemptyset(&sset);
for (int sig = 0; sig < sizeof(uint32_t) * 8; ++sig)
for (int sig = 0; sig < sizeof(uint32_t) * 8; ++sig)
{
if ((sigMask & (1 << sig)) != 0)
sigaddset(&sset, sig);
}
pthread_sigmask(SIG_BLOCK, &sset, 0);
}

View File

@ -104,7 +104,7 @@ class Net_API SocketReactor: public Poco::Runnable
/// Finally, when the SocketReactor is about to shut down (as a result
/// of stop() being called), it dispatches a ShutdownNotification
/// to all event handlers. This is done in the onShutdown() method
/// which can be overridded by subclasses to perform custom
/// which can be overridden by subclasses to perform custom
/// shutdown processing.
///
/// The SocketReactor is implemented so that it can run in its own thread.

View File

@ -334,8 +334,8 @@ void HTTPDigestCredentials::updateAuthParams(const HTTPRequest& request)
ha1 = digest(engine, ha1, nonce, cnonce);
}
const std::string ha2 = digest(engine, request.getMethod(), request.getURI());
const std::string ha2 = digest(engine, request.getMethod(), request.getURI());
_requestAuthParams.set(NC_PARAM, nc);
_requestAuthParams.set(CNONCE_PARAM, cnonce);
_requestAuthParams.set(RESPONSE_PARAM, digest(engine, ha1, nonce, nc, cnonce, qop, ha2));
@ -367,7 +367,7 @@ bool HTTPDigestCredentials::verifyAuthParams(const HTTPRequest& request, const H
else if (icompare(qop, AUTH_PARAM) == 0)
{
const std::string& algorithm = params.get(ALGORITHM_PARAM, MD_5_ALGORITHM);
if (!isAlgorithmSupported(algorithm)) {
throw NotImplementedException("Unsupported digest algorithm", algorithm);
}
@ -406,7 +406,7 @@ int HTTPDigestCredentials::updateNonceCounter(const std::string& nonce)
bool HTTPDigestCredentials::isAlgorithmSupported(const std::string& algorithm) const
{
bool isAlgorithmSupported = std::find_if(std::begin(SUPPORTED_ALGORITHMS),
bool isAlgorithmSupported = std::find_if(std::begin(SUPPORTED_ALGORITHMS),
std::end(SUPPORTED_ALGORITHMS),
[&algorithm](const std::string& supportedAlgorithm)
{

View File

@ -361,7 +361,6 @@ void PollSetTest::testPollNoServer()
catch (Poco::Exception&) {}
assertEqual(2, ps.poll(Timespan(1000000)).size());
}