Commit Graph

1191 Commits

Author SHA1 Message Date
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
Marc-André Moreau
3895c930a3 Merge branch 'master' of github.com:awakecoding/FreeRDP into shadow 2014-08-05 09:56:12 -04:00
Marc-André Moreau
85b1d6c167 Merge branch 'master' of github.com:FreeRDP/FreeRDP
Conflicts:
	libfreerdp/codec/h264.c
2014-08-05 09:55:54 -04:00
Norbert Federa
9bde12f26a winpr/utils/ssl: fix comp warning and wrong param 2014-07-31 11:22:46 +02: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
352dbd52e2 winpr/comm: don't build on apple
Since code is only defined on linux building comm causes /usr/bin/ranlib
to warn about empty objects and the test doesn't build at all on apple.
2014-07-29 05:22:29 +02:00
Bernhard Miklautz
8c318da7b1 fix compiler warnings 2014-07-29 05:22:29 +02:00
Bernhard Miklautz
b8415af0d8 Fix compiler warnings.
This commit is based on pull request #1493
2014-07-29 05:22:29 +02:00
Marc-André Moreau
8321d7ffad libfreerdp-codec: fix OpenH264 usage thanks to @erbth's hack 2014-07-28 17:22:02 -04:00
Marc-André Moreau
b56eaccdc3 Merge branch 'master' of github.com:FreeRDP/FreeRDP
Conflicts:
	client/common/client.c
2014-07-28 16:58:32 -04: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
Marc-André Moreau
2036b443eb libwinpr-wtsapi: fix WtsApi32.dll dynamic loading on Windows 2014-07-26 15:23:39 -04:00
Norbert Federa
fae8f6fbf2 winpr/sync: Added InitOnceExecuteOnce plus CTest 2014-07-24 21:12:59 +02:00
Marc-André Moreau
d8b858811f shadow: initial windows server-side connectivity 2014-07-17 21:15:22 -04:00
Marc-André Moreau
19c25cf2b4 winpr-pool: fix header on non-Windows 2014-07-17 17:34:51 -04:00
Marc-André Moreau
a23d5ea527 winpr/makecert: improve command line options 2014-07-17 16:47:29 -04:00
Marc-André Moreau
e6f4754ed3 winpr: improve windows builds across visual studio versions and toolsets 2014-07-17 15:11:04 -04:00
Marc-André Moreau
4f4603133e winpr: fix build on Windows with unit tests 2014-07-17 12:02:47 -04:00
Marc-André Moreau
0fb3bf1dfd winpr/tools/makecert: add pfx support 2014-07-16 17:13:02 -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
Armin Novak
ad3255354d Added WITH_LIBRARY_VERSIONING, allowing to build shared libraries without
SOVERSION information. (required by Android)
2014-07-11 11:53:58 +02:00
Bernhard Miklautz
7b450f4012 winpr: fix handling of absolute include paths
Don't prefix include paths if it is absolute
2014-07-10 17:40:27 +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
Marc-André Moreau
2e1f6b0c6d libwinpr-crt: fix realloc to smaller size 2014-07-09 20:10:33 -04:00
Marc-André Moreau
ac7d23b9a3 libfreerdp-gdi: migrate to _aligned_malloc/_aligned_free 2014-07-08 15:07:19 -04:00
Bernhard Miklautz
199d53bb00 Merge pull request #1942 from hardening/kill_select
Use poll() instead of select() when available
2014-07-08 16:36:04 +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
Emmanuel Ledoux
2d48323865 winpr-comm: UGLY: attempt to resolve the linking issue below specific to debian-squeeze. This might end up in some circular dependencies...
Linking C executable ../../../../Testing/TestInterlocked
	../../handle/libwinpr-handle.so.1.1.0: undefined reference to `LeaveCriticalSection'
2014-07-04 18:02:35 +02:00
Emmanuel Ledoux
80f641c38a winpr-comm, serial: excluded Android platforms as well 2014-07-04 17:40:06 +02:00
Emmanuel Ledoux
7bbeff3427 winpr-comm: made its current implementation verific specific to __linux__ since it was done on top of NTTY. 2014-07-04 16:16:26 +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
Emmanuel Ledoux
9217de3bb1 winpr-utils: WLog_PrintMessageVA, include stdarg.h from wlog.h instead of wlog.c 2014-07-04 14:52:13 +02:00
Emmanuel Ledoux
37dc55d7c2 winpr-comm: fixed QueryCommDevice() when used with some wide characters 2014-07-04 12:24:41 +02:00
Emmanuel Ledoux
94dfce4f52 winpr-comm: made the unit tests to succeed when /dev/ttyS0 is not available 2014-07-03 19:01:45 +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
Emmanuel Ledoux
fba58a5b90 winpr-comm: added _HandleCloseCbsLock to protect accesses to _HandleCloseCbs 2014-07-03 11:24:37 +02:00
Emmanuel Ledoux
87ce88370a winpr-comm: added _HandleCreatorsLock to protect accesses to _HandleCreators 2014-07-03 11:20:46 +02:00
Emmanuel Ledoux
0bd9f1b789 winpr-comm: added _CommDevicesLock to protect accesses to _CommDevices 2014-07-03 11:07:48 +02:00
Emmanuel Ledoux
db1fba3a68 Revert "winpr-handle: removed RegisterHandleCloseCb() which would require a better synchronization"
RegisterHandleCloseCb() is also useful to don't get a circular dependency, a better synchronization must be find out...

This reverts commit 8f3b3fa573.
2014-07-02 16:57:20 +02:00
Emmanuel Ledoux
8f3b3fa573 winpr-handle: removed RegisterHandleCloseCb() which would require a better synchronization
winpr-comm: don't use anymore RegisterHandleCloseCb()
2014-07-02 16:19:28 +02:00
Emmanuel Ledoux
0d54307251 winpr-comm: introduced CommLog_Print(...). Don't use anymore DEBUG_WARN() and DEBUG_MSG() macros 2014-07-02 15:59:16 +02:00
Emmanuel Ledoux
300a511672 winpr-utils: exported WLog_PrintMessageVA() and defined WLog_PrintVA() in order to be then able to wrap wlog messages in another variadic function. 2014-07-02 15:37:13 +02:00
Emmanuel Ledoux
9fc225ac5d Merge branch 'ports'
Conflicts:
	channels/serial/client/serial_tty.c
2014-06-30 17:22:15 +02:00
Emmanuel Ledoux
d93c6b1362 serial: don't use wlog API yet
winpr-comm: cleared some #warnings due to wrong printf formats
2014-06-25 17:02:10 +02:00
Marc-André Moreau
c156006195 Merge branch 'master' of github.com:awakecoding/FreeRDP into egfx 2014-06-23 11:55:27 -04:00