Commit Graph

277 Commits

Author SHA1 Message Date
Armin Novak 970f0c54e8 [stream] use const correct Stream_Pointer access 2023-06-08 08:09:33 +02:00
Armin Novak a4c6b36a19 [build] fix memory sanitizer stack frame warnings 2023-06-07 09:14:45 +02:00
akallabeth a5b42f0f84 [includes] untangled circular includes 2023-03-15 08:22:23 +01:00
akallabeth cf9777cd92 [channels] simplified server linking 2023-03-01 08:18:34 +01:00
akallabeth c3a82daad6 [channels] simplified client linking 2023-03-01 08:18:34 +01:00
Armin Novak 641022b795 [logging] remove __FUNCTION__ from actual message
prefer the log formatter to provide that information.
2023-01-25 16:26:39 +01:00
akallabeth 275741cc75 [core,utils] add drdynvc stringification functions 2023-01-12 22:54:25 +01:00
akallabeth 6d7c07076d [chanenls,drdynvc] use proper types instead of int 2023-01-12 22:54:25 +01:00
akallabeth 3b5347e229 [channel,dvc] unify and log DVC callbacks
* Added a check function that logs errors if the required callbacks are
  not set.
* Encapsulate calling in (static) helper functions
2022-12-15 14:57:29 +01:00
akallabeth babc47e19c [channels,rdpsnd] fix rdpsnd channel cleanup
The rdpsnd channel needs to keep the resources allocated until the last
user (static, dynamic channel) is terminated.
2022-12-13 10:57:34 +01:00
akallabeth aaae70ff05 Fixed missing const casts 2022-12-09 15:58:26 +01:00
Armin Novak c3e42de5b5 [drdynvc] assert and proper cleanup 2022-12-09 13:23:00 +01:00
akallabeth 7c224c2427 [drdynvc] fix cleanup in case of no thread
If drdynvc is used without an own thread the dynamic channels were not
properly cleaned up on disconnect.
2022-11-22 15:30:31 +01:00
akallabeth 1849632c43
Fixed format strings to match arguments (#8254)
* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
2022-09-29 14:55:27 +02:00
Armin Novak eaaeb62f05 Fixed -Wcomma warning 2022-09-20 15:52:14 +02:00
David Fort 103f13575c
drdynvc: code cleanup of the client dynamic channel (#8148)
This patch does various cleanups in the client dynamic channel. The main
goal of the cleanup was to add the sending of Close messages to the server
when a channel is locally closed. The refcounter is there to ensures that
the DVC_CHANNEL is not freed while some pieces of code are still holding a
reference on it.

I did some tests by using a custom server-side echo channel at
https://github.com/hardening/echoChannel, it allows to send a given amount of
packets and then close (to test server-side initiated closes). It compiles
with mingw (so under linux) and so it can be easily deployed (no deps).
2022-08-25 08:47:00 +02:00
David Fort 1f08cb9a7d
Drdynvc needs love (#8059)
* winpr: add lock operation on HashTables

* drdynvc: change the listeners array for a hashtable and other micro cleanups

* logonInfo: drop warning that is shown at every connection

Let's avoid this log, we can't do anything if at Microsoft they don't respect
their own specs.

* rdpei: fix terminate of rdpei

* drdynvc: implement the channel list with a hashtable by channelId
2022-07-26 12:53:41 +02:00
Armin Novak a3ac4e9b01 Add option to run drdynvc [client] without extra thread 2022-06-27 11:06:27 +02:00
akallabeth 5b163b7918 Add GetRdpContext function pointer for dynamic channels 2022-06-23 07:45:55 +02:00
akallabeth 73cdcdfe09
Logging and parser fixes (#7796)
* Fixed remdesk settings pointer

* Fixed sign warnings in display_write_monitor_layout_pdu

* Use freerdp_abort_connect_context and freerdp_shall_disconnect_context

* Added and updates settings

* info assert/dynamic timezone

* mcs assert/log/flags

* Fixed and added assertions for wStream

* Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function

* Cleaned up PER, added parser logging

* Cleaned up BER, added parser logging

* log messages

* Modified Stream_CheckAndLogRequiredLengthEx

* Allow custom format and options
* Add Stream_CheckAndLogRequiredLengthExVa for prepared va_list

* Improved Stream_CheckAndLogRequiredLength

* Now have log level adjustable
* Added function equivalents for existing logger
* Added a backtrace in case of a failure is detected

* Fixed public API input checks
2022-04-19 14:29:17 +02:00
akallabeth 610f4b6bac Fixed WINPR_UNUSED/WINPR_ASSERT mixup 2022-03-28 15:52:32 +02:00
akallabeth 1319c08bba Cleaned up use of rdpSettings in channels 2022-03-28 15:52:32 +02:00
Armin Novak ce63397323 Move drdynvc main path messages to trace level
They are noisy and hide more important information from debug log
2022-03-08 16:15:18 +01:00
Armin Novak 4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
Martin Fleisz 8d49175a94 Revert "drdynvc: Prevent opening an already opened dynamic channel"
This reverts commit feda57a739.
2022-02-23 17:18:50 +01:00
akallabeth 8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
Martin Fleisz 7adf2f0bbd drdynvc: Prevent opening an already opened dynamic channel 2021-12-03 09:57:09 +01:00
Armin Novak 95ecc6929a Refactored channel error handling
* Fix WINPR_ASSERT if a client can not allocate new resources,
  terminated cleanly instead.
* Add WINPR_ASSERT for lots of channel arguments
2021-09-09 08:53:20 +02:00
Armin Novak 4e44003832 Expose dynamic channel PDU types 2021-09-09 08:53:20 +02:00
Armin Novak 054f0ea260 Use defines instad of channel names 2021-08-25 10:54:24 +02:00
Armin Novak ccfe0c129e Removed checks already done by WINPR_ASSERT 2021-06-16 11:46:42 +02:00
Armin Novak d6c84c28fb Renamed ArrayList_Add to ArrayList_Append
* Do not break API silently
2021-06-16 11:46:42 +02:00
Armin Novak a1c8e4cf85 Refactored ArrayList_Add to conform to other functions 2021-06-16 11:46:42 +02:00
sss 6b76ac9545 Revert "Revert "allow to use in single threaded mode" (#6864)"
This reverts commit f7465af44f.
2021-03-26 11:50:45 +01:00
akallabeth f7465af44f
Revert "allow to use in single threaded mode" (#6864)
This reverts commit bee2e1526d.
2021-03-05 13:02:38 +01:00
Gluzskiy Alexandr bee2e1526d allow to use in single threaded mode
(some client side channels and all server side channels still need to be
ported to new api)

server: build fix, do not disable threads for rfx encoder

cliprdr client channel: implemented support for DisableThreads option
looks like thread does not make sense at all for this channel

do not initialize disabled image codecs (respect settings)

channels: client: rail: added support for DisableThreads setting

changed "BOOL DisableThreads" to "UINT32 ThreadingFlags"
dropped unnecessary apu changes

draft implementation of threading settings aware message handling api
for addins/channels

rail: use new messaging api

fixed memory leak

msgs handlers external api changes (as requested)

msgs_handlers: init fix

fixed memory leak

logic fix

resolved problems appeared after rebase to master, dropped unnecessary
changes

git clang-format origin/master

fixed TestFreeRDPCodecRemoteFX.c

"formatting, run `clang-format` please"

properly use new "rfx_context_new(BOOL, UINT32)" everywhere

passed Threading Flags to "rfx_context_new" where available

in older C standarts veriables declaration must be done before any code

requested changes

clang-format as requested

use broken signatures of standert C functions for m$ s**tos

clang-format

requested changes

requested changes

moved ThreadingFlags to stable api zone

define type for channel msg handler

typo fix

clang-format

build fix

us ThreadingFlags from server settings

git clang-format origin/master

clang-format
2021-02-25 14:05:40 +01:00
akallabeth e2fd9db0b5 Added const to function arguments 2021-02-17 11:29:56 +01:00
akallabeth 66dc4cc9ee Fixed compilation warnings. 2020-11-10 08:53:43 +01:00
akallabeth 7f1cca78aa Clean up drdynvc channels porperly locked. 2020-11-06 13:38:47 +01:00
akallabeth 6e3c00725a Cleaned up collections:
ArrayList, MessageQueue, Queue, PubSub, BipBuffer
ObjectPool and BufferPool
2020-11-06 12:30:13 +01:00
Armin Novak 81d59b2d47 Fixed double free on channel close in channel write. 2020-08-12 10:10:18 +02:00
Armin Novak 57b405ca26 Fixed compilation warnings. 2020-08-10 12:14:11 +02:00
akallabeth 1a02af5a12 Fixed codition with side effects 2020-06-22 11:51:38 +02:00
Kubistika 6ed765c960 drdynvc: client: fix #6252 use-after-free 2020-06-03 19:47:40 +03:00
akallabeth cac8c365f2 Reset pointer to NULL after free. 2020-05-20 15:10:08 +02:00
akallabeth a1eb3e66b3 Clear dynamic channel lists on disconnect. 2020-05-20 15:10:08 +02:00
akallabeth abf7c29910 Extend lifetime of streampool in drdynvc
The stream pool can not be released until all streams have been
returned. This might happen as late as channel termination, so
change the lifetime scope accordingly.
2020-05-18 16:57:02 +02:00
akallabeth 6a811db69c Fixed drdynvc_send stream release 2020-05-13 17:11:17 +02:00
akallabeth 64ad42b95b Fixed DestroyListener arguments and call order 2020-05-13 17:11:17 +02:00