Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8fb80fd
fix(VarHolder): MSVC warning #4886 (#4903)
aleks-f Mar 20, 2025
e758e7e
add_subdirectory(tcpclient) (#4904)
Miracle-1996 Mar 20, 2025
057a529
fix(NetSSL): NetSSL_OpenSSL: non-blocking functions return value #4906
obiltschnig Mar 22, 2025
1bdc413
enh(expat): Upgrade to version 2.7.0
matejk Mar 19, 2025
9ca3cf7
chore(Data/SQLite): Upgrade bundled SQLite to 3.49.1 #4907
obiltschnig Mar 24, 2025
4df0c9c
chore: add clean target to trace Makefile
obiltschnig Mar 25, 2025
fbf0bf4
chore: fix test failures when ran from a VS solution build
obiltschnig Mar 28, 2025
530c2ef
fix(Crypto): include applink.c in test runner
obiltschnig Mar 28, 2025
bb0b8f8
fix(Data): Poco::Data::SessionPool::dead() must check idle, not activ…
obiltschnig Apr 4, 2025
d020166
Fix warning deprecated-enum-enum-conversion on clang
jbulow-se Apr 4, 2025
ecc0e9b
fix(Net): Crash in Poco::Net::NTLMCredentials::parseChallengeMessage …
obiltschnig Apr 9, 2025
be2748d
fix(Data): fix failing SessionPool test due to changes to SessionPool…
obiltschnig Apr 10, 2025
c0ea557
Fix wrong/mistaken type comparisons。 (#4931)
JYInMyHeart Apr 12, 2025
ddecf77
chore(expat): Upgrade to expat 2.7.1
matejk Apr 1, 2025
501521b
chore(emscripten): Fix github CMake build
matejk Apr 14, 2025
3c9b653
fix(Net): HTTP server request body RFC compliance #4935
obiltschnig Apr 15, 2025
4de2afc
fix(Net): HTTP client request body RFC compliance #4935
obiltschnig Apr 15, 2025
eaf6e28
fix(Net): Another crash in Poco::Net::NTLMCredentials::parseChallenge…
obiltschnig Apr 15, 2025
a0822e0
fix(Net): A SEGV at Net/src/MultipartReader.cpp:164:1 #4915
obiltschnig Apr 15, 2025
11619a9
fix(Net): A SEGV at Net/src/MultipartReader.cpp:164:1 #4915 (move ass…
obiltschnig Apr 16, 2025
4e27f7f
fix(NTLMCredentials): fix potentially uninitialized variable
obiltschnig Apr 18, 2025
ca57124
chore: align codeql OS version with rest of CI
aleks-f Apr 19, 2025
15d2dec
Changed target uninstall to be named uninstall-poco
Mathlete-101 Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,20 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: sudo apt -y update && sudo apt -y install cmake ninja-build emscripten
- run: emcmake cmake -H. -B cmake-build -DENABLE_ACTIVERECORD_COMPILER=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=off && emmake cmake --build cmake-build --target all -j6

#
# Option "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" is added to resolve the following issue.
#
# CMake Error at /usr/share/emscripten/cmake/Modules/CheckTypeSize.cmake:85 (cmake_policy):
# Compatibility with CMake < 3.5 has been removed from CMake.
#
# Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
# to tell CMake that the project requires at least <min> but has been updated
# to work with policies introduced by <max> or earlier.
#
# Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

- run: emcmake cmake -H. -B cmake-build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DENABLE_ACTIVERECORD_COMPILER=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=off && emmake cmake --build cmake-build --target all -j6
# TODO: How to run unit tests in emscripten?
# - uses: ./.github/actions/retry-action
# with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-20.04' }}
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-22.04' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)

add_custom_target(uninstall
add_custom_target(uninstall-poco
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
)

Expand Down
5 changes: 5 additions & 0 deletions Crypto/testsuite/src/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ int main(int ac, char **av)
CppUnitPocoExceptionText (exc);
return runner.run(args, exc) ? 0 : 1;
}


#if defined(_WIN32) && defined(_DLL)
#include <openssl/applink.c>
#endif
6,008 changes: 3,487 additions & 2,521 deletions Data/SQLite/src/sqlite3.c

Large diffs are not rendered by default.

200 changes: 166 additions & 34 deletions Data/SQLite/src/sqlite3.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Data/src/SessionPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ int SessionPool::dead()
int count = 0;

Poco::Mutex::ScopedLock lock(_mutex);
SessionList::iterator it = _activeSessions.begin();
SessionList::iterator itEnd = _activeSessions.end();
SessionList::iterator it = _idleSessions.begin();
SessionList::iterator itEnd = _idleSessions.end();
for (; it != itEnd; ++it)
{
if (!(*it)->session()->isGood())
Expand Down
1 change: 0 additions & 1 deletion Data/testsuite/src/SessionPoolTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ void SessionPoolTest::testSessionPool()
assertTrue (pool.allocated() == pool.used() + pool.idle());

s6.setFeature("connected", false);
assertTrue (pool.dead() == 1);

s6.close();
assertTrue (pool.capacity() == 4);
Expand Down
23 changes: 21 additions & 2 deletions Foundation/include/Poco/Dynamic/VarHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,32 @@ class Foundation_API VarHolder

private:

template <typename T, std::enable_if_t<std::is_integral_v<T>, bool> = true>
template <typename T>
static constexpr T unpreserveSign(const T& value)
{
if constexpr (std::is_signed_v<T>)
{
return (value < 0) ? -value : value;
}
else
{
return value;
}
}

template <typename T, std::enable_if_t<std::is_same_v<T, bool>, bool> = true>
static constexpr int numValDigits(const T& value)
{
return 1;
}

template <typename T, std::enable_if_t<std::is_integral_v<T> && !std::is_same_v<T, bool>, bool> = true>
static constexpr int numValDigits(const T& value)
{
using U = std::make_unsigned_t<T>;
if (value == 0) return 0;
int digitCount = 0;
U locVal = (std::is_signed_v<T> && value < 0) ? -value : value; // to prevent sign preservation
U locVal = static_cast<U>(unpreserveSign(value)); // to prevent sign preservation
while (locVal >>= 1) ++digitCount;
return digitCount;
}
Expand Down
2 changes: 1 addition & 1 deletion Foundation/include/Poco/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ int icompare(
typename S::size_type pos,
const typename S::value_type* ptr)
{
int n = pos < str.size() ? str.size() - pos : 0;
int n = static_cast<int>(pos < str.size() ? str.size() - pos : 0);
return icompare(str, pos, n, ptr);
}

Expand Down
2 changes: 1 addition & 1 deletion Foundation/samples/trace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ include $(POCO_BASE)/build/rules/exec

else

all:
all clean:

endif
2 changes: 1 addition & 1 deletion Foundation/testsuite/src/ArrayTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void ArrayTest::testConstruction()

for (std::size_t i=0; i<g.size(); ++i)
{
g[i]._data = i;
g[i]._data = static_cast<int>(i);
}

for (std::size_t i=0; i<g.size(); ++i)
Expand Down
4 changes: 2 additions & 2 deletions Foundation/testsuite/src/CoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void CoreTest::testBuffer()
std::vector<int> v;
for (std::size_t i = 0; i < s; ++i)
{
v.push_back(i);
v.push_back(static_cast<int>(i));
}

std::memcpy(b.begin(), v.data(), sizeof(int) * v.size());
Expand All @@ -241,7 +241,7 @@ void CoreTest::testBuffer()
v.clear();
for (std::size_t i = 0; i < s*2; ++i)
{
v.push_back(i);
v.push_back(static_cast<int>(i));
}

std::memcpy(b.begin(), v.data(), sizeof(int) * v.size());
Expand Down
2 changes: 1 addition & 1 deletion Foundation/testsuite/src/PathTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@ void PathTest::testSelf()

assertTrue(p.isAbsolute());
assertTrue(p.isFile());
assertTrue(self.find("testrunner") != std::string::npos);
assertTrue(self.find("testrunner") != std::string::npos || self.find("TestSuite") != std::string::npos);
#else
std::cout << "Path::self() not implemented for this platform."
#endif
Expand Down
4 changes: 2 additions & 2 deletions Foundation/testsuite/src/ProcessRunnerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ void ProcessRunnerTest::testProcessRunner()
{
pr.reset(new ProcessRunner(cmd, args));
failmsg("ProcessRunner should throw an exception.");
} catch(const Poco::FileException& e) {}
} catch(const Poco::FileException&) {}
}
assertTrue (!File(pidFile).exists());
}
Expand All @@ -295,7 +295,7 @@ void ProcessRunnerTest::testProcessRunner()
{
pr.reset(new ProcessRunner(cmd, args));
failmsg("ProcessRunner should throw an exception.");
} catch(const Poco::FileException& e) {}
} catch(const Poco::FileException&) {}
}
assertTrue (!File(pidFile).exists());
}
Expand Down
4 changes: 4 additions & 0 deletions Foundation/testsuite/src/ProcessTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "Poco/PipeStream.h"
#include "Poco/Path.h"
#include "Poco/Format.h"
#include "Poco/Environment.h"


