summaryrefslogtreecommitdiff
path: root/src/socket-proxy/socket-proxyd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-06 23:59:07 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-07 00:13:58 +0100
commitb7484e2a58038c57591457c1439505607bdcd833 (patch)
tree0d4de763a26ec05e87bdc0ba203a955f19653334 /src/socket-proxy/socket-proxyd.c
parent5b84559a76f30755019d6a0e6b2ccc9bbe0b3c56 (diff)
event: make sure we keep a reference to all events we dispatch while we do so.
Diffstat (limited to 'src/socket-proxy/socket-proxyd.c')
-rw-r--r--src/socket-proxy/socket-proxyd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
index 1c64c0e2e5..12d58d4406 100644
--- a/src/socket-proxy/socket-proxyd.c
+++ b/src/socket-proxy/socket-proxyd.c
@@ -338,7 +338,7 @@ static int connection_enable_event_sources(Connection *c, sd_event *event) {
r = 0;
if (r < 0) {
- log_error("Failed to set up server event source: %s", strerror(-r));
+ log_error("Failed to set up client event source: %s", strerror(-r));
return r;
}
@@ -434,6 +434,12 @@ static int add_connection_socket(Context *context, sd_event *event, int fd) {
log_error("Failed to add connection socket: %s", strerror(-r));
goto fail;
}
+
+ r = sd_event_source_set_enabled(c->client_event_source, SD_EVENT_ONESHOT);
+ if (r < 0) {
+ log_error("Failed to enable oneshot event source: %s", strerror(-r));
+ goto fail;
+ }
} else {
log_error("Failed to connect to remote host: %m");
goto fail;