Commit Graph

186 Commits

Author SHA1 Message Date
Armin Novak
51cc567dc6 Fixed typo. 2014-11-16 23:52:22 +01:00
Armin Novak
a1761d8a7b Fixed memory leaks. 2014-11-16 23:10:33 +01:00
Armin Novak
e77a4fedc2 Fixed memory leak. 2014-11-16 17:06:42 +01:00
Armin Novak
ff3fcc24c1 Fixed unlocking if pthread_join fails. 2014-11-10 10:24:32 +01:00
Armin Novak
017e4a323e Locking thread until joined now, preventing multiple joins and race conditions. 2014-11-03 09:29:35 +01:00
Armin Novak
5bf25fd87c Fixed missing includes and typo. 2014-10-27 11:45:39 +01:00
Armin Novak
8f98f28ce8 Fixed merge errors. 2014-10-27 11:39:02 +01:00
Armin Novak
c6ed95d1bf Fixed typo 2014-10-27 11:28:13 +01:00
Armin Novak
7acdbdaa85 Error messages now prefixed with function name.
Implemented bWaitAll for WaitForMultipleObjects.
pthread_join now only called on first wait event, later ones skip this to avoid undefined behavior.
2014-10-27 11:28:11 +01:00
Armin Novak
c5bb6125c1 Added additional tests for WaitForSingleObject and WaitForMultipleObjects. 2014-10-27 11:23:18 +01:00
Armin Novak
c304f457cf Implemented thread handling for WaitForMultipleObjects.
Implemented thread specific functions.
2014-10-27 11:23:15 +01:00
Marc-André Moreau
d102e746c8 Merge branch 'awakecoding' of github.com:vworkspace/FreeRDP
Conflicts:
	libfreerdp/core/license.c
	libfreerdp/core/nego.c
	winpr/libwinpr/synch/wait.c
2014-09-19 14:38:25 -04:00
Armin Novak
0131e576b7 Fixed Barrier test. First get the thread ID, then wait for the barrier to be reached. 2014-09-09 16:33:05 +02:00
Armin Novak
b22b897389 Reformatted changed files. 2014-09-09 16:32:22 +02:00
Armin Novak
7e3a1b3073 Now using macro to generate module specific log tag. 2014-09-09 16:32:04 +02:00
Armin Novak
28ece6bb46 Replaced stdio logging with WLog 2014-09-09 16:31:46 +02:00
Mike McDonald
2ec493d094 Reverted WaitForSingleObject for event handles to retry the select upon receiving an EINTR error 2014-08-21 08:21:29 -04:00
Marc-André Moreau
1a8c763309 Merge branch 'shadow' of github.com:awakecoding/FreeRDP 2014-08-18 17:06:13 -04:00
Marc-André Moreau
5e177118aa Merge branch 'master' of github.com:FreeRDP/FreeRDP 2014-08-18 16:23:45 -04:00
Marc-André Moreau
78d43ced3d Merge branch 'master' of github.com:awakecoding/FreeRDP into shadow 2014-08-15 11:44:07 -04:00
Marc-André Moreau
168d46f253 Merge branch 'awakecoding' of github.com:vworkspace/FreeRDP
Conflicts:
	libfreerdp/core/nego.c
	libfreerdp/core/peer.c
	winpr/libwinpr/synch/wait.c
2014-08-15 11:43:50 -04:00
Marc-André Moreau
90d202ab87 server: fix build on Windows 2014-08-11 19:31:38 -04:00
Marc-André Moreau
6c85505ecc libwinpr-synch: replace pthreads-based barrier implementation by interlocked operations + event and avoid deadlocks 2014-08-08 21:02:15 -04:00
Marc-André Moreau
54264936d1 shadow: improve synchronization barrier usage 2014-08-08 20:51:26 -04:00
Marc-André Moreau
edde16e9d5 libwinpr-synch: add initial synchronization barrier implementation 2014-08-08 17:34:30 -04:00
Rene Rheaume
5f9c36da5d * Use futimens that is POSIX-compliant and compatible with uclibc instead of futimes.
* Borrowed eventfd_read and eventfd_write from bionic for uclibc compatibility (uclibc headers are broken unfortunately). Bionic and
FreeRDP are both under the Apache 2.0 license.
2014-08-06 22:06:01 -04:00
Mike McDonald
ca0ddf4039 Merge branch 'awakecoding' of https://github.com/vworkspace/FreeRDP into awakecoding 2014-08-01 15:49:19 -04:00
Mike McDonald
12c0bd64f0 Removed loop which was retrying the select after being interrupted by a signal. This was leading to threads blocking forever. 2014-08-01 15:48:54 -04:00
Bernhard Miklautz
a124f6a7c6 fix comment style
// to /* */
2014-07-29 05:22:30 +02:00
Bernhard Miklautz
a9eed46e38 Fix warnings found in Xcode 2014-07-29 05:22:30 +02:00
Bernhard Miklautz
b8415af0d8 Fix compiler warnings.
This commit is based on pull request #1493
2014-07-29 05:22:29 +02:00
Norbert Federa
cdcdec99bc OpenSSL thread safety
freerdp/winpr had the following issues:
* The non reentrant SSL_library_init() was called concurrently (crash)
* Missing code/api to set the eventually required OpenSSL static and dynamic locking callbacks
* Missing code/api to free the application-global or thread-local OpenSSL data and tables