using namespace std::string_literals;
Expand Down Expand Up @@ -152,6 +153,9 @@ void ProcessTest::testLaunchEnv()
Pipe outPipe;
Process::Env env;
env["TESTENV"] = "test";
#if defined(_WIN32)
env["PATH"] = Poco::Environment::get("PATH"); // required for VS
#endif
ProcessHandle ph = Process::launch(cmd, args, 0, &outPipe, 0, env);
PipeInputStream istr(outPipe);
std::string s;
Expand Down
3 changes: 2 additions & 1 deletion Net/include/Poco/Net/MultipartReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "Poco/Net/Net.h"
#include "Poco/BufferedStreamBuf.h"
#include <memory>
#include <istream>


Expand Down Expand Up @@ -150,7 +151,7 @@ class Net_API MultipartReader

std::istream& _istr;
std::string _boundary;
MultipartInputStream* _pMPI;
std::unique_ptr<MultipartInputStream> _pMPI;
};


Expand Down
4 changes: 2 additions & 2 deletions Net/include/Poco/Net/WebSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ class Net_API WebSocket: public StreamSocket
enum SendFlags
/// Combined header flags and opcodes for use with sendFrame().
{
FRAME_TEXT = FRAME_FLAG_FIN | FRAME_OP_TEXT,
FRAME_TEXT = static_cast<int>(FRAME_FLAG_FIN) | static_cast<int>(FRAME_OP_TEXT),
/// Use this for sending a single text (UTF-8) payload frame.
FRAME_BINARY = FRAME_FLAG_FIN | FRAME_OP_BINARY
FRAME_BINARY = static_cast<int>(FRAME_FLAG_FIN) | static_cast<int>(FRAME_OP_BINARY)
/// Use this for sending a single binary payload frame.
};

