Commit Graph

5617 Commits

Author SHA1 Message Date
Stefan Csomor
b391d86502
switching to 64 bit arch for simulator as well (#3009) 2023-06-10 18:13:01 -05:00
Alexander Kernozhitsky
c6fd0db4b6
Fix thread counter leak (#3992)
Cherry-picked from https://github.com/ClickHouse/poco/pull/28, see the
mentioned PR for more details.

Co-authored-by: alexey-milovidov <milovidov@yandex-team.ru>
2023-06-09 22:05:19 -05:00
Günter Obiltschnig
2a6434a86d Merge branch 'devel' of github.com:pocoproject/poco into devel 2023-06-06 13:13:11 +02:00
Günter Obiltschnig
0a4f64c8d2 #3876, also for SystemConfiguration 2023-06-06 13:12:35 +02:00
Günter Obiltschnig
525e91cb90
Merge pull request #4030 from bas524/socketaddress-by-const
fix #3968
2023-06-06 13:08:15 +02:00
Günter Obiltschnig
8f764e3505 #3880: NetSSL_OpenSSL: Support session resumption with TLSv1.3 2023-06-06 13:06:02 +02:00
Günter Obiltschnig
a9ad113742
Merge pull request #4038 from sersoftin/fix/win-shared-library-error-text
Fixed Poco::format specifier for error code
2023-05-21 09:43:52 +02:00
Sergey Detsina
ed2613dfc5 Fixed Poco::format specifier for error code 2023-05-21 10:40:20 +03:00
Alexander B
69a6ddbd90 fix #3968 Poco::Net::SocketConnector constructor should take SocketAddress by const reference 2023-05-11 14:39:32 +03:00
Alexander B
75b378e540
fix #4005 Poco::Path::getExtension() returns name of the hidden file if no extension is present (#4011) 2023-05-05 11:49:56 -05:00
Alexander B
c7ac8574f8
Complimentary to #3918 (std::*mutex wrapper) (#3954)
* Complimentary to #3918
I think that we can use Poco::Mutex and Poco::FastMutex as wrappers for std::recursive_mutex and std::mutex instead of replacing

For using std::*mutexes switch on cmake-option POCO_ENABLE_STD_MUTEX

* add define POCO_ENABLE_STD_MUTEX to the Config.h
remove empty if-else from CMakeLists.txt
2023-05-05 09:49:06 -05:00
Matej Kenda
971a7cc670
Mongodb op msg database commands fix (#4004)
* * Fix: MongoDB::OpMsgCursor did not handle zero batch size properly: cursor requests failed.
* Improvement: Add emptyFirstBatch to indicate that the size of the first batch shall be zero for performance to get potential error ASAP from the server.

* Poco::MongoDB: Some database commands do not need collection as an argument. An integer "1" is passed instead.
2023-05-05 09:27:42 -05:00
Matej Kenda
9a2c16f55a
MongoDB: add missing name accessor to get database name. (#4020) 2023-05-05 08:33:21 -05:00
Günter Obiltschnig
dd21b48d05
Merge pull request #3999 from vojinilic/fixDeadLockDestructor
Fix hang in destructor
2023-04-20 10:19:26 +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
David Hedbor
4cc956483d
Fix thread compilation issues on FreeBSD (#3989)
- Use pthread_set_name_np on FreeBSD 12.
- Implement currentOsTidImpl() using thr_self() on FreeBSD.
2023-03-30 04:49:04 -05:00
xiao
39a207ce62
Avoid epoll_wait causing the lock to not be released (#3983)
* Avoid epoll_wait causing the lock to not be released.

* code style
2023-03-27 15:48:54 -05:00
Aleksandar Fabijanic
bcae06f423
3808 icmp statistics (#3982)
* fix(ICMPClinet): ICMPEventArgs Statistics bugs #3808

* fix(SpinlockMutex): 100 % CPU usage on single-core system #3852
2023-03-22 09:11:13 -05:00
Anton
93d18162f3
Add ODBC DirectExec public API (#3502)
* ODBC sqlDirectExec

* doc

* Small fix

* Fix tabs, add missing const, fix style

* Add test case

* Small fixes

* suggested fix for async

* test for returned values
2023-03-22 00:51:57 -05:00
Matej Kenda
3838070146
Resolves #3484: support for OP_MSG in Poco::MongoDB (#3902)
* Binary writer/reader: add writeCString and readCString.

* MongoDB::Database: add queryBuildInfo and queryServerHello; add WireVersion enum.

* MongoDB: Introduce OpMsgMessage (request and reply) and related changes in Connection, Database, MessageHeader.

* MongoDB: First unit test changes for OpMsgMessage.

* MongoDB::Document: new functions addNewArray and remove.

* MongoDB: OP_MSG unacknowledged write and many improvements

* MongoDB: new cursor using OP_MSG

* MongoDB: bunch of new tests for OP_MSG wire protocol.

* BinaryWriter::WriteCString: use write instead of operator <<.

* MongoDB::OpMsgCursor: Slightly modified prototype code for using moreToCome flag.

* MongoDB: Add OpMsg* files to Makefiles.

* MongoDB: Add OpMsg* files to VS project files.

* Compile fixes.

* MongoDB::Database: Add factory function for database commands createOpMsgMessage() and cursors createOpMsgCursor()
2023-03-20 01:50:15 -05:00
Alex Fabijanic
57a531573f Merge branch 'devel' of https://github.com/pocoproject/poco into devel 2023-03-18 11:25:33 +01:00
cesar
cee8c96146 Added system_error header to SockerProactor for std::error_code references (#3883) 2023-03-18 11:25:07 +01:00
Alexander B
7ab7a5291d
Improve implementation of logging macros. #2331 (#3862)
* Improve implementation of logging macros. #2331

The GNU compiler emits a warning if nested "if" statements are followed by
an "else" statement and braces are not used to explicitly disambiguate the
"else" binding.  This leads to problems with code like:

   if (gate)
     ASSERT_*(condition) << "Some message";

The "switch (0) case 0:" idiom is used to suppress this.

* I was wrong.
do-while better then switch-case approach for "ambiguous else blocker"
https://godbolt.org/z/W5nnYrzx6

* try to fix tabs

* again fix tabs

* again fix tabs

* again fix tabs
2023-03-18 05:21:32 -05:00
Aleksandar Fabijanic
6207b8fb56
fix(devel): add missing 1.11 releases commits (#3976) 2023-03-18 01:29:14 -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
Andrew Auclair
66e93f98cc
Custom rotate, archive and purge strategies for FileChannel (#3810)
* Adding the ability to set custom rotate, archive and purge strategies.

* Force CI
2023-03-18 01:28:25 -05:00
chrisbednarski
e0e628ac7e
fix(build): fix build with openssl 3.1.0 on vs2022 (#3969)
* fix log verbosity in windows powershell build script

* stop paths being added multiple times to environment variables

* pass useenv property to msbuild

* linking issue: include crypto.h prior to config.h so POCO_EXTERNAL_OPENSSL is initialised

* resolve poco_base path in powershell script

* build against any available windows sdk
2023-03-17 17:45:56 -05:00
Gleb Popov
f6c3017b3e
Do not incur insane stack limit in Foundation-ThreadPool test. (#3861)
This fixes the test on FreeBSD.
2023-03-17 16:09:38 -05:00
MailShop
abd06ab4d9
ODBC: Fix DataFormatException getting Time value from SQL Server (#3802) 2023-03-17 15:51:57 -05:00
gyee-penguin
85f74867ef
Fixed compile error with OpenSSL 1.0 systems (#3739) (#3912) 2023-03-17 15:45:30 -05:00
micheleselea
60faa4fb58
hasMicrosecond is undefined (#3842) 2023-03-17 15:42:41 -05:00
Samuel Thibault
d05d689622
Add GNU Hurd support (#3946)
Co-authored-by: Jochen Sprickerhof <git@jochen.sprickerhof.de>
2023-03-17 15:24:57 -05:00
Conor Burgess
9a374ca2de
Fix error handling with OpenSSL 3.0 in SecureSocketImpl.cpp (#3971) 2023-03-17 10:07:37 -05:00
Günter Obiltschnig
feb1e24cfd
Merge pull request #3943 from jayoh-dev/feature/fix-qnx-build
Fix build for QNX
2023-02-14 07:03:12 +01:00
Jay
c79ae36c2a Fix build for QNX 2023-02-14 14:27:31 +09:00
Gleb Popov
b668742447
Fix typo in the exception message (#3858) 2023-01-27 05:26:33 -06:00
Alexander B
6c9078d673
fix issue #3815 (#3932)
Poco can be built with ENABLE_UTIL=ON and ENABLE_XML=OFF, but use of Poco::Util requires Poco::XML
2023-01-27 05:25:31 -06:00
Denis CLAVIER
d4e2e00482
Fix multicast leave group (#3929)
* Fix multicast leave group

* Add test to join and leave a multicast group

Co-authored-by: Denis CLAVIER <denis.clavier@c-s.fr>
2023-01-24 05:46:10 -06:00
Aleksandar Fabijanic
ac0c62ebf4
3925 c mysql compile fail (#3928)
* fix(CI): CI MySQL compile fail #3925 (Linux)

* fix(CI): CI MySQL compile fail #3925 (Linux, 2nd attempt)

* fix(CI): CI MySQL compile fail #3925 (OSX)
2023-01-24 02:35:10 -06:00
Yevgen Pogribnyi
85c68e7a81
Fix epollfd validity checks when compiling with wepoll (#3855) 2023-01-24 01:02:47 -06:00
Fabio R. Sluzala
c693b0b1b2
Remove unnecessary duplication of std::string in NumberParser::tryParseFloat (#3864) 2023-01-24 01:00:15 -06:00
Byungjun Lee
5430b4c5b6
Fix Aix Build (#3860)
* Fix : Aix System NumberFormatter Build Error

* Fix : Aix System OpenSSL 3.0 Build Support

 - https://github.com/openssl/openssl/blob/openssl-3.0.0/NOTES-UNIX.md?plain=1#L110

* Add : Aix System Gcc Build Support

* Revert "Add : Aix System Gcc Build Support"

This reverts commit b9a4b90e39.

* Add : Aix System Gcc Build Support
2023-01-24 00:55:17 -06: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
R. Savchenko
079b50e0c1
Guard NOMINMAX ifdef (#3906) 2023-01-24 00:42:43 -06:00
Niketin
b941a20b8c
Fix typo in example (#3894)
using a dereference operator does not work here
2023-01-24 00:41:40 -06:00
Günter Obiltschnig
ed7aface46
Merge pull request #3927 from thomkopp/feat/cppparser-global-ns-support
CppParser: Support return values which are specified to be in the global namespace
2023-01-23 22:18:14 +01:00
Alex Fabijanic
4ceb731bba feat(Process): Add options to disable STDIO in child process #3867 2023-01-23 12:23:03 +01:00
Alex Fabijanic
feee864950 fix(TZInfo): Static FastMutex fails to lock when issued from another thread on linux #3918 2023-01-23 08:06:55 +01:00