summaryrefslogtreecommitdiff
path: root/p11-kit/rpc-transport.c
Commit message (Collapse)AuthorAgeFilesLines
* rpc: On UNIX wait on condition variable instead of FD if header is for a ↵Simon Haggett2019-06-141-12/+35
| | | | | | | | | | | | | | | | | | | | different thread. If rpc_socket_read() receives a header for a different thread, it tries to yield by releasing the read mutex and waiting on the socket's read FD. On Linux systems, this has been observed to cause a performance problem in cases where multiple threads are being used. Threads expecting a different header can rapidly unlock and relock the read mutex, as they resume when sock->read_code hasn't changed. This can result in contention on the read mutex, which delays the thread that is expecting to consume the header. This fix updates rpc_socket_read() on UNIX to wait on a condition variable instead of the socket's read FD. The condition variable is signalled when sock->read_code changes. This allows waiting threads to only resume once the header and payload have been consumed by their target thread. This fix only targets UNIX platforms, as the Windows version that p11-kit targets by default (Windows 2000) does not provide support for condition variables. Signed-off-by: Simon Haggett <simon.haggett@gmail.com>
* debug: Add p11_debug_err to prevent use of strerrorDaiki Ueno2017-06-121-1/+1
|
* rpc: Make it less verbose about connection failureDaiki Ueno2017-02-211-1/+1
| | | | | The connection failure here is not fatal. Use p11_debug() instead of p11_message().
* rpc: New rpc_unix transport based on Unix socketNikos Mavrogiannopoulos2017-02-161-0/+89
|
* rpc: Port exec transport to WindowsDaiki Ueno2017-02-161-30/+245
| | | | | | | On Windows, use _spawnv() to create a subprocess and two unidirectional pipe created with _pipe() to communicate with it. If we can assume WinSock, it might be simpler to use a socketpair() replacement from: https://github.com/ncm/selectable-socketpair.
* build: Avoid undefined reference to rpc_exec_initDaiki Ueno2017-02-161-2/+3
|
* rpc: Fix memleak in rpc_socket cleanupDaiki Ueno2016-10-311-0/+1
| | | | | | | | GCC's asan spotted this: Direct leak of 120 byte(s) in 1 object(s) allocated from: #0 0x7f8d4f221fe0 in calloc (/lib64/libasan.so.3+0xc6fe0) #1 0x427f55 in rpc_socket_new ../p11-kit/rpc-transport.c:100 #2 0x42bc1b in rpc_exec_connect ../p11-kit/rpc-transport.c:767
* rpc-transport.c: include sys/select.h for fd_setGustavo Zacarias2015-12-071-0/+1
| | | | | | | | | | | | | | fd_set and friends, according to POSIX.1-2001, needs sys/select.h, so include it otherwise the build fails for uClibc: p11-kit/rpc-transport.c: In function ‘rpc_socket_read’: p11-kit/rpc-transport.c:350:2: error: unknown type name ‘fd_set’ p11-kit/rpc-transport.c:416:4: warning: implicit declaration of function ‘FD_ZERO’ [-Wimplicit-function-declaration] Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> https://bugs.freedesktop.org/show_bug.cgi?id=93211
* Fix build on Mingw due to missing EWOULDBLOCKLew Palm2015-07-141-0/+3
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=89081
* p11-kit: Missing unlock in function rpc_socket_read()Pankaj2015-06-031-1/+3
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=90827
* Unbreak build on OpenBSDAntoine Jacoutot2014-10-061-0/+5
| | | | | | | Add missing header for strdup(3). When EPROTO is not available, fallback to EIO. https://bugs.freedesktop.org/show_bug.cgi?id=84665
* p11-kit: Cleanup and add documentation for 'remote' optionStef Walter2014-07-081-27/+30
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=54105
* rpc: Implement execution of another tool to transport PKCS#11 RPCStef Walter2014-07-081-0/+850