Expand Down
2 changes: 1 addition & 1 deletion Net/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ add_subdirectory(download)
add_subdirectory(httpget)
add_subdirectory(tcpserver)
add_subdirectory(ifconfig)

add_subdirectory(tcpclient)
7 changes: 1 addition & 6 deletions Net/src/HTTPClientSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,13 @@ std::ostream& HTTPClientSession::sendRequestImpl(const HTTPRequest& request)
#endif
request.write(*_pRequestStream);
}
else if ((method != HTTPRequest::HTTP_PUT && method != HTTPRequest::HTTP_POST && method != HTTPRequest::HTTP_PATCH) || request.has(HTTPRequest::UPGRADE))
else
{
Poco::CountingOutputStream cs;
request.write(cs);
_pRequestStream = new HTTPFixedLengthOutputStream(*this, cs.chars());
request.write(*_pRequestStream);
}
else
{
_pRequestStream = new HTTPOutputStream(*this);
request.write(*_pRequestStream);
}
_lastRequest.update();
return *_pRequestStream;
}
Expand Down
4 changes: 1 addition & 3 deletions Net/src/HTTPServerRequestImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ HTTPServerRequestImpl::HTTPServerRequestImpl(HTTPServerResponseImpl& response, H
#else
_pStream = new HTTPFixedLengthInputStream(session, getContentLength());
#endif
else if (getMethod() == HTTPRequest::HTTP_GET || getMethod() == HTTPRequest::HTTP_HEAD || getMethod() == HTTPRequest::HTTP_DELETE)
else
_pStream = new HTTPFixedLengthInputStream(session, 0);
else
_pStream = new HTTPInputStream(session);
}


