summaryrefslogtreecommitdiff
path: root/src/socket-proxy
Commit message (Collapse)AuthorAge
* util: replace close_pipe() with new safe_close_pair()Lennart Poettering2014-03-24
| | | | | | safe_close_pair() is more like safe_close(), except that it handles pairs of fds, and doesn't make and misleading allusion, as it works similarly well for socketpairs() as for pipe()s...
* util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering2014-03-18
| | | | | | | | | | | | | | | safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
* event: be more conservative when returning errors from event handler callbacksLennart Poettering2013-12-13
| | | | | We really should return errors from event handlers if we have a continous problem and don't know any other solution.
* event: hook up sd-event with the service watchdog logicLennart Poettering2013-12-11
| | | | | | | | | | | | | Adds a new call sd_event_set_watchdog() that can be used to hook up the event loop with the watchdog supervision logic of systemd. If enabled and $WATCHDOG_USEC is set the event loop will ping the invoking systemd daemon right after coming back from epoll_wait() but not more often than $WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than $WATCHDOG_USEC/4*3, to make sure the service manager is called in time. This means that setting WatchdogSec= in a .service file and calling sd_event_set_watchdog() in your daemon is enough to hook it up with the watchdog logic.
* Revert "socket-proxyd: Add --listener option for listener/destination pairs."Lennart Poettering2013-11-27
| | | | | | | | | | | This reverts commit adcf4c81c58511b67644e17fa743d1729d3c9ccf. We have a better solution for the problem of making two processes run in the same namespace, and --listener is not needed hence and should be dropped. Conflicts: man/systemd-socket-proxyd.xml
* socket-proxyd: Add --listener option for listener/destination pairs.David Strauss2013-11-25
|
* event: rename sd_event_get() to sd_event_source_get_event()Lennart Poettering2013-11-22
|
* bus: introduce concept of a "default" event loop per-thread and make use of ↵Lennart Poettering2013-11-12
| | | | | | | | | it everywhere Try to emphasize a bit that there should be a mapping between event loops and threads, hence introduce a logic that there's one "default" event loop for each thread, that can be queried via "sd_event_default()".
* socket-proxy: actually properly keep track of connectionsLennart Poettering2013-11-07
|
* socket-proxyd: no need to redefine sockaddr unionLennart Poettering2013-11-07
|
* event: make sure we keep a reference to all events we dispatch while we do so.Lennart Poettering2013-11-07
|
* socket-proxyd: rework to support multiple sockets and splice()-based ↵Lennart Poettering2013-11-06
| | | | | | | | | zero-copy network IO This also drops --ignore-env, which can't really work anymore if we allow multiple fds. Also adds support for pretty printing of peer identities for debug purposes, and abstract namespace UNIX sockets. Also ensures that we never take more connections than a certain limit.
* socket-proxy: clean-up indentingLennart Poettering2013-11-06
|
* clients: unify how we invoke getopt_long()Lennart Poettering2013-11-06
| | | | | Among other things this makes sure we always expose a --version command and show it in the help texts.
* socket-proxyd: Actually, some of those sizes are unsigned.David Strauss2013-10-31
|
* fix compiler warningsRonny Chevalier2013-10-31
| | | | | | | | multiple warnings like src/socket-proxy/socket-proxyd.c: In function ‘transfer_data_cb’: src/socket-proxy/socket-proxyd.c:237:25: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘size_t’ [-Wformat=] log_debug("Buffer now has %ld bytes full.", c->buffer_filled_len);
* socket-proxyd: Fix-up from previous change to avoid looping on errors.David Strauss2013-10-21
|
* socket-proxyd: Use ONESHOT to behave properly with multiple accept() processes.David Strauss2013-10-21
|
* socket-proxyd: Remove datagram research TODO. This proxy will not work with ↵David Strauss2013-10-19
| | | | them.
* socket-proxyd: Comment and log text cleanup.David Strauss2013-10-19
| | | | | | * Standardize on "nonblocking" spelling, per Linux man pages. * Clarify that the nonblocking sockets are never in a "blocking" or "unblocked" state, just a "would block" or "ready" state.
* socket-proxyd: initialize variable used in error code pathKay Sievers2013-10-20
|
* socket-proxyd: rename from saproxyLennart Poettering2013-10-18
The thing is a daemon, hence needs a "d" prefix. Also, we tend to not abbreviate names of background components unnecessarily, since they are not primary commands people type. Then, the fact that this thing does socket actviation is mostly in implementationd detail for the proxy. Also, do some minor indenting clean-ups and other code updates.