diff options
author | Christoph Lipka <clipka@jp.adit-jv.com> | 2016-11-07 15:26:35 +0900 |
---|---|---|
committer | Christoph Lipka <clipka@jp.adit-jv.com> | 2017-02-01 12:14:55 +0900 |
commit | 03dce720baf91ff67eb82431f8d6ad24b4f4d657 (patch) | |
tree | 90a7cb3ddfd1b2b36b908bf75b58bebe438d0554 /src/daemon/dlt_daemon_event_handler.c | |
parent | a961dba0013ed2119aa719546c63212459753549 (diff) | |
download | DLT-daemon-03dce720baf91ff67eb82431f8d6ad24b4f4d657.tar.gz |
Event handling: Fix connection destroy bug
It might happen that an event is part of the epoll event queue that
belongs to a connection which was destroyed before the event is handled.
Due to this, the event handling main loop might stop and the daemon
exits. This misbehavior is fixed with this patch.
Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
Diffstat (limited to 'src/daemon/dlt_daemon_event_handler.c')
-rw-r--r-- | src/daemon/dlt_daemon_event_handler.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/daemon/dlt_daemon_event_handler.c b/src/daemon/dlt_daemon_event_handler.c index 9ee3bc1..cfe61a4 100644 --- a/src/daemon/dlt_daemon_event_handler.c +++ b/src/daemon/dlt_daemon_event_handler.c @@ -137,6 +137,10 @@ int dlt_daemon_handle_event(DltEventHandler *pEvent, type = con->type; fd = con->receiver->fd; } + else /* connection might have been destroyed in the meanwhile */ + { + continue; + } /* First of all handle epoll error events * We only expect EPOLLIN or EPOLLOUT |