summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYusuke Sato <yusuke-sato@apn.alpine.co.jp>2018-08-23 19:41:28 +0900
committerChristoph Lipka <clipka@users.noreply.github.com>2018-08-23 12:41:28 +0200
commitaa4fdbaaf8fb7d50c78d976fe3018335947c547a (patch)
tree479a5b3cbb48ba8184c408afe23391c9da430c5c /src
parentec27430eb51daee1cc02c8d27a60a8000be9f4bf (diff)
downloadDLT-daemon-aa4fdbaaf8fb7d50c78d976fe3018335947c547a.tar.gz
dlt-daemon: Fix no state transition to BUFFER state (#65)
When epoll detected error for TCP client connection, no state transition had been happened. (Only the file descriptor had been closed) To prevent this, dedicated close function is called according to connection type. Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/daemon/dlt_daemon_event_handler.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/daemon/dlt_daemon_event_handler.c b/src/daemon/dlt_daemon_event_handler.c
index 9051f07..b0d16dd 100644
--- a/src/daemon/dlt_daemon_event_handler.c
+++ b/src/daemon/dlt_daemon_event_handler.c
@@ -151,9 +151,21 @@ int dlt_daemon_handle_event(DltEventHandler *pEvent,
{
/* epoll reports an error, we need to clean-up the concerned event
*/
- dlt_event_handler_unregister_connection(pEvent,
- daemon_local,
- fd);
+
+ if (type == DLT_CONNECTION_CLIENT_MSG_TCP)
+ {
+ /* To transition to BUFFER state if this is final TCP client connection,
+ * call dedicated function. this function also calls
+ * dlt_event_handler_unregister_connection() inside the function.
+ */
+ dlt_daemon_close_socket(fd, daemon, daemon_local, 0);
+ }
+ else
+ {
+ dlt_event_handler_unregister_connection(pEvent,
+ daemon_local,
+ fd);
+ }
continue;
}