Commit Graph

1769 Commits

Author SHA1 Message Date
Günter Obiltschnig
e732c50f96 enh: added Poco::ResourceLimitException 2024-11-28 08:32:22 +01:00
Günter Obiltschnig
cecccf7b74 enh(Foundation): add Poco::Process::timesMicroseconds() 2024-11-21 08:50:49 +01:00
Matej Kenda
52959b91da
DB logger sample (#4759)
* sample(DBLogger): New sample to demonstrate DB logging to a file. (#4750)

* sample(DBLogger): Create messages via SQL logger in a thread (#4750)

* sample(DBLogger): Save messages from SQL files to an SQL database (works with SQLite) (#4750)

* chore(Makefile): Data samples depend on PocoUtil (#4750)

* sample(DBLogger): Refactored DBLogger with std::filesystem::directory_iterator and std::thread.

* sample(DBLogger): Add missing include <condition_variable>

* sample(DBLogger): Extracted log scanning and inserting functionality to class SQLLogInserter.

* sample(DBLogger): Create new logging table only when using demo messages option.

* feat(DBLogger): VS projects

* sample(DBLogger): Acquire options from configuration file.

* feat(DBLogger): regenerate VS projects (progen file change)

* sample(DBLogger): Add example DBLogger.properties file.

* sample(DBLogger): Process as much as possible when stopping processing.

* sample(DBLogger): Meaningful defaults in properties file.

* sample(DBLogger): Verify validity of database session on startup.

* sample(DBLogger): Configure demo SQL channel in properties file.

* chore(DBLogger): style and warnings

---------

Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
2024-11-18 17:06:20 +01:00
Matej Kenda
cb91880bfb fix(cmake): properly define POCO_DLL and POCO_STATIC based on BUILD_SHARED_LIBS. 2024-11-14 08:14:08 +01:00
Aleksandar Fabijanic
9530a77347
Insert NULL using BULK #4001 (#4755)
* fix(ODBC): Insert NULL using BULK #4001
resolve bound types and sizes at compile time

* fix: remove string suffix for static_assert

* Insert NULL using BULK #4001

* fix: typo

* fix(SQLite): missing functions; consolidate extract calls

* chore(SQLite): remove unnecessary typedef

* fix(SQLite): remove duplicate functions

* fix(SQLite): compile errors and warnings

* fix(SQLite): extract implementation signatures

* fix(SQLite): long64 platforms compile errors

* fix(SQLite): long64 platforms compile errors, part ii

* fix(ODBC): windows build

* fix(ODBC): MSSQL big string on windows

* fix(Data): psql and mysql compile errors

* fix(PostgreSQL): add missing functions

* fix(ODBC): revert column size discovery (breaks Oracle)

* fix(PostgreSQL): Nullable extraction #4001

* fix(MySQL): Nullable extraction #4001

* chore(Data): code tidy up

* fix(ODBC): add missing changes
2024-11-11 18:23:21 +01:00
nitram96
6dadf9adc5
Activity now sets _running flag to false when it finishes (#4748)
Activity _running flag is now set to false when the activity finishes or throws, previously it was only set if wait had been called. Added test for this scenario
2024-10-30 16:59:08 +01:00
Eric Eichhorn
82c17ea813 fix: aix build #4742 2024-10-23 13:51:06 +02:00
Matej Kenda
c735162abc
fix(NamedEvent): Release semaphore ID in dtor when created with semget (fixes #2971) (#4357)
* fix(NamedEvent): Release semaphore ID in dtor when created with semget (#2971)

* Temporary: trying to solve for non-Linux semaphores.

* chore(NamedEvent): Cleanup of Posix NamedEvent and fixes of unit test.
2024-10-20 10:05:50 +02:00
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
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
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
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
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
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
54bc0fcb47 enh(Foundation): #4690: protect against buffer overflow caused by buggy TextEncoding implementations 2024-09-26 10:26:22 +02:00
Matej Kenda
e55bb7032d enh(Nullable, Optional): reimplement using std::optional (#4502) 2024-09-25 08:18:35 +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
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
siren186
94a693dff5
enh(Path): ensure directory path ends with separator (#4679) 2024-09-12 09:58:12 +02:00
Aleksandar Fabijanic
0bce71de24
ProcessRunner erases its PID file name #4648 (#4649) 2024-09-11 20:01:52 +02:00
siren186
201d32137b
fix(build): Foundation VS project files (#4660) 2024-09-10 16:52:05 +02:00
Matej Kenda
91c256095f
enh(FileStream): Add FileStreamBuf::resizeBuffer to set larger internal buffers. (#4621)
Larger buffers improve performance significantly when streaming large quantity of data on very fast devices.
2024-09-09 17:33:50 +02:00
Alexander B
710c2a41f3
Using native sendfile from OS for HttpServer (#4351)
* add possibility to use native sendFile from OS for HttpServerResponse
add option POCO_USE_SENDFILE_FOR_HTTPSERVER, default - OFF
add test for HttpServer - testFile
add define fro Config.h POCO_USE_SENDFILE_FOR_HTTPSERVER

* my fail, be carefull with macro and brackets

* replace option POCO_USE_SENDFILE_FOR_HTTPSERVER with compiletime
detected macro POCO_HAVE_SENDFILE
replace types for sendFile with platform depended
wrap possibility of using sendFile with macro, if sendFile doesn't exist
in OS, then all methods don't exist

* remove option POCO_USE_SENDFILE_FOR_HTTPSERVER from ci.yml

* wrap testSendFile in the suite with define POCO_HAVE_SENDFILE

* try fix compile problem with emscripten

* oh, emscripten again

* fix logical error in testSendFile

* fix problem with cmake-specific macro when usinf make-project

* revert types from platform depended to Poco::Int64 and Poco::UInt64
for sendfile
2024-09-01 20:45:33 +02:00
siren186
73df3689bf
enh(Poco::ActiveThreadPool): make it easy to use correctly (#4624)
* make Poco::ActiveThreadPool easy to use (#4544)

* code format

* Fix ThreadSanitizer thread leak error

* enh(ActivePooledThread): Change pointers to references

* enh(ActivePooledThread): remove unused method

* enh(Poco::ActiveThreadPool): Use std::unique_ptr instead of raw pointer

* enh(Poco::ActiveThreadPool): Use C++ static_cast instead of C casting

* enh(Poco::ActiveThreadPool): Use standard containers instead of implementing own

* enh(Poco::ActiveThreadPool): Change pointer to reference

* enh(Poco::ActiveThreadPool): Use smart pointers instead of bare pointers

* enh(Poco::ActiveThreadPool): Fix codeql warning: A stack address which arrived via a  may be assigned to a non-local variable.

* enh(Poco::ActiveThreadPool): More test case

* enh(Poco::ActiveThreadPool): std::optional::value unavailable on earlier macOS versions

* enh(Poco::ActiveThreadPool): Fix compare function for make heap

* enh(Poco::ActiveThreadPool): Add more test case

* enh(Poco::ActiveThreadPool): Add more test case

* enh(Poco::ActiveThreadPool): Code style

* enh(Poco::ActiveThreadPool): Test case

* enh(Poco::ActiveThreadPool): Test case

* enh(Poco::ActiveThreadPool): Fix test case error

* Revert "enh(Poco::ActiveThreadPool): std::optional::value unavailable on earlier macOS versions"

This reverts commit cba4673b47.

* enh(macOS): require min deployment macOS version 10.15 which has full support for C++17

* enh(Poco::ActiveThreadPool): Remove useless "{}"

* enh(Poco::ActiveThreadPool): Rename member variable m_impl to _impl

---------

Co-authored-by: Matej Kenda <matejken@gmail.com>
2024-08-30 11:54:44 +02:00
siren186
aa8084c6a0
enh(ScopedLockWithUnlock): make it more alike std::unique_lock (#4652) 2024-08-29 22:03:33 +02:00
Matej Kenda
7345bf34f9
fix(SimpleFileChannel): unify default "flush" to be false as it is in "FileChannel" (#4591) (#4622) 2024-08-17 07:31:06 +02:00
Aleksandar Fabijanic
669be63134
Allow set enum as json value (#4363) (#4434)
* Allow set enum as json value (#4363)

* fix issue #4341
add testEnum
if you set enum as json value then it will be cast to int

* add behavour for enum into VarHolderImpl
add tests for enum classes with differnent underline integral types

* replace static_cast with convertTo* methods, they can chaeck types and
limits

* fix missing types for convert methods

* fix code style
add testEnumType to the VarTest.cpp, extract() works

* enh(VarHolder): replace ::value and ::type with shortcuts

---------

Co-authored-by: Alexander B <ale.bychuk@gmail.com>
2024-07-29 23:30:51 +02:00
Aleksandar Fabijanic
3656f069e1
enh(ProcessRunner): does not detect launch errors #4482 (#4483)
* enh(ProcessRunner): does not detect launch errors #4482

* enh(File): add absolutePath and existsAnywhere() #4482

* fix windows build and tsan fail

* fix tsan

* fix windows file tests

* comment out some CI env path -related issues

* fix tsan and windows build

* try to fix ci

* ignore ProcessRunner test fail on windows cmake

* enh(File): canExecute throws FileNotFoundException if the file to be executed can't be found in the path.

* Few C++ modernisation changes.

* enh(File): Windows specifics of File::canExecute. Returns false if the file to be executed can't be found using absolutePath.

---------

Co-authored-by: Matej Kenda <matejken@gmail.com>
2024-07-29 20:16:18 +02:00
Matej Kenda
f24547cdcf enh(Poco): Mark deprecated functionality with C++ attributes and resolve internal usage of deprecated functions (#4551)
* enh(poco): Replace deprecated comments with C++ deprecated attribute.

* enh(Poco): Replace some deprecated functionality in Poco sources. (#4426)

* enh(Poco): Replace more deprecated functionality in Poco sources. (#4426)

* fix(CMake): Variable BUILD_SHARED_LIBS must be defined properly to create valid binaries.

* enh: Code improvements done while resolving deprecated functionality (#4426)

* Un-deprecate LocalDateTme (#4426)

* enh(Poco): Replace usage of deprecated functionality with other functions/classes (#4426)

* chore(SSL): temporarily un-deprecate SSL-related functionality (#4426)

* chore(SSL): temporarily un-deprecate old MongoDB protocol functionality (#4426)

* enh(Poco): Minor Hash improvements (#4426)

* enh(Foundation): Compile deprecated hash tests only when POCO_TEST_DEPRECATED is enabled (#4426)

* enh(Net): Compile deprecated Socket::select functionality only when POCO_TEST_DEPRECATED is enabled (#4426)

* enh(Bonjour): Replace deprecated Socket::select with PollSet (#4426)

* enh(Poco): Introduce POCO_DEPRECATED macro to have the ability to disable deprecation warnings in applications (#4426)

* test(ODBC): add few asserts to testStoredProcedureDynamicVar

* fix(ODBC): rename DynamicAny -> DynamicVar in tests

* fix(ODBC): make Dignostics static members inline to prevent explicit instantiation warnings on windows

---------

Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
2024-07-29 08:37:35 +02:00