Expand Down
13 changes: 4 additions & 9 deletions Net/src/MultipartReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ MultipartStreamBuf::MultipartStreamBuf(std::istream& istr, const std::string& bo
_boundary(boundary),
_lastPart(false)
{
poco_assert (!boundary.empty() && boundary.length() < STREAM_BUFFER_SIZE - 6);
}


Expand All @@ -47,7 +46,7 @@ MultipartStreamBuf::~MultipartStreamBuf()

int MultipartStreamBuf::readFromDevice(char* buffer, std::streamsize length)
{
poco_assert_dbg (length >= _boundary.length() + 6);
poco_assert (!_boundary.empty() && _boundary.length() < length - 6);

static const int eof = std::char_traits<char>::eof();
std::streambuf& buf = *_istr.rdbuf();
Expand Down Expand Up @@ -175,23 +174,20 @@ MultipartInputStream::~MultipartInputStream()


MultipartReader::MultipartReader(std::istream& istr):
_istr(istr),
_pMPI(0)
_istr(istr)
{
}


MultipartReader::MultipartReader(std::istream& istr, const std::string& boundary):
_istr(istr),
_boundary(boundary),
_pMPI(0)
_boundary(boundary)
{
}


MultipartReader::~MultipartReader()
{
delete _pMPI;
}


Expand All @@ -209,8 +205,7 @@ void MultipartReader::nextPart(MessageHeader& messageHeader)
throw MultipartException("No more parts available");
}
parseHeader(messageHeader);
delete _pMPI;
_pMPI = new MultipartInputStream(_istr, _boundary);
_pMPI = std::make_unique<MultipartInputStream>(_istr, _boundary);
}


Expand Down
6 changes: 3 additions & 3 deletions Net/src/NTLMCredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ bool NTLMCredentials::parseChallengeMessage(const unsigned char* buffer, std::si
reader.readRaw(7, signature);
if (signature != NTLMSSP) return false;

Poco::UInt8 zero;
Poco::UInt8 zero = 1;
reader >> zero;
if (zero != 0) return false;

Expand All @@ -219,7 +219,7 @@ bool NTLMCredentials::parseChallengeMessage(const unsigned char* buffer, std::si

BufferDesc targetDesc;
readBufferDesc(reader, targetDesc);
if (targetDesc.offset + targetDesc.length > size) return false;
if (targetDesc.offset > size || targetDesc.offset + targetDesc.length > size) return false;

reader >> message.flags;

Expand All @@ -236,7 +236,7 @@ bool NTLMCredentials::parseChallengeMessage(const unsigned char* buffer, std::si
if (message.flags & NTLM_FLAG_NEGOTIATE_TARGET)
{
readBufferDesc(reader, targetInfoDesc);
if (targetInfoDesc.offset + targetInfoDesc.length > size) return false;
if (targetInfoDesc.offset > size || targetInfoDesc.offset + targetInfoDesc.length > size) return false;
}

if (targetDesc.length > 0)
Expand Down
2 changes: 1 addition & 1 deletion Net/src/PollSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class PollSetImpl
// if we are hitting the events limit, resize it; even without resizing, the subseqent
// calls would round-robin through the remaining ready sockets, but it's better to give
// the call enough room once we start hitting the boundary
if (rc >= _events.size())
if (rc > 0 && static_cast<size_t>(rc) >= _events.size())
{
_events.resize(_events.size()*2);
}
Expand Down
2 changes: 1 addition & 1 deletion Net/src/SocketImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ std::streamsize SocketImpl::sendFileBlockwise(FileInputStream& fileInputStream,
while (n > 0 && (count == 0 || len < count))
{
len += n;
sendBytes(buffer.begin(), n);
sendBytes(buffer.begin(), static_cast<int>(n));
if (count > 0 && len < count)
{
const std::size_t remaining = count - len;
Expand Down
Loading
Loading