From 3fcd7400a003a3f694f1638a31e3a9fe6cf1595a Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Thu, 10 Nov 2011 13:42:57 +0100 Subject: Reverted old FIFO functions. Still SHM enabled by default. --- src/daemon/dlt_daemon_common.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/daemon/dlt_daemon_common.c') diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c index 4877825..aaed7a2 100755 --- a/src/daemon/dlt_daemon_common.c +++ b/src/daemon/dlt_daemon_common.c @@ -187,6 +187,12 @@ int dlt_daemon_init(DltDaemon *daemon,const char *runtime_directory, int verbose dlt_set_id(daemon->ecuid,""); + /* initialize ring buffer for client connection */ + if (dlt_ringbuffer_init(&(daemon->client_ringbuffer), DLT_DAEMON_RINGBUFFER_SIZE)==-1) + { + return -1; + } + return 0; } @@ -2138,8 +2144,16 @@ void dlt_daemon_control_send_control_message( int sock, DltDaemon *daemon, DltMe } else { - /* message can not be sent */ - /* in old implementation control message was stored in buffer */ + /* Store message in history buffer */ + if (dlt_ringbuffer_put3(&(daemon->client_ringbuffer), + msg->headerbuffer+sizeof(DltStorageHeader),msg->headersize-sizeof(DltStorageHeader), + msg->databuffer,msg->datasize, + 0, 0 + )<0) + { + dlt_log(LOG_ERR,"Storage of message in history buffer failed! Message discarded.\n"); + return; + } } } -- cgit v1.2.1