Commit Graph

233 Commits

Author SHA1 Message Date
Bernhard Miklautz
458d3b1593 transport: fix regression introduced with PR #2770
When the event is reset in transport_check_fds xfreerdp doesn't work and
consumes 100% CPU (see #2790). On windows this is require otherwise the
CPU consumption is 100% there.
This quick fix only resets the event on windows. It's a working approach
but definitely not the final solution.
2015-07-17 12:06:41 +02:00
Armin Novak
098eda9873 Error checks for BIO_get_event
ResetEvent before reading data from transport BIO.
2015-07-09 12:20:22 +02:00
Armin Novak
0120ee75ca Resetting frontBio after read now. 2015-07-07 14:48:27 +02:00
Bernhard Miklautz
ff8d172a12 core: use error instead of debug
When the function would return with an error print an error message
instead of a debug message
2015-06-23 11:15:13 +02:00
ivan-83
307d22ca11 * debug and error messages now print function name and line number
* add debug messages to trace fake network dissconects
2015-05-27 23:48:07 +03:00
ivan-83
3912172fc8 + tsmf: OSS initial suppot (not work yet)
* tsmf: fix video playback on FreeBSD (proper shared object name)
* tsmf: renamed args: audio->sys, audio-dev->dev
* audin: OSS fix, now it work
* cmdline: add syntax help for /audin, /rdpsnd, /tsmf
* add debug messages
2015-05-27 23:22:36 +03:00
ivan-83
0fda0eb0de Code style changed. 2015-05-27 22:59:57 +03:00
ivan-83
1009268158 * debug and error messages now print function name and line number
* add debug messages to trace fake network dissconects
2015-05-27 22:57:10 +03:00
ivan-83
94a7abd2af + tsmf: OSS initial suppot (not work yet)
* tsmf: fix video playback on FreeBSD (proper shared object name)
* tsmf: renamed args: audio->sys, audio-dev->dev
* audin: OSS fix, now it work
* cmdline: add syntax help for /audin, /rdpsnd, /tsmf
* add debug messages
2015-05-27 22:54:13 +03:00
Norbert Federa
51b697d4c8 transport/mfreerdp: fix async transport
- handle WAIT_TIMEOUT result as error in async transport thread
  if an INFINITE timeout was specified in WaitForMultipleObjects
- fix mfreerdp's async transport handling to not use
  freerdp_get_event_handles/freerdp_check_event_handles if async
  transport is activated
2015-05-14 21:57:16 +02:00
Norbert Federa
e99b84ef02 transport: fixed multiple errors in async thread 2015-05-11 21:55:58 +02:00
Norbert Federa
f9f59cd29b Fix unchecked CreateDirectory calls 2015-05-07 13:28:13 +02:00
Norbert Federa
ef1fd12b15 Fix unchecked CreateEvent calls and misc fixes
1)
Added missing checks for CreateEvent which also required the
following related changes:

- changed freerdp_context_new API to BOOL
- changed freerdp_peer_context_new API to BOOL
- changed pRdpClientNew callback to BOOL
- changed pContextNew callback to BOOL
- changed psPeerAccepted callback to BOOL
- changed psPeerContextNew callback to BOOL

2)
Fixed lots of missing alloc and error checks in the
changed code's neighbourhood.

3)
Check freerdp_client_codecs_prepare result to avoid segfaults
caused by using non-initialized codecs.

4)
Fixed deadlocks in x11 caused by missing xf_unlock_x11() calls
in some error handlers

5)
Some fixes in thread pool:
- DEFAULT_POOL assignment did not match TP_POOL definition
- don't free the pool pointer if it points to the static DEFAULT_POOL
- added error handling and cleanup in InitializeThreadpool
2015-04-29 18:18:39 +02:00
Armin Novak
d98e485ac0 Fixed some type mismatches. 2015-04-21 12:35:55 +02:00
Armin Novak
d3336340ba Add *get_event_handles handle count, return check. 2015-04-21 12:24:50 +02:00
Martin Haimberger
9c0d275548 transport: added function to get bytes written
added function to get written bytes on transport.
This is needed to get a more accurate bandwidth
management.
2015-04-14 03:49:01 -07:00
Bernhard Miklautz
423b15108d Merge pull request #2522 from realjiangms/fix_WriteLock_leak
transport_write sometimes returns directly without cleanup.
2015-04-08 15:39:10 +02:00
zihao.jiang
a057526f1e transport_write sometimes returns directly without cleanup. Fix code path to always do cleanup job. 2015-04-08 21:20:07 +08:00
Bernhard Miklautz
74c8400789 coding style fixes
Add missing space after if
2015-03-30 17:15:45 +02:00
Bernhard Miklautz
f469e069dc stream: Stream_Ensure*Capacity: change return type
Change the return type of Stream_Ensure*Capacity from void to BOOL to be
able to detect realloc problems easily. Otherwise the only way to detect
this was to check if the capacity after the call was >= the required
size.
In case Stream_Ensure*Capacity fails the old memory is still available
and need to freed outside.

