Commit Graph

140 Commits

Author SHA1 Message Date
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
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
siren186
2812dd7049
enh(Application): add ignoreUnknownOptions() function (#4661)
* enh(Application): remove useless function

* enh(Application): add ignoreUnknownOptions() function

* fix(OptionSet): comment error

* enh(Application): public two functions: getApplicationPath/getApplicationDirectory

* enh(Application): make findAppConfigFile function public and virtual

* style(Application): code alignment

* fix(Application): do not re-throw exception
2024-09-11 19:55:29 +02:00
siren186
e4aaeacea8
fix(HelpFormatter): lost one space between key and value (#4631) 2024-08-17 07:57:09 +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
Matej Kenda
bc29f30e5c
end(ServerApplication): Add --pid option to ServerApplication on Windows. (#4559) (#4567) 2024-06-02 03:08:18 +02:00
Günter Obiltschnig
33638df51e enh: #4216: use std::string literals 2024-01-30 09:35:35 +01:00
Kari Argillander
708a5d8307
RFC: Remove Windows CE support (#4342)
* Remove _WIN32_WCE macro

Poco now use C++17 and Windows CE does not support it and VS2017 does
also not support it so we can just remove Windows CE code. First remove
all macro usages from our own files.

* Remove WinCE support from build files

Poco now use C++17 and Windows CE does not support it and VS2017 does
also not support it so we can just remove Windows CE code. Remove all
references from build systems / scripts.

* Remove Windows CE related source and header files

Poco now use C++17 and Windows CE does not support it and VS2017 does
also not support it so we can just remove Windows CE code. First remove
all macro usages from our own files.

* Remove wcelibcex folder

Poco now use C++17 and Windows CE does not support it and VS2017 does
also not support it so we can just remove Windows CE code. First remove
all macro usages from our own files.

* Remove rest Windows CE mentions

There where some Windows CE mentions left. Remove those.

* Update Windows CE documentation

We should keep documentation some time so people can find reason for
remove.

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2023-12-14 00:25:04 +01:00
Pavle Dragisic
f30d759c08
Virtualize ServerApplication::handlePidFile() (#4223)
* feat(OptionSet): Add replaceOption() #4181

* revert changes #4181

* feat: make ServerApplication::handlePidFile virtual #4181

* move handlePidFile() out of ifdef #4181

* fix(ServerApplication): move handlePidFile() out of all ifdefs #4181

---------

Co-authored-by: Pavle <pavle@debian-gnu-linux-11.localdomain>
Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
2023-11-21 06:36:36 +01:00
Andrey Masloboev
feee1650e4
fixed infinite loops (#4200)
- fixed infinite loops in config utils operation with broken streams
- added tests

Co-authored-by: Andrey Masloboev <amasloboev@topcon.com>
2023-10-19 13:26:44 +02:00
Günter Obiltschnig
33d5d9c083 #4182: Util: Make load()/save()/clear() operations on configurations thread-safe 2023-10-12 10:38:41 +02:00
Günter Obiltschnig
22213f1111 #4173: AbstractConfiguration: when expanding property references, allow specifying a default value; #4174: AbstractConfiguration: support Int16/UInt16 and Int32/UInt32 2023-09-30 14:18:10 +02:00
Günter Obiltschnig
0a4f64c8d2 #3876, also for SystemConfiguration 2023-06-06 13:12:35 +02:00
Vojin Ilic
b8d1792fa0 Fix hang in destructor
Consider following situation. A class owns a timer. In destructor of that class we call .cancel() asynchronous on timer before it's destruction.
Now timer is executing cancel in it's own internal thread, while it's doing that destructor of timer is called from owner's destructor. Timer destructor enqueues stop notification. If that enqueue is happening just after while loop from cancel notification, stop notification is gonna be dropped and timer will never stop.
Fix: Add new method in TimedNotificationQueue which will return a notification regardless of the time it needs to be executed.
Get number of pending tasks in the queue. Flush out that many notifications from queue while taking special consideration of pending Stop and Cancel notifications.
Add test for new method in TimedNotificationQueue and fix cancel all tests to actually check if notification got executed.
fixes #3986
2023-04-04 12:08:49 +02:00
vojinilic
687f9fb2f5
Revert "Fix dead lock on Timer destructor (#3987)" (#3994)
This reverts commit 39a8b9a7c7.

Co-authored-by: Vojin Ilic <vilic@nvidia.com>
2023-04-04 00:34:08 -05:00
vojinilic
39a8b9a7c7
Fix dead lock on Timer destructor (#3987)
Consider following situation. A class owns a timer. In destructor of that class we call .cancel() asynchronous on timer before it's destruction.
Now timer is executing cancel in it's own internal thread, while it's doing that destructor of timer is called from owning class. Timer destructor enqueues stop notification. If that enqueue is happening just after while loop from cancel notification, stop notification is gonna be dropped and timer will never stop.

fixes #3986

Co-authored-by: Vojin Ilic <vilic@nvidia.com>
2023-03-30 05:46:03 -05:00
Alexander B
3852a6b6c2
Solaris.build fix #3843 and #3643 (#3939)
* try fix compilation for solaris

* this commit for issue #3843 and #3643
changes in Types.h allow ignore problem with declaration of std::int8_t. int8_t can be defined as char or signed char. IMHO we need strong types for Poco::Int's

Envelop.cpp contains initializer for EVP_CIPHER_CTX_init, because this function prototype depends on openssl version.

Application.cpp contains includes especial for SOLARIS, for ioctl support

ClassLoaderTest.cpp and SharedLibraryTest.cpp contains changes because loadlibrary(dlopen) doesn't load library from current directory by default

LocalDateTimeTest.cpp contains changes because SOLARIS use std::tm without tm_gmtoff

* fix : define of SOLARIOS OS in LocalDateTimeTest

* remove unnecessary wrapper

* fix output dir for windows build with multi-config build

* try to fix bug with unixodbc version in linux-builds
[read here](https://github.com/microsoft/linux-package-repositories/issues/36)

* try to fix bug with unixodbc version in linux-builds
[read here](https://github.com/microsoft/linux-package-repositories/issues/36)

* fix : warning in main cmake for if-condition for multi-config build
fix : error for linux-gcc-make-cxx20, use --allow-downgrades for unixodbc

* fix : warning for cmake windows builds
revert changes for linux-gcc-make-cxx20

* revert ci.yml, remove unixodbc version

* try re-run build

---------

Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
2023-03-18 01:28:47 -05:00
Alexander Gololobov
0fd1749b81
Use map from key to count instead of multiset (#3885)
* Test that enumerates lots of elements with the same name

* Use map from key to count instead of multiset

Co-authored-by: Alexander Gololobov <{ID}+{username}@users.noreply.github.com>
2023-01-24 00:52:23 -06:00
Vojin Ilic
46a55303ae Fix deadlock in Timer when one sync and one async cancel requests are issued
Timer is implemented with internal queue. If a user wants to cancel all pending tasks it can call .cancel to schedule CancelNotification.
As a part of processing of CancelNotification it will just flush the whole queue. It does have special processing for StopNotification so that Timer destruction doesn't get blocked.
Now if we first schedule async cancel and before this first cancel is processed we schedule another cancel but this time a sync second one will block because it is never notified that all tasks are canceled, _finished event is never set on that flushed CancelNotification.

Fix: add diffrent processing in case of CancelNotification to set all of it's _finished events.
Also add a test for this situation.
2023-01-16 11:53:11 +01:00
John Vandenberg
0e6e16645c
Remove trailing whitespace (#3668) 2022-07-07 04:18:20 -05:00
Aleksandar Fabijanic
168f1eb6e2
As of C++11, std::swap is noexcept. #2386 (#3645)
* As of C++11, std::swap is noexcept. #2386

* fix(Any): remove throw on swap

* fix(Any): As of C++11, std::swap is noexcept. #2386

* fix(Any): make size const #2386

* fix(SimpleRowFormatter): clang won't compile noexcept #2386

* a couple of arm fixes

* fix(Any): As of C++11, std::swap is noexcept. #2386

* fix(AnyTest): local() for POCO_NO_SOO# 2386

* test(RSACipher): RSA encryption without private key #2367

* chore(RSACipherTest): delete ciphers #2367
2022-06-28 12:14:36 -05:00
Alex Fabijanic
37cb890e58 fix(ConfigurationView): ConfigurationView and JSON is broken for array access #3635 2022-06-20 20:59:10 +02:00
Alex Fabijanic
41f11b02bc chore(LocalConfigurationView): fix style #3529 2022-06-20 17:48:53 +02:00
Aleksandar Fabijanic
ff879f5905
Fix/tsan (#3617)
* fix(Foundation): tsan warnings fixes

* fix(Thread_POSIX): tsan warnings fixes; add tsan.suppress

* fix(Util): tsan fixes

* fix(netSSL_OpenSSL): tsan fixes

* fix(Data): tsan warnings fixes

* feat(ci): add tsan job

* feat(ci): add tsan job, another attempt

* feat(ci): add tsan job, 3rd attempt

* fix(Foundation): tsan warnings fixes

* fix(Thread_POSIX): tsan warnings fixes; add tsan.suppress

* fix(Util): tsan fixes

* fix(netSSL_OpenSSL): tsan fixes

* fix(Data): tsan warnings fixes

* feat(ci): add tsan job

* feat(ci): add tsan job, another attempt

* feat(ci): add tsan job, 3rd attempt

* fix(ResultMetadata): memory leak #3474

* feat(ci): disable ActiveDispatcher tests for tsan runs

* feat(ci): try to fix tsan options file detection (again)

* chore(TestLibrary: correct spelling

* fix(ci): fix tsan run; add -y to apt; disable samples build for some jobs

* fix(ci): add mysql ports

* feat(ci): add VS asan

* feat(double-conversion): Upgrade double-conversion to v3.2.0 #3624

* chore(asan): disable msvc asan build (dll not found)

* chore(double-conversion): move NumericString.h before double-conversion includes to prevent min/max collision; reinstate lost loongarch64

* chore(JSON): sync pdjson with upstream

* fix(Statement): Poco::Data::Statement becomes unusable after exception #2287
2022-06-01 23:47:26 -05:00
Kevin Dick
9a4853582f
Added LocalConfigurationView to only search inside the viewed scope (#3529) 2022-05-26 09:40:13 -05:00
Günter Obiltschnig
010cf8b7d0 #3507: Reference counting for bound configuration in Util::Option is broken 2022-02-19 10:35:30 +01:00
Günter Obiltschnig
d28d2b7a80 remove blank line 2021-06-23 08:35:01 +02:00
Günter Obiltschnig
22eb76d3ae #3302: MSVC: Poco hides warnings (C4996) for the C++14 attribute [[deprecated]] 2021-06-17 18:20:29 +02:00
Günter Obiltschnig
ea455ad891 fix warnings 2021-06-15 10:36:53 +02:00
Günter Obiltschnig
6fda5b590b #3266: Order of Util::Application::uninitialize() is not in reverse as documented 2021-06-15 07:45:47 +02:00
Günter Obiltschnig
43aa85df70 #3193: ServerApplication::registerService() unquoted path security vulnerability 2021-06-15 07:32:47 +02:00
Günter Obiltschnig
4066c4d794 add Application::windowSize() 2021-04-11 16:00:53 +02:00
Günter Obiltschnig
e3a05a4c58 fixed a warning 2020-02-14 11:22:18 +01:00
Günter Obiltschnig
bb63b28121
Merge pull request #2920 from KevDi/closeServiceHandleAfterUnregister
Close Service Handle after DeleteService Function call
2020-02-12 20:36:23 +01:00
Jan Kevin Dick
753cfcecd7 Close Service Handle after DeleteService Function call 2020-02-12 13:10:09 +01:00
Jan Kevin Dick
e51adf72cf Fixed setFailureActions. Function could crash if the given Vector has
less then 3 Elements. Also the Function crashes if no SVC_REBOOT or
SVC_RUN_COMMAND are specified. If this is the case ac.lpCommand and
ac.lpRebootMessage are not set.
2020-02-12 13:01:45 +01:00
Günter Obiltschnig
71585b7daa #2152: XDG support 2020-01-21 21:20:35 +01:00
Günter Obiltschnig
03d1dd9822 fixes for macos/clang 2020-01-09 11:53:03 +01:00
Günter Obiltschnig
1bf40a0cd2 merge some changes from develop branch; modernize and clean-up code; remove support for compiling without POCO_WIN32_UTF8 2020-01-09 10:08:09 +01:00
Günter Obiltschnig
3fdf8624a9
Merge pull request #2840 from KevDi/bugfix/deleteRegKeyOnWOW6432Node
Deleting Registry Keys on the WOW6432Node is not possible on 64Bit Applications
2019-11-25 11:58:32 +01:00
Jan Kevin Dick
51fe7836ca Rename Method and fix error in vcxproj File 2019-11-18 11:57:58 +01:00
Jan Kevin Dick
991387a113 Passing _readOnly and _extraSam inside delete Key to the RegistryKey Constructor 2019-11-18 11:48:45 +01:00
Jan Kevin Dick
5be6be5228 Added to the x64 Project 2019-11-18 11:32:57 +01:00
Jan Kevin Dick
3917135a7f Added Method to configure the Failure Actions 2019-11-18 11:24:04 +01:00
Jan Kevin Dick
9762ed37e9 Added Method to Query the Failure Actions for the Service 2019-11-18 10:29:17 +01:00
Jan Kevin Dick
34ad48d16c Added Method to check if a service is stopped 2019-11-18 10:14:39 +01:00
Jan Kevin Dick
5a484c1896 Added Constructor to create WinService with an existing Connection to a Service Manager 2019-11-18 10:08:11 +01:00
Günter Obiltschnig
d73bb2ea86 fixed GH #2058: Synchronization issue in Poco::Util::Timer at destruction 2018-03-06 17:33:02 +01:00
Joerg-Christian Boehme
73897b4357 Add POCO_OS_ANDROID as platfrom definitons (#2186)
* Add POCO_OS_ANDROID as platform definition

* Ignore test big ping when its failing
2018-02-26 19:18:45 -06:00
Björn Schramke
b9259452a9 add new path values (configHome,cacheHome, etc) application config 2018-02-13 08:09:48 -06:00