This commit creates two new winpr functions:

BOOL winpr_InitializeSSL(DWORD flags):

Use the flag WINPR_SSL_INIT_ALREADY_INITIALIZED if you want to tell winpr that
your application has already initialized OpenSSL.
If required use the flag WINPR_SSL_INIT_ENABLE_LOCKING to tell winpr that it
should set the OpenSSL static and dynamic locking callbacks.
Otherwise just call it with the flag WINPR_SSL_INIT_DEFAULT.

The recommended way is that your application calls this function once before
any threads are created. However, in order to support lazy OpenSSL library
initialization winpr_InitializeSSL() can also safely be called multiple times
and concurrently because it uses the new InitOnceExecuteOnce() function to
guarantee that the initialization is only performed successfully once during
the life time of the calling process.

BOOL winpr_CleanupSSL(DWORD flags):

If you create a thread that uses SSL you should call this function before the
thread returns using the flag WINPR_SSL_CLEANUP_THREAD in order to clean up
the thread-local OpenSSL data and tables.
Call the function with the flag WINPR_SSL_CLEANUP_GLOBAL before terminating
your application.

Note: This commit only replaced the current occurences of the
SSL_load_error_strings(); SSL_library_init(); pairs in the freerdp source
with winpr_InitializeSSL(). None of the server or client applications has been
changed according to the recommended usage described above (TBDL).
2014-07-28 21:55:57 +02:00
Norbert Federa
fae8f6fbf2 winpr/sync: Added InitOnceExecuteOnce plus CTest 2014-07-24 21:12:59 +02:00
Marc-André Moreau
e6f4754ed3 winpr: improve windows builds across visual studio versions and toolsets 2014-07-17 15:11:04 -04:00
Norbert Federa
6b47229563 Merge pull request #1955 from nfedera/fix-2014-07-10-02
winpr: CloseHandle did not release the thread TCB
2014-07-11 16:35:12 +02:00
Norbert Federa
aac57e7e72 winpr: CloseHandle did not release the thread TCB
This resulted in huge memory leaks - 8MB per thread, depending on
the system's default stack size.
The leak happend even if CloseHandle() was correctly used to "detach"
the thread but WaitForSingleObject was never called.
2014-07-10 12:28:35 +02:00
Bernhard Miklautz
6a49bcfe40 winpr: always build "monolitic"
winpr is now always build as single library.
The build option MONOLITHIC_BUILD doesn't influence this behavior anymore.

The only exception is winpr-makecert-tool which is still build as extra
library.

This obsoletes complex_libraries for winpr.
2014-07-10 11:10:58 +02:00
Hardening
f09076e4d2 Add a guard on nCount with MAXIMUM_WAIT_OBJECTS + cosmetic fixes 2014-07-07 14:50:05 +02:00
Hardening
4bb910fec5 Fixed a typo 2014-07-04 22:14:04 +02:00
Hardening
16681cc91a Fix header inclusion 2014-07-04 16:11:19 +02:00
Hardening
4b3dc22a79 Fix missing include for macOS 2014-07-04 15:29:21 +02:00
Hardening
542811291c Use poll() instead of select() when available
select() has the major drawback that it cannot handle file descriptor
that are bigger than 1024. This patch makes use of poll() instead of
select() when poll() support is available.
2014-07-03 15:26:49 +02:00
Marc-André Moreau
ad8f031a88 Merge pull request #1864 from MartinHaimberger/namedpipefix
fixed introduced winpr bug in namedpipes
2014-05-26 08:10:28 -04:00
Martin Haimberger
c958f81016 fixed introduced winpr bug in namedpipes
Bug was introduced by 5e09e37d42
2014-05-26 03:04:22 -07:00
Marc-André Moreau
ae368549ad freerdp: fix compilation on Windows 2014-05-22 14:42:05 -04:00
Marc-André Moreau
4bac8374de Merge branch 'master' of github.com:FreeRDP/FreeRDP 2014-05-21 11:17:58 -04:00
Marc-André Moreau
472c231876 Merge pull request #1826 from Hobby-Student/master
fix FreeBSD compile errors
2014-05-21 10:53:47 -04:00
Marc-André Moreau
fb3662c7e2 winpr: fix ranlib missing symbols warnings on OS X 2014-05-09 22:44:19 -04:00
Marc-André Moreau
c1d727e9cd freerdp: fix type build warnings 2014-05-09 15:44:49 -04:00
Marc-André Moreau
a202fe4057 freerdp: fix several type related warnings 2014-05-08 18:02:02 -04:00