aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/vici/vici_socket.c
Commit message (Collapse)AuthorAgeFilesLines
* Use standard unsigned integer typesAndreas Steffen2016-03-241-3/+3
|
* vici: Defer read/write error reporting after connection entry has been releasedMartin Willi2015-04-131-12/+34
| | | | | | | | | | | | | | | | If a vici client registered for (control-)log events, but a vici read/write operation fails, this may result in a deadlock. The attempt to write to the bus results in a vici log message, which in turn tries to acquire the lock for the entry currently held. While a recursive lock could help as well for a single thread, there is still a risk of inter-thread races if there is more than one thread listening for events and/or having read/write errors. We instead log to a local buffer, and write to the bus not before the connection entry has been released. Additionally, we mark the connection entry as unusable to avoid writing to the failed socket again, potentially triggering an error loop.
* vici: Check if header has been received before processing an empty messageMartin Willi2014-05-071-1/+2
| | | | | | If do_read() returns with EWOULDBLOCK, we must ensure that we actually have processed the full length header before checking the zero-initialized buffer length.
* vici: Increase vici message length header from 16 to 32 bitsMartin Willi2014-05-071-6/+15
| | | | | | | | | While we currently have no need for messages larger than 65KB, we should design the protocol to be future-proof, as we plan to keep at least to lowest protocol layer stable. To avoid any allocation issues, we currently keep the message size limit at 512KB.
* vici: Make unit-tests independent from libcharon and libhydraMartin Willi2014-05-071-1/+0
| | | | Fixes monolithic build, as we can't depend on the not yet built libcharon.
* vici: Refactor socket to clean up lockingMartin Willi2014-05-071-87/+233
| | | | | | | Uses separate locks for socket read and write operations. While holding the socket reader lock, a different thread can still claim the socket write lock. This allows to asynchronously send event messages while holding the read lock.
* vici: Support thread cancellation in command callbacksMartin Willi2014-05-071-1/+3
|
* vici: Invoke dispatcher outside of connection log, allowing events from commandsMartin Willi2014-05-071-4/+13
|
* vici: Add a fully asynchronous IPC socket segmenting messages on/from streamMartin Willi2014-05-071-0/+513