Commit Graph

163 Commits

Author SHA1 Message Date
Armin Novak
05c8a96fff [core,tcp] fix transport_bio_buffered_write
If the return value is <= 0 do not increment the buffer data.
2023-02-02 08:12:39 +01:00
akallabeth
82ba9ede9c [freerdp] use FREERDP_/UWAC_/RDTK_ prefix for conditional headers 2023-01-10 17:38:00 +01:00
fifthdegree
85f7cb8916 clear openssl error queue after nla_client_begin 2022-07-02 16:32:50 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
Marek Vasut
c5bca8bbbb transport: Set server socket as keepalive in transport_default_attach()
Set the same keepalive properties to accepted server socket as are set
to client sockets. This prevents the server from keeping sockets open
for tens of minutes in case the client disappears.

Signed-off-by: Marek Vasut <marex@denx.de>
2022-05-06 12:31:35 +02:00
Armin Novak
2ad18aa809 BIO ctrl cleanups 2022-04-25 16:08:48 +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
fa3cf9417f
Fixed #7696: Abort freerdp_connect if manually canceled (#7700)
If freerdp_abort_connect is called, set FREERDP_ERROR_CONNECT_CANCELLED
This way freerdp_reconnect can distinguish between network issues and
user interaction and abort a retry attempt.
2022-03-07 13:47:43 +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
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
Armin Novak
17f530a866 Transport opaque 2021-09-09 08:36:01 +02:00
Armin Novak
5afa592244 Fixed cast-qual warnings 2021-08-24 11:10:51 +02:00
Armin Novak
fd08c77f7f Fixed definition of config.h symbols 2021-06-28 15:06:30 +02:00
Armin Novak
2a91afb0cf Added adjustable tcp connect timeout 2021-06-08 08:21:47 +02:00
Alexandr
cf2daeb01d
cleanup of https://github.com/FreeRDP/FreeRDP/pull/6448 (#6455)
* Implemented switchable transport layer

Co-authored-by: akallabeth <akallabeth@posteo.net>
2020-09-02 13:37:04 +02:00
Armin Novak
ff79636d33 TSG improvements
* Respect connection timeout during connect
* Better debug output
* Cleaned up data types,
2020-06-19 11:31:13 +02:00
akallabeth
e6d10041c1 Fix #6033: freeaddrinfo must not be called with NULL arguments. 2020-04-09 14:26:46 +02:00
Armin Novak
895cb8f944 Added macro freerdp_set_last_error_if_not
This macro replaces the multiple instances where the current
error state is checked before setting an optional error state.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2020-01-09 10:34:27 +01:00
Armin Novak
7d252cdc8e Added freerdp_set_last_error_ex function
This new function allows better logging of call locations
for errors. Additionally added freerdp_set_error_log macro
to record function, file and line the error was set.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2020-01-08 17:39:25 +01:00
Armin Novak
639174e7d3 Added configurable TcpKeepAliveDelay setting. 2019-11-07 16:07:18 +01:00
Armin Novak
09dd01a78f Implemented configurable tcp keepalive and timeout detection 2019-11-07 13:03:33 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
f25488a7ab Reset last error state after a hostname was resolved successfully. 2019-09-11 10:43:17 +02:00
Armin Novak
f51a9bafcc Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
5623a4761f Fixed a possible NULL dereference. 2018-11-23 10:32:52 +01:00
akallabeth
d0d414dfa0 Fix #5059: Changed return type of peer_free to void. 2018-11-22 19:08:25 +01:00
Armin Novak
8df39fdad4 Use blocking sockets in freerdp_tcp_connect_multi
The non blocking connect in freerdp_tcp_connect_multi did not
work reliably.
Fall back to blocking connect (which might take longer until the connection
is established) instead of not being able to connect at all.
2018-11-22 11:11:31 +01:00
Armin Novak
1ed436c8fc Fixed socket cleanup in connect multi. 2018-11-22 11:11:31 +01:00
Armin Novak
4b3f4cc2fc Fixed event check in freerdp_tcp_connect_multi 2018-11-22 11:11:31 +01:00
Armin Novak
5f4843191b Replaced BIO_free with BIO_free_all
There is no point in using BIO_free with a custom recursion
to free up stacked BIOs if there is already BIO_free_all.
Using it consistently avoids memory leaks due to stacked BIOs
not being recursively freed.
2018-11-08 12:09:49 +01:00
Armin Novak
5eca5ebde8 Fixed #4993: Allow uninitialized bio socket in transport_bio_simple_uninit
When the TLS connection is aborted early (certificate issues, ...)
the bio simple socket might not have been initialized.
Do not access the NULL pointer on cleanup.
2018-11-07 17:02:07 +01:00
Armin Novak
88d310ff2c Fixed compiler warnings (casts, ...) 2018-10-18 09:09:30 +02:00
Armin Novak
47ba37fbcb Unified dns resolving of host 2018-09-27 16:08:28 +02:00
Armin Novak
114abad767 Removed use of strcpy. 2018-08-27 14:34:09 +02:00
Ondrej Holy
1a413b5b4e core/tcp: Prevent buffer overflow found by covscan
buffer_size_warning: Calling strncpy with a maximum size argument of 108 bytes on destination array "addr.sun_path" of size 108 bytes might leave the destination string unterminated.
2018-08-22 14:34:02 +02:00
Ondrej Holy
26bc52f79c core/tcp: Format code by astyle
Run ./scripts/format_code.sh before the following changes.
2018-08-22 14:34:02 +02:00
Martin Fleisz
99346d19c6
Merge pull request #4611 from akallabeth/argument_warnings
Argument warnings
2018-05-04 10:06:42 +02:00
Armin Novak
5765e9a422 Fixed #4476: broken casts/variable sizes for custom BIO calls. 2018-05-03 12:30:40 +02:00
Armin Novak
f631958a08 Fixed argument warning. 2018-05-02 13:08:17 +02:00
Martin Fleisz
855af9e941
Merge pull request #4557 from akallabeth/connect_error_fix
Set connection error if TCP connect fails.
2018-04-12 12:10:56 +02:00
Armin Novak
2fc31fcb37 Set connection error if TCP connect fails. 2018-04-11 09:09:23 +02:00
Andre Esteve
d240069b5e Gateway (RDG) use same IP for both channels 2018-04-10 20:59:33 -07:00
Armin Novak
26d9957608 Fix pointer type mismatch struct sockaddr_storage* and struct sockaddr* 2018-04-05 10:47:50 +02:00
Martin Fleisz
ff8b2c1b0e core: Fix IPv6 handling on Windows
On Windows the sockaddr struct is smaller than sockaddr_in6.
This causes getsockname to fail because the buffer is too small.
The new code uses sockaddr_storage which should be large enough to
hold any supported protocol address structure.

See: http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html
2018-04-04 17:19:18 +02:00
Armin Novak
78de329f1f Fixed IPv4/IPv6 to string 2018-02-08 17:26:31 +01:00
Armin Novak
7305828122 Fix #4239: Various memory leaks
* Fixed all tests, now can be run with -DWITH_ADDRESS_SANITIZER=ON compiled.
* Enabled address sanitizer for nightly builds.
2017-12-12 11:40:48 +01:00
Armin Novak
2cc64298f2 Fix #4281: Added option to prefer IPv6 over IPv4 2017-11-27 11:43:54 +01:00
Jura Sasek
4edb5cf7e6 Build for Solaris 2017-05-24 04:27:01 -07:00
Armin Novak
8250bbd6c8 Setting DNS error if lookup fails. 2016-12-19 13:49:40 +01:00