summaryrefslogtreecommitdiff
path: root/src/daemon/dlt-daemon.c
diff options
context:
space:
mode:
authorAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2013-12-02 09:02:28 +0100
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2014-01-10 07:15:47 +0100
commite387e0d12020f7159dc2b3c53e24dc6bb58de4b9 (patch)
tree75695e8c05d078816c00970e67a7c1cd8f025407 /src/daemon/dlt-daemon.c
parent67c51523071c338b9d800d47683a9a3417348508 (diff)
downloadDLT-daemon-e387e0d12020f7159dc2b3c53e24dc6bb58de4b9.tar.gz
Added conntection info and unregister context control messages.
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/daemon/dlt-daemon.c')
-rw-r--r--src/daemon/dlt-daemon.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index 335e3e4..94e3520 100644
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -1228,6 +1228,8 @@ int dlt_daemon_process_client_connect(DltDaemon *daemon, DltDaemonLocal *daemon_
dlt_log(LOG_INFO, str);
}
+ dlt_daemon_control_message_connection_info(in_sock,daemon,DLT_CONNECTION_STATUS_CONNECTED,"",verbose);
+
if (daemon_local->client_connections==1)
{
if (daemon_local->flags.vflag)
@@ -1284,6 +1286,7 @@ int dlt_daemon_process_client_messages(DltDaemon *daemon, DltDaemonLocal *daemon
dlt_log(LOG_INFO, str);
}
+ dlt_daemon_control_message_connection_info(DLT_DAEMON_STORE_TO_BUFFER,daemon,DLT_CONNECTION_STATUS_DISCONNECTED,"",verbose);
/* check: return 0; */
}
@@ -1996,6 +1999,34 @@ int dlt_daemon_process_user_message_unregister_context(DltDaemon *daemon, DltDae
}
}
+ /* Create automatic unregister context response for unregistered context */
+ if (daemon_local->flags.rflag)
+ {
+ int sent=0;
+ int j;
+
+ /* Send response to get log info request to DLT clients */
+ for (j = 0; j <= daemon_local->fdmax; j++)
+ {
+ /* send to everyone! */
+ if (FD_ISSET(j, &(daemon_local->master)))
+ {
+ /* except the listener and ourselves */
+ if ((j != daemon_local->fp) && (j != daemon_local->sock))
+ {
+ dlt_daemon_control_message_unregister_context(j,daemon,usercontext->apid, usercontext->ctid, "remo",verbose);
+ sent=1;
+ }
+ }
+ }
+
+ if (sent==0)
+ {
+ /* Store to buffer */
+ dlt_daemon_control_message_unregister_context(DLT_DAEMON_STORE_TO_BUFFER,daemon,usercontext->apid, usercontext->ctid, "remo",verbose);
+ }
+ }
+
/* keep not read data in buffer */
if (dlt_receiver_remove(&(daemon_local->receiver),sizeof(DltUserHeader)+sizeof(DltUserControlMsgUnregisterContext))==-1)
{