Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | stream-service: Prevent race conditions due to blocking call to destroy() | Tobias Brunner | 2014-09-09 | 1 | -5/+62 |
| | | | | | | | | In the previous implementation queued jobs could prevent a service from getting destroyed. This could have lead to a deadlock when the processor is cancelled. Now destroy() still blocks, but waits only for actually running tasks. The service instance is reference counted so that queued jobs can safely be destroyed. | ||||
* | stream-service: Do not accept or re-register when service is terminated | Tobias Brunner | 2014-09-09 | 1 | -2/+10 |
| | |||||
* | stream-service: Restart accepting without blocking | Tobias Brunner | 2014-09-09 | 1 | -2/+7 |
| | | | | | | | | | | | | Calling on_accept() sometimes lead to deadlocks when service->destroy() was called concurrently. That is, two threads waiting in on_accept() but the last worker would only wake one due to the call to signal(). Calling broadcast() wouldn't help either as that could lead to crashes if the thread that called destroy() is woken first. This is also more efficient as a constant pool of concurrent workers can be maintained, otherwise peaks at the limit were followed by only a single worker being active. | ||||
* | stream: Separate TCP/Unix stream helpers from stream/service implementations | Martin Willi | 2014-06-04 | 13 | -300/+503 |
| | | | | | | This allows us to disable Unix sockets cleanly on Windows. Replaces some read/write calls with recv/send counterparts, as Winsock does not like read/writes. | ||||
* | lookip: Disconnect asynchronously to avoid dead-locking watcher unregistration | Martin Willi | 2014-02-17 | 1 | -3/+2 |
| | | | | | | | | | While it really would be desirable to allow stream destruction during on_read() callbacks, this does not work anymore since e49b2998. Until we have a proper solution for this issue, use asynchronous disconnects for the only user doing so. Fixes #518. | ||||
* | stream: Make sure no watcher callback is active while changing stream callbacks | Martin Willi | 2014-01-22 | 1 | -14/+3 |
| | | | | | | | | | | | When changing async callbacks on streams, we have to make sure the watcher callback is not currently active and has temporarily disabled callbacks. This could have been the case, as we didn't explicitly removed any pending watcher registration if both callbacks are NULL. By enforcing the watcher unregistration, we are sure the watcher callback is not active and currently is not mangling the callback hooks. This should make sure we avoid any races for the callback variables. | ||||
* | Use exact mask when calling umask(2) | Tobias Brunner | 2013-10-29 | 1 | -1/+1 |
| | | | | | | Due to the previous negation the high bits of the mask were set, which at least some versions of the Android build system prevent with a compile-time check. | ||||
* | stream: Ensure UNIX socket path is null terminated | Tobias Brunner | 2013-07-24 | 1 | -0/+1 |
| | |||||
* | stream-service: move CAP_CHOWN check from plugins to service constructor | Martin Willi | 2013-07-18 | 1 | -0/+5 |
| | | | | | A plugin service can be a TCP socket now, so it does not make much sense to strictly check for CAP_CHOWN. | ||||
* | stream: allow async read/write callback to destroy the stream explicitly | Martin Willi | 2013-07-18 | 2 | -10/+15 |
| | |||||
* | stream: don't close underlying socket when creating a stream from it | Martin Willi | 2013-07-18 | 1 | -1/+6 |
| | |||||
* | stream: support keeping the service alive outside of service callback | Martin Willi | 2013-07-18 | 2 | -4/+5 |
| | |||||
* | stream: add read/write_all() methods to stream | Martin Willi | 2013-07-18 | 2 | -2/+73 |
| | |||||
* | stream: support cancellation of stream service callback | Martin Willi | 2013-07-18 | 1 | -2/+3 |
| | |||||
* | stream: use a service constructor to create services | Martin Willi | 2013-07-18 | 2 | -77/+8 |
| | | | | | | It does not make much sense to reference running services in the manager, especially as unregistration would need the URI (which a user would have to store instead of the service reference). | ||||
* | stream: replace print/vprint() convenience functions by a FILE* getter | Martin Willi | 2013-07-18 | 2 | -51/+20 |
| | | | | | While this will complicate the implementation of streams not based on a fd, it allows us to unleash the full power of FILE based convenience functions. | ||||
* | stream: add a concurrency option to services, limiting parallel callbacks | Martin Willi | 2013-07-18 | 4 | -7/+71 |
| | |||||
* | stream: add a job priority option to stream services | Martin Willi | 2013-07-18 | 4 | -7/+24 |
| | |||||
* | stream: add backlog option to stream services, forward to listen() | Martin Willi | 2013-07-18 | 4 | -11/+15 |
| | |||||
* | stream: add support for TCP stream services | Martin Willi | 2013-07-18 | 3 | -0/+53 |
| | |||||
* | stream: add support for TCP streams | Martin Willi | 2013-07-18 | 3 | -2/+108 |
| | |||||
* | stream: add support for UNIX stream services | Martin Willi | 2013-07-18 | 3 | -0/+61 |
| | |||||
* | stream: add support for UNIX streams | Martin Willi | 2013-07-18 | 3 | -0/+77 |
| | |||||
* | stream: support async operation using watcher | Martin Willi | 2013-07-18 | 2 | -0/+142 |
| | |||||
* | stream: add printf()-style covenience functions | Martin Willi | 2013-07-18 | 2 | -1/+60 |
| | |||||
* | stream: create library instance of stream-manager | Martin Willi | 2013-07-18 | 3 | -5/+2 |
| | |||||
* | stream: add a manager to dynamically register streams and services | Martin Willi | 2013-07-18 | 2 | -0/+386 |
| | |||||
* | stream: add a stream service class abstracting services using BSD sockets | Martin Willi | 2013-07-18 | 2 | -0/+235 |
| | |||||
* | stream: add a stream class abstracting BSD sockets | Martin Willi | 2013-07-18 | 2 | -0/+202 |
Currently only synchronous operation is supported, but this will be extended with asynchronous methods using the new watcher. |