diff options
author | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2019-05-23 13:56:33 +0900 |
---|---|---|
committer | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2019-06-18 17:22:09 +0900 |
commit | 3580c5640c5578f508e93a8a851231b389d327cd (patch) | |
tree | efe0dd5b737e0192ea541861452c0f3f0edde099 /include | |
parent | 341831da4da448392d62e48f1a4f419a18e3dca5 (diff) | |
download | DLT-daemon-3580c5640c5578f508e93a8a851231b389d327cd.tar.gz |
daemon: Remove bytes_sent
When it fails to send a log message to connected client, daemon
tries to store the remaining partial message to internal ring
buffer and send again later. When calculating the number of bytes
which were sent to client, it had a bug which it keeps on
incrementing instead of initializing the variable on every message,
which never reached to the condition mentioned above and had a
possibility to overflow and access invalid memory. On the other hand,
daemon doesn't need to store the unsent partial message, as the socket
to the client will be closed on failure and the sent partial message
will be dropped anyways.
This commit removes the lines where the daemon tries to store the
partial message to ring buffer. With this, variable bytes_sent is
now removed.
Related commit: 2262f8b Made socket send reliable
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/dlt/dlt_common.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h index fc02743..cab860d 100644 --- a/include/dlt/dlt_common.h +++ b/include/dlt/dlt_common.h @@ -769,7 +769,6 @@ typedef struct char *buf; /**< pointer to position within receiver buffer */ char *backup_buf; /** pointer to the buffer with partial messages if any **/ int fd; /**< connection handle */ - int32_t bytes_sent; /**< total bytes sent in a single msg */ int32_t buffersize; /**< size of receiver buffer */ } DltReceiver; |