This commit also adds checks to most calls of Stream_Ensure*Capacity to
check if the call was successful.
2015-03-30 16:33:48 +02:00
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01:00
Marc-André Moreau
6202f48c12 libfreerdp-core: add configurable TSG/RGB fallback, fix edge cases 2015-03-19 11:44:47 -04:00
Denis Vincent
205ccb70c8 libfreerdp-core: added fallback to RPC. 2015-03-18 16:13:32 -04:00
Marc-André Moreau
dc913d9f2c libfreerdp-core: fix some RDG valgrind issues 2015-03-17 16:09:17 -04:00
Marc-André Moreau
bdf17450e5 Merge branch 'gateway' of https://github.com/dvincent-devolutions/FreeRDP into gateway 2015-03-17 14:54:04 -04:00
Denis Vincent
144d0d9b23 libfreerdp-core: Initial RDG support. 2015-03-17 14:54:16 -04:00
Zavadovsky Yan
ab8aedd801 libfreerdp-core: add comments for previous fix 2015-02-23 13:57:46 +03:00
Zavadovsky Yan
2be175cec4 libfreerdp-core: fix dead-end state in transport_read_pdu()
Situation: we have fragmented TPKT PDU without two last bytes
(or one last byte - for fast-path) in network stack.

First call to transport_read_pdu() works normally, read
available bytes and exit with status 0 - no whole PDU readed.

Before second call this missed bytes arrive.
Optionally with next PDU.

In second call header parsing code unconditionally read this
two bytes(one byte) despite this is not header bytes.
And increase stream position, so stream now contains whole PDU.

This cause (pduLength - Stream_GetPosition(s)) calculation to be 0.
So transport_read_layer_bytes()-->transport_read_layer() return 0
and transport_read_pdu() exits with "not enough data is available"
status.

If next PDU isn't available next calls to transport_read_pdu()
give same result.
If next PDU arrive - (pduLength - Stream_GetPosition(s)) will be
less than 0. Stream position will grow, grow and grow on each call.
And transport_read_pdu() never signals that PDU is readed.

Caught on Android FreeRDP client with high RDP traffic (several MBytes/s).
2015-02-22 00:28:22 +03:00
Marc-André Moreau
44d06888bb libfreerdp-core: fix BIO leaks 2015-02-18 15:36:57 -05:00
Marc-André Moreau
0e57706de5 libfreerdp-core: cleanup connect error codes, fix Win32 NLA 2015-02-17 21:01:27 -05:00
Marc-André Moreau
668b2c1811 libfreerdp-core: fix tsg buffer flushing 2015-02-17 10:54:39 -05:00
Marc-André Moreau
9c7b7ab561 libfreerdp-core: make NLA event-driven 2015-02-15 16:04:59 -05:00
Marc-André Moreau
eddfee56a3 libfreerdp-core: prepare client-side NLA for event-driven structure 2015-02-15 14:54:10 -05:00
Marc-André Moreau
ab5fdcc3f1 libfreerdp-core: NLA cleanup 2015-02-15 11:10:14 -05:00
Marc-André Moreau
991f7b347d libfreerdp-core: further abstract multiple connections used internally by tsg from rdpTransport 2015-02-15 10:06:17 -05:00
Marc-André Moreau
edfc5120b7 libfreerdp-core: replace rdpTcp by BufferedSocket BIO 2015-02-14 10:14:13 -05:00
Marc-André Moreau
e904195e49 libfreerdp-core: more rdpTcp refactoring 2015-02-13 16:51:08 -05:00
Marc-André Moreau
c001a69d50 libfreerdp-core: move wait_read/wait_write operations under BIO layer 2015-02-13 15:22:27 -05:00
Marc-André Moreau
b7a619ff8a libfreerdp-core: move some rdpTcp operations under BIO layer 2015-02-13 14:26:02 -05:00
Marc-André Moreau
69b93c322d libfreerdp-core: fix transport crash, reduce rdpTcp usage 2015-02-13 09:27:54 -05:00
Marc-André Moreau
3e414f1840 libfreerdp-core: fix server-side transport_attach crash 2015-02-13 08:41:47 -05:00
Marc-André Moreau
889ccefe0d libfreerdp-core: remove TlsIn/TlsOut from rdpTransport 2015-02-12 16:22:25 -05:00
Marc-André Moreau
70fab69347 libfreerdp-core: gateway connection refactoring 2015-02-11 14:27:29 -05:00
Marc-André Moreau
aa8b843250 libfreerdp-core: move stuff down from transport to tsg layer 2015-02-11 11:57:02 -05:00
Marc-André Moreau
46724b0c75 libfreerdp-core: fix tsg crash on disconnect 2015-02-11 10:57:14 -05:00
David FORT
5c2d5337c0 Fix socket leak when transport is disconnected 2015-02-11 15:47:43 +01:00
Marc-André Moreau
e4f99834d0 libfreerdp-core: make tsg threadless 2015-02-02 11:50:56 -05:00
Marc-André Moreau
bfe1c31529 libfreerdp-core: remove receive queue, make tsg connection sequence more event-driven 2015-02-02 08:19:07 -05:00
Marc-André Moreau
4eeabba933 libfreerdp-core: restructure RPC connection sequence 2015-02-01 18:50:21 -05:00
Marc-André Moreau
90a429e43c libfreerdp-core: refactor tsg connection sequence towards better state machine usage 2015-02-01 17:55:24 -05:00