Commit Graph

5871 Commits

Author SHA1 Message Date
Aleksandar Fabijanic
e5752a5c6d
File lock (#4734)
* add RWLock implementation for file [posix]

* add implementation FileStreamRWLock for windows
replace FileStreamRWLock to the Process package

* add files FileStreamRWLock* into makefile and vcproj

* remove unnecessary file from makefile

* use absolute path to the TesApp with ProcessRunner

* fix vc*.proj

* add new test files into vc.proj.filters

* fix comments

* fix spelling fo PR #4723
add atomic_bool _locked and check if FileStreamRWLock is locked on
destruction for force unlock

* add atomic header

* File lock (#4740)

* throw error on any errno not only on EDEADLK

* fix function naming

* fix windows build

* fix windows build

---------

Co-authored-by: Alexander B <ale.bychuk@gmail.com>
Co-authored-by: bas524 <bas524@ya.ru>
2024-10-16 23:58:00 +02:00
Matej Kenda
6f34ec89ce fix(cmake): increase minimum version to 3.15, fix Data::PostgreSQL include target, remove unnecessary cmake modules that are provided with CMake itself (#4540) 2024-10-16 12:09:24 +02:00
Aleksandar Fabijanic
f0a29487b6
feat(ServerApplication): termination callback #4643 (#4733)
* feat(ServerApplication): termination callback #4643

* chore(ServerApplication): spelling fix #4643

* chore(ServerApplication): correct documentation #4643
2024-10-15 17:49:28 +02:00
Aleksandar Fabijanic
71a085c1dc
chore(JSON): add stringify unicode tests #4707 (#4720)
* chore(JSON): add stringify unicode tests #4707

* enh(Mutex): Error code for pthread_mutex_lock failure #4712
2024-10-14 13:48:45 +02:00
Aleksandar Fabijanic
8e958f685f
2808 data nullable (#4729)
* chore(CppUnit): disable MSVC secure warning

* chore(Data): regenerate VS projects

* chore(DataTest): regenerate VS projects

* chore(Data/testsuite): regenerate VS projects

* chore(DataTest): fix VS90 project

* fix(ODBC): Failed to insert Poco::Nullable< Poco::Data::Date> data into MSSQL using ODBC #2808

* chore(Foundation): add Trace to VS project

* chore(Trace): add Trace VS projects #4692

* fix: g++ and clang build #2808
2024-10-12 20:42:39 +02:00
tyler92
aa0faed54f
test: move fuzzing tests from google/oss-fuzz repository (#4719) 2024-10-10 13:30:10 +02:00
Matej Kenda
c038b52f36 chore(Poco): Resolve a lot of warnings, reported by g++ 13. 2024-10-10 10:41:24 +02:00
Aleksandar Fabijanic
88c4958032
Serializable Isolation level for SQLite Databases (#4693)
* fix #4536
I've add transaction isolation support for SQLite
Warning! SQLite transactions are [serializable by design](https://
www.sqlite.org/isolation.html) but my implementation retuns false in
function hasTransactionIsolation and throw an exception in
setTransactionIsolation

* disable shared cache in TearDown()

* chore(doc): reword documentation

* we should waitresult of select before rollback (#4718)

---------

Co-authored-by: Alexander B <ale.bychuk@gmail.com>
2024-10-10 10:41:02 +02:00
Aleksandar Fabijanic
eaabd3ff8d
Stack trace (#4691)
* chore(Trace): add dev env settings

* add(Trace): init add Poco::trace and libbacktrace files

* feat(Exception): generate stack trace if enabled at compile time

* chore(DNSSD): remove binaries from git

* fix(Trace): build

* chore(ci): exclude exception text tests for trace build; add debug test script params

* chore(build): mac (dl)

* chore(cmake): Changes to build Trace with CMake.

* chore(cmake): Changes to build Trace on Windows

* chore(cmake): Improvements to include trace sample.

* chore(cmake): Fixes to properly build/link Trace on Linux

* chore(cmake): add_definitions --> add_compile_definitions

* chore(cmake): Build Trace as static and don't export it.

* chore(make): Link Trace with built-in libbacktrace on Linux

* chore(Trace): remove unnecessary sources for libbacktrace.

* chore(github): enable trace on a few github checks

* chore(cmake): Build Trace with clang++ on Linux.

* chore(cmake): Properly set POCO_ENABLE_TRACE globally when needed.

* fix(cmake): Trace: corrected include for clang on Linux

---------

Co-authored-by: Matej Kenda <matejken@gmail.com>
2024-10-10 10:36:13 +02:00
Matej Kenda
a1efeaa72d
GitHub runner ubuntu 24.04 and resolve some issues (#4727) 2024-10-09 21:53:49 +02:00
Matej Kenda
13bbea759f Merge branch 'github-macos-runners-update' 2024-10-07 17:08:36 +02:00
Marco Rebhan
3b79a51722 Explicitly define conditional LOB constructors for const (w)string &
This fixes compilation against libcxx 19, which removed the
non-standard specializations for std::char_traits including the one
for unsigned char, which would get instantiated for BLOB.
See https://reviews.llvm.org/D138307 and
https://reviews.llvm.org/D157058.

Closes #4722.
2024-10-07 13:59:19 +02:00
Matej Kenda
568f325417 chore(gitlab): macos-12 images are being deprecated, update ci.yml to use newer ones.
https://github.com/actions/runner-images/issues/10721
2024-10-07 13:57:33 +02:00
Günter Obiltschnig
a3cb7cc4b2 chore: remote unused getNode() declaration 2024-10-07 13:08:30 +02:00
Matej Kenda
3c01eec7cf fix(Exception): static assert to make sure that _HAS_EXCEPTIONS is set (#4668). 2024-10-04 13:01:29 +02:00
Matej Kenda
aab4058bae
Hide zlib and expat libs from the user of Poco libraries (replaces #4579) (#4724)
* foundation: Remove unused ucp.h

Nothing use this and it is not even included in Visual Studio project
files. Remove it so it will not confuse any more.

* foundation: Hide zlib from user

Hide zlib completly from user. This way we do not need to publish zlib.h
or zconfig.h.

As we now have two different pointer initalizing in constructor I choose
to use unique pointers so it is more obvious those are safe. I also
choose to use make_unique which default initalize z_stream_t. This makes
code more readable as we do not need to specifie every field of
z_stream_t. It really should not matter much if we initialize couple
field for nothing. If does we should add comment about that. Still
keeping _buffer without inializing as it is quite big.

* xml: Hide expat and ParserEngine from user

Hide expat completly from user. This way we do not need to publish
expat.h or expat_external.h.

I move also headers to orignal locations so diff is smaller compared to
original.

* chore(Foundation): Compression level constants

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2024-10-04 09:50:39 +02:00
Aleksandar Fabijanic
af3b3b1902
Poco::DateTime uses assertions for validation #1540 (#4640)
* Poco::DateTime uses assertions for validation #1540

* fix(DateTime): fix ASAN buf overflow

* fix(DateTime): allow negative year (TODO: 0 Julian day Gregorian year value)
2024-10-03 10:58:13 +02:00
vfjpl
64c751f3a3
Add missing relational operators to VarIterator (#4714)
* Add missing relational operators to VarIterator

* Add tests for relational operators of VarIterator
2024-10-03 10:52:45 +02:00
Matej Kenda
f3975eba96
pcre2: Version 10.44 (#4478) (#4678)
* update(pcre2): Version 10.44 (#4478)

* update(pcre2): Add new file to VS project files (version 10.44) (#4478)

* fix(RegEx): Use generic pcre2 function names (without suffix _8).

* update(pcre2): Fix configuration (define PCRE2_STATIC) (#4478)
2024-10-03 10:49:27 +02:00
Günter Obiltschnig
04fe04e3a4 chore: add test case for replaceInPlace() 2024-09-28 12:05:08 +02:00
Günter Obiltschnig
0300b42dbc enh: respect POCO_NO_WSTRING in String.h 2024-09-28 11:51:04 +02:00
Günter Obiltschnig
a5d6034ab9 fix: replaceInPlace() std::wstring #4713 2024-09-28 11:38:35 +02:00
Günter Obiltschnig
a525065ebc
Merge pull request #4717 from pocoproject/feat/json-logging
Logging: JSONFormatter
2024-09-27 23:34:54 +02:00
Günter Obiltschnig
32bf4e6368 chore: update VS project files for JSONFormatter 2024-09-27 21:12:32 +02:00
Günter Obiltschnig
91b9ae8f29 feat(Foundation): added JSONFormatter, supporting JSON-formatted logging 2024-09-27 20:58:05 +02:00
Günter Obiltschnig
d911539cd3
Merge pull request #4715 from pocoproject/4710-utf8proc
Add UTF8String::normalize(), implemented with utf8proc (#4710)
2024-09-27 16:13:05 +02:00
Günter Obiltschnig
0880eed7b6 chore: ci: install utf8proc 2024-09-27 14:58:04 +02:00
Guenter Obiltschnig
970c8108b7 fix: unbundled build for utf8proc 2024-09-27 14:16:40 +02:00
Günter Obiltschnig
3d0b9d7338 chore: remove unneeded iostreams header 2024-09-27 13:53:56 +02:00
Günter Obiltschnig
f04eee0650 chore: add UTF8PROC_STATIC to Makefile 2024-09-27 13:45:27 +02:00
Günter Obiltschnig
23b9196ce9 chore: utf8proc on VC 2024-09-27 13:40:18 +02:00
Günter Obiltschnig
92e06497f5 feat(Foundation): Include utf8proc for enhanced Unicode support (#4710) 2024-09-27 12:46:13 +02:00
Günter Obiltschnig
6faf90773a fix(Foundation): Build error with GCC-15 (class Poco::PriorityDelegate<TObj, void, true>’ has no member named ‘_pTarget’) (#4695) 2024-09-27 08:53:18 +02:00
Günter Obiltschnig
962dd24e6b fix(Foundation): Poco::Placeholder initialization uses wrong size (#4711) 2024-09-26 18:42:48 +02:00
Günter Obiltschnig
072e980e1d feat(Foundation): Poco::UUID/UUIDGenerator: add support for Version 6 and 7 UUIDs (#4580) 2024-09-26 13:27:47 +02:00
Günter Obiltschnig
db1cc9507b fix(Net): HTTPCookie Constructor Fails to Handle Discard Attribute Properly (#4664) 2024-09-26 11:25:44 +02:00
Günter Obiltschnig
42ccb0d96d enh(Net): SMTPClientSession: replace bare newlines in message content with CRLF (#4689) 2024-09-26 11:16:36 +02:00
Günter Obiltschnig
54bc0fcb47 enh(Foundation): #4690: protect against buffer overflow caused by buggy TextEncoding implementations 2024-09-26 10:26:22 +02:00
Günter Obiltschnig
ce9c08a2d8 chore(XML): modernization: use nullptr instead of 0 2024-09-26 09:14:44 +02:00
Günter Obiltschnig
3b4a8ea6e7 fix(XML): fuzzing stack overflow (#4629). Limit maximum XML element depth. 2024-09-26 09:03:31 +02:00
Günter Obiltschnig
3a8c6a72b1
Merge pull request #4683 from pocoproject/expat_version_2.6.3
Bundled expat version 2.6.3
2024-09-25 18:45:51 +02:00
Matej Kenda
9a7da6d6fd update(expat): version 2.6.3 2024-09-25 16:44:03 +02:00
Matej Kenda
e55bb7032d enh(Nullable, Optional): reimplement using std::optional (#4502) 2024-09-25 08:18:35 +02:00
Sergei Trofimovich
03c35cff93 SimpleRowFormatter.h: fix the build on gcc-15 (unsatisfied noexcept)
On today's `gcc-15` poco fails to build as:

    In file included from /build/source/Data/include/Poco/Data/Statement.h:27,
                     from /build/source/Data/include/Poco/Data/Session.h:23,
                     from /build/source/Data/include/Poco/Data/ArchiveStrategy.h:22,
                     from /build/source/Data/src/ArchiveStrategy.cpp:15:
    /build/source/Data/include/Poco/Data/SimpleRowFormatter.h:114:21: error: declaration of 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_construc
    tible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) noexcept [with _Tp = Poco::Data::SimpleRowFormatter; _Require<__not_<__is_tuple_like<_Tp> >, is_move_constructible<_Tp>, is_move_assignable<_Tp> > = void]' has a different exception specifier
      114 |         inline void swap<Poco::Data::SimpleRowFormatter>(Poco::Data::SimpleRowFormatter& s1,
          |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /nix/store/...-gcc-15.0.0/include/c++/15.0.0/bits/new_allocator.h:36,
                     from /nix/store/...-gcc-15.0.0/include/c++/15.0.0/x86_64-unknown-linux-gnu/bits/c++allocator.h:33,
                     from /nix/store/...-gcc-15.0.0/include/c++/15.0.0/bits/allocator.h:46,
                     from /nix/store/...-gcc-15.0.0/include/c++/15.0.0/string:43,
                     from /build/source/Foundation/include/Poco/Foundation.h:94,
                     from /build/source/Data/include/Poco/Data/Data.h:23,
                     from /build/source/Data/include/Poco/Data/ArchiveStrategy.h:21:
    /nix/store/...-gcc-15.0.0/include/c++/15.0.0/bits/move.h:214:5: note: from previous declaration 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) noexcept (false) [with _Tp = Poco::Data::SimpleRowFormatter; _Require<__not_<__is_tuple_like<_Tp> >, is_move_constructible<_Tp>, is_move_assignable<_Tp> > = void]'
      214 |     swap(_Tp& __a, _Tp& __b)
          |     ^~~~

Possibly because `SimpleRowFormatter` does not have constructors and
assignment operators that involve rvalue references?

Updated `noexcept` condition. Fixes the build on` gcc-15`. Still
compiles on `gcc-13`.
2024-09-20 19:27:33 +02:00
Matej Kenda
cd06553d89 chore(patches): Apply some patches that Debian applies when building deb packages. 2024-09-18 07:36:57 +02:00
Matej Kenda
83377c699c
cmake(OpenSSL): Remove possibility to build with internal OpenSSL build (#4388) (#4685) 2024-09-14 19:24:01 +02:00
Aleksandar Fabijanic
af104884df
enh(JSON): upgrade pdjson (#4686) 2024-09-14 00:49:22 +02:00
Mikhail Khachayants
cefab15f9f fix(MailMessage): double free if Content-Disposition is empty 2024-09-13 16:45:38 +02:00
siren186
71a9bdafbd
4557 ndc thread local (#4682)
* fix(NestedDiagnosticContext): NDC crashed in multi-thread environment

* fix(NestedDiagnosticContext): TestCase output redirect

* enh(NestedDiagnosticContext): replace Poco::ThreadLocal to C++ standard thread_local so that objects can dtor when thread exit

* enh(NestedDiagnosticContext): remove unused header files

* chore(NDCTest): verify dump content

* chore(NDCTest): use __FILE__ macro

* fix(NDCTest): fix codeql warning

* fix(NDCTest): remove temp code

* enh(NestedDiagnosticContext): add nameOnly for dump

---------

Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
2024-09-12 12:26:49 +02:00
Matej Kenda
b85b49643e
zlib: Version 1.3.1 in module PDF (#4582) (#4681)
* update(zlib): Version 1.3.1 in module PDF (#4582)

* update(zlib): remove gzio from VS project files and Makefile
2024-09-12 10:07:48 +02:00