diff options
-rw-r--r-- | src/daemon/dlt-daemon.c | 27 | ||||
-rw-r--r-- | src/daemon/dlt_daemon_client.c | 2 |
2 files changed, 9 insertions, 20 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index aff33e6..4b686de 100644 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -1679,25 +1679,14 @@ int dlt_daemon_log_internal(DltDaemon *daemon, DltDaemonLocal *daemon_local, cha /* Sending data... */ { - /* check if overflow occurred */ - if (daemon->overflow_counter) { - if (dlt_daemon_send_message_overflow(daemon, daemon_local, verbose) == 0) { - dlt_vlog(LOG_WARNING, "%u messages discarded!\n", - daemon->overflow_counter); - daemon->overflow_counter = 0; - } - } - - /* look if TCP connection to client is available */ - if ((daemon->mode == DLT_USER_MODE_EXTERNAL) || (daemon->mode == DLT_USER_MODE_BOTH)) - - if ((ret = - dlt_daemon_client_send(DLT_DAEMON_SEND_TO_ALL, daemon, daemon_local, msg.headerbuffer, - sizeof(DltStorageHeader), msg.headerbuffer + sizeof(DltStorageHeader), - msg.headersize - sizeof(DltStorageHeader), - msg.databuffer, msg.datasize, verbose))) - if (ret == DLT_DAEMON_ERROR_BUFFER_FULL) - daemon->overflow_counter++; + ret = dlt_daemon_client_send(DLT_DAEMON_SEND_TO_ALL, daemon,daemon_local, + msg.headerbuffer, sizeof(DltStorageHeader), + msg.headerbuffer + sizeof(DltStorageHeader), + msg.headersize - sizeof(DltStorageHeader), + msg.databuffer, msg.datasize, verbose); + + if (ret == DLT_DAEMON_ERROR_BUFFER_FULL) + daemon->overflow_counter++; } free(msg.databuffer); diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c index 3d90a47..c47c808 100644 --- a/src/daemon/dlt_daemon_client.c +++ b/src/daemon/dlt_daemon_client.c @@ -362,7 +362,7 @@ int dlt_daemon_client_send_message_to_all_client(DltDaemon *daemon, } /* check if overflow occurred */ - if (daemon->overflow_counter) { + if (daemon->overflow_counter == 1) { ret = dlt_daemon_send_message_overflow(daemon, daemon_local, verbose); if (DLT_DAEMON_ERROR_OK == ret) { dlt_vlog(LOG_WARNING, "%s: %u messages discarded! Now able to send messages to the client.\n", |