Commit Graph

5932 Commits

Author SHA1 Message Date
Kari Argillander
bf3c519183
Fix some issues found with clang-tidy (#4353)
* directoryiterator: Fix missing inline

Add missing inline to inline function.

This was found with clang-tidy check:  misc-definitions-in-headers

* Convert deprecated throw() to noexcept

throw() has been deprecated in standar in C++17. It has been removed in
C++20. Code still compiles but let's just define these at those should
be.

These where found with clang-tidy check: modernize-use-noexcept

* Fix unnecessary copy initializations

Clang-tidy did find these with check:

  performance-unnecessary-copy-initialization

* Fix some strings not references

Looks like these are just missing reference marks.

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2023-12-17 16:55:30 +01:00
Matej Kenda
111fe90dd9
enh(NumberFormatter): Introduce backward compatible options for formatHex functions (#4333)
* enh(NumberFormatter): Introduce backward compatible options for formatHex functions.

* enh(NumberFormatter): Corrections and improvements suggested in code review.

* fix(ci): disable testEncryptDecryptGCM on macOS which often fails.

* enh(NumberFormatter): Improved naming.
2023-12-15 18:30:55 +01:00
Alexander B
a464a4eabf
fic(ci): Properly include openssl 1.1 on macOS (#4345)
* set opessl@1.1 path for macos build

* fix command-line problem
2023-12-15 16:00:26 +01:00
Matej Kenda
214b54460e mingw 11: fixes to compile common libraries 2023-12-14 19:02:11 +01:00
Andrew Auclair
cfc9ce380e
Throw exceptions when node ID retrieval is unsuccessful and support Wireless Adapters on Windows (#4336) 2023-12-14 16:41:28 +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
Kari Argillander
46759cab03
Fix RemoteSyslogChannel setProperty value check (#4339)
We compare just 4 first letters. So if value would have example be
syslevel then this function would work wrong. Nothing major but nice to
fix.

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2023-12-13 03:36:37 +01:00
Kari Argillander
10f41c06d9
Improve project C++17 support (#4334)
Poco now use C++17. We can take some old code away because of that. We
also raise requiments for C++17 so everything works as excpected with
it.

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2023-12-13 02:16:35 +01:00
Matej Kenda
12a99dcd18 fix(SocketImpl): Windows: use pragma to link mswsock.lib 2023-12-12 22:13:00 +01:00
Matej Kenda
54f0feb282 fix(ci): Partially revert "add sendfile method for streamsocket (#4007)"
This reverts commit 24b7122f43.
2023-12-12 22:13:00 +01:00
Joerg-Christian Boehme
ec3c0f4f98
Github Action for Android NDK (#4321)
* Add first android git hub action to try

* Set up android toolchain

* Add second android ndk build

* add some default settings for android

* Add a third android build for armv7

* fix(OpMsgMessage): android v7a compile

---------

Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
2023-12-11 20:34:03 +01:00
Matej Kenda
4f1cf68307
Stricter DateTimeParser for known formats (fixes #569) (#4330)
* GH #569: Cherry pick and correct code from devel-experimental.

* GH #569: Add missing timezone codes.

* enh(Foundation): DateTimeParser: stricter checks of timezones, more tests for invalid inputs. (#569)

* enh(Foundation): Small fixes of issues detected by CodeQL

---------

Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
2023-12-11 14:48:33 +01:00
Alexander B
24b7122f43
add sendfile method for streamsocket (#4007)
* add sendfile method for streamsocket

* add mswsock.lib to the project files and templates

* remove /DPOCO_NO_AUTOMATIC_LIBS for cmake windows build

* merge from upstream

* merge from upstream

* fix code stile
add NotImplemented exception for unsupported platforms
exculude <sys/sendfile.h> for POCO_EMSCRIPTEN, because https://
github.com/emscripten-core/emscripten/pull/16234

* add iostream include for std::cout

* fix compilation for emscripten (wrap sendfile)
2023-12-11 10:47:03 +01:00
Matej Kenda
689a81c4c4 enh(File): Throw FileNotReadyException in File::exists() (Win32) (#2403) 2023-12-11 09:07:45 +01:00
Aleksandar Fabijanic
1e90f64bbf
4307/8/9/10 data races (#4312)
* fix(NumericString): properly mark uIntToString deprecated #4304

* dev(runLibtests): allow to specify test to run

* fix(NotificationCenter): data race #4307

* fix(DirectoryWatcher): data race #4308

* fix(ArchiveStrategy): data race #4309

* fix(ActiveThread): data race #4310

* fix(Task): Cancelled Task shouldn't start running #4311 (WIP)

* fix(String): ignore clang loop unrolling warnings

* fix(TaskManager): task ownership #4311

* chore(FIFOEventTest): fix unused var warning; disable benchmark in test

* fix(Task): remove unnecessary mutex (and prevent cyclic locking reported by TSAN)

* fix(CryptoTest): disable testEncryptDecryptGCM

* fix(ci): typo

* fix(NotificationCenter): disable and clear observers in dtor (#4307)

---------

Co-authored-by: Matej Kenda <matejken@gmail.com>
2023-12-09 21:16:24 +01:00
Matej Kenda
35e1490b26
fix(platform): Fixes to compile with emscripten 3.1.5 (fixes #2707) (#4318)
* fix(platform): Fixes to compile with emscripten 3.1.5 on Ubuntu 22.04 #2707

* enh(Platform): add test check with emscripten on Linux
2023-12-07 01:48:14 +01:00
Alessandro Zini
e868ecb247
cppignore: add testEchoIPv4Move (#4322) 2023-12-05 19:23:03 +01:00
Matej Kenda
607b0863ce
enh(Foundation): Path of the current process Path::self() (#2282)
* Merge remote-tracking branch 'jackywoo/add_self_to_path' into 2282-path-self
* fix(Foundation): minor code cleanup. #2282
* enh(Foundation): Windows unit test for Path::self and exception for non-implemented platform.
* fix(Foundation): Path::self() throws SystemException when the path can't be acquired. #2282

Co-developed-by: Jackie Woo <wuchienchao@qq.com>
Co-developed-by: Matej Kenda <matejken@gmail.com>
2023-12-05 07:55:07 +01:00
Matej Kenda
0e4eb00ea5 enh(Net): fix a typo 2023-12-04 16:56:12 +01:00
Russell Greene
3ae282db2e
enh(Net): Allow passing raw fd's into ServerSocket (#4156)
* Allow creating ServerSocket's from fd's
* more sensible approach
* fix whitespace issue
* add test
* build fixes for windows
2023-12-04 16:53:40 +01:00
Günter Obiltschnig
94418e5bc8 #4320: Integer overflow in Poco::UTF32Encoding 2023-12-04 15:27:06 +01:00
Matej Kenda
5c9217663e fix(Foundation): Format.h uses Poco::format explicitly to avoid ambiguity with std::format (C++-20). #4028 2023-12-01 09:51:23 +01:00
Matej Kenda
381467d8f5 enh(ci): Add ENABLE_COMPILER_WARNINGS to cmake to enable additional compiler warnings 2023-12-01 08:07:12 +01:00
Matej Kenda
1e4c08b4eb fix(MongoDB): PooledConnection shall have a pointer to a ConnectionPool instead of a reference (fixes clang warning) #4276 2023-11-30 16:40:14 +01:00
Matej Kenda
4cfa96c94e
enh(JSON): Add unit test testBasicJson to test basic functionality of the JSON parser. #3331 (#4315) 2023-11-30 14:53:55 +01:00
Aleksandar Fabijanic
57bc0bbbb5
3102 json lowercase hex (#4306)
* Made it possible to use lowercase hex numbers, also when encoding JSON (#3102)

Co-authored-by: Thomas Weyn <Thomas.Weyn@cebir.be>

* fix(JSONString): Remove deprecated toJSON functions #4305

* fix(NumericString): conversions inconsistencies #4304

---------

Co-authored-by: Archipel <thomas@weynwebworks.com>
Co-authored-by: Thomas Weyn <Thomas.Weyn@cebir.be>
2023-11-27 22:43:20 +01:00
Owen Knight
9141368eca
Make Binding and CopyBinding specializations final (#4022)
The Binding specializations call it virtual functions numOfRowsHandled()
and reset() from their constructors. This is fine assuming virtual
function dispatch to a further derived class was not intended. In this
case the assumption is solid, however this triggers the Clang diagnostic
clang-analyzer-optin.cplusplus.VirtualCall

Adding the final specifyer to these specializations gives Clang enough
of a hint to silence
2023-11-27 03:52:37 +01:00
Aleksandar Fabijanic
862b1ad369
enh(ci): add CIFuzz GitHub action #3882 (#4302) 2023-11-27 03:42:25 +01:00
Aleksandar Fabijanic
cc67fb36ea enh(Ascii): improve performance for toLower/toUpper #3462 2023-11-26 18:56:54 -06:00
Aleksandar Fabijanic
1f4d575465 dev(vscode): add CodeLLDB launchers 2023-11-26 18:55:16 -06:00
tuduongquyet
af69d61ff5
Adding API Poco::XML insertAfterNP() (#4061) 2023-11-26 19:49:50 +01:00
chrisbednarski
388a3b4010
fix openssl session resumption, add quiet shutdown option, support FTPS with hostname (#4103) 2023-11-26 18:12:11 +01:00
Aleksandar Fabijanic
11de40399c
fix(sharedMemory): x64 size error #2976 (#4295)
* fix(sharedMemory): x64 size error #2976

* chore: add Util dependency to Prometheus samples

* fix(HTTPClientSession): not working with UNIX_LOCAL SocketAddress #2578

* fix(WebSocketTest): supress connection reset exception assertion

* fix(PollSet): wait on premature epoll_wait return; reinforce tests for windows

* fix(build): add DataTest dependency to Makefile

* fix(Task): intermittently hanging test and some other improvements

* fix(Net): PollSet loop; suppress test WebSocket handler shutdown IOExeption
2023-11-26 04:57:39 +01:00
Pavle Dragisic
70bb3a40de
Add ProcessRunner and PIDFile (#4225)
* feat(Foundation): PIDFile and ProcessRunner #4064
* feat(Thread): optional signal blocking on POSIX #2978
* fix(ProcessRunner):remove logger, code enhancement #4225
* feat(Foundation): add PIDFile and ProcessRunner Tests #4064
* fix(Foundation): failing ProcessRunner Test #4064
* fix(PIDFile): remove append argument #4064
* remove Windows TODO from ProcessRunner #4064
* feat(ProcessRunnerTest): add line to checkTimeout #4064
* fix(ProcessRunner): add done flag to run() #4064
* fix(ProcessRunnerTest): add missing pidFile argument #4064
* chore(ProcessRunner): remove comments #4064
* fix(ProcessRunner): add runCount flag #4064
* fix(test): SharedLibrary and Class tests paths
* fix(ProcessRunner): thread sanitizer reported data races #4064
* fix(build): pass env var to testrunner #4064
* chore(PIDFile): remove ; in comments #4064
* feat(ProcessRunner): add Win argument format #4064
* fix(Tests): add ProcessRunnerTest to vcxproj #4064
* fix(Tests): change path to TestApp #4064
* feat(Tests): windows processrunner tests #4064
* fix(Tests): duplicate  ProcessRunnerTest in TestSuite vcxproj  #4064
* fix(CodeQL): sw declaration hides variable  #4064
* fix test binaries path for cmake
* fix(Build): missing include/PIDFile.h buildWin #4064
* fix(Build): add PocoFoundation depend in buildWin #4064
* feat(ProcessRunner): test process launching multiple threads #2976

---------

Co-authored-by: Pavle <pavle@debian-gnu-linux-11.localdomain>
Co-authored-by: Alex Fabijanic <alex@pocoproject.org>
2023-11-24 20:22:01 +01:00
Sokolov Yura
904075e1f1
AutoPtr: do 'duplicate' before 'release' (#4068)
Common knowledge in reference counting is "on assignment increment first
then decrement", because "just to be deleted" object could hold last
reference to "just to be assigned" one.

Fixes #3979
2023-11-23 04:49:10 +01:00
Tavi Cacina
b34801f4ba
fix(NetSSL_Win): Error during handshake: failed to read data (#4275)
Closes #3944
2023-11-23 02:57:01 +01:00
Alexander B
4a9285c997
Improve FifoEvent, ActiveMethod, ActiveResult (#4211)
Co-authored-by: Alexander B <bas524@ya.ru>
2023-11-22 00:59:24 +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
Andrew Auclair
39e35c316d
SplitterChannel::addChannel() should only add a channel once
SplitterChannel::addChannel() should only add a channel once to the internal vector. This prevents issues where the channel is accidentally added twice but only removed once because removeChannel stops at the first result. (#4270)
2023-11-21 04:17:19 +01:00
tyler92
2e608624c8
fix(build): Install cmake files with resolved ENABLE_JSON and ENABLE_XML (#4227) 2023-11-21 03:07:24 +01:00
Pavle Dragisic
5e88502b7f
Fix Poco::Process::launch (UNIX) - memory leak when launching invalid command (#4267)
* fix: memory leak in ProcessImpl  #2366

* fix(Process): variable masking and spelling #2366

* feat(ProcessTest): invalid command launch test #2366

* fix(ProcessTest): handle failed launch on win #2366

* fix(ProcessTest): undefined exception #2366

---------

Co-authored-by: Pavle <pavle@debian-gnu-linux-11.localdomain>
2023-11-21 03:04:02 +01:00
Nino Belušić
b8d9eab0b8
4248 additional progen script feature (#4265)
* feat: add components argument to progen.ps1 #4248

* feat: add components argument to buildwin.ps1 #4248

* fix: fix buildwin output #4248

* fix: fix buildwin components argument check #4248

* feat: add calling buildwin to progen.ps1 #4248

* fix: fix progen build output #4248

* fix: call buildwin with static_mt linkmode #4248

* feat: run progen for Data/testsuite/DataTest #4248

* fix(progen.ps1): default poco_base; fix buildwin path; use Start-Process (to get exit code); rename non-name-compliant cmdlets

* fix(PS scripts): rename functions to comply with cmdlets names; add platform to progen

---------

Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
2023-11-13 22:34:45 +01:00
Matej Kenda
daeb9d7301
4254 net message header optional decoding (#4263)
* GH #4254: Net::MessageHeader: automatic decoding of header values is made optional (enabled by default).

* GH #4254: Net::MessageHeader: test for optional automatic decoding of header values
2023-11-13 10:32:12 +01:00
Aleksandar Fabijanic
54d3c7b351
SessionPool idle connections should behave as a FIFO queue (#3951) (#4264)
Co-authored-by: Friedrich Wilckens <friedrich.wilckens@ingramcontent.com>
2023-11-13 10:28:08 +01:00
Alex Fabijanic
23463b2e55 chore: add issue template 2023-11-11 23:20:27 +01:00
Aleksandar Fabijanic
18eea1bb70 temporarily comment failing mysql ci until fixed 2023-11-11 19:42:52 +01:00
Alexander B
6a5387ec21
add visitor pattern implementation for Poco::Dynamic::Var (#4144)
* add visitor pattern implementation for Poco::Dynamic::Var

* add changes to Makefile and vcxproj for VarVisitor

* resolve review comments Poco::Dynamic::Var

---------

Co-authored-by: Alexander B <bas524@ya.ru>
2023-11-11 19:18:12 +01:00
Aleksandar Fabijanic
a9f889f5cf fix: misspelled define 2023-11-11 19:12:48 +01:00
Aleksandar Fabijanic
10ad89594a
Win build fix (#4260)
* fix(SQLParser): use Data_API if available

* fix(ProGen): wrong AdditionalOptions separator #4259

* fix(SQLParser): add default export define when embedded
2023-11-11 11:08:18 +01:00
Aleksandar Fabijanic
5fa1779f22
Merge pull request #4257 from pocoproject/4244-postgres-setAutoCommit-should-not-call-startTransaction
4244 postgres set auto commit should not call start transaction
2023-11-10 12:52:32 +01:00