summaryrefslogtreecommitdiff
path: root/src/daemon/dlt_daemon_socket.h
diff options
context:
space:
mode:
authorSaya Sugiura <ssugiura@jp.adit-jv.com>2019-05-23 13:56:33 +0900
committerSaya Sugiura <ssugiura@jp.adit-jv.com>2019-06-18 17:22:09 +0900
commit3580c5640c5578f508e93a8a851231b389d327cd (patch)
treeefe0dd5b737e0192ea541861452c0f3f0edde099 /src/daemon/dlt_daemon_socket.h
parent341831da4da448392d62e48f1a4f419a18e3dca5 (diff)
downloadDLT-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 'src/daemon/dlt_daemon_socket.h')
-rw-r--r--src/daemon/dlt_daemon_socket.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/daemon/dlt_daemon_socket.h b/src/daemon/dlt_daemon_socket.h
index 7276b2d..a9ac008 100644
--- a/src/daemon/dlt_daemon_socket.h
+++ b/src/daemon/dlt_daemon_socket.h
@@ -76,6 +76,6 @@ int dlt_daemon_socket_send(int sock, void *data1, int size1, void *data2, int si
* @param message_size
* @return on sucess: DLT_DAEMON_ERROR_OK, on error: DLT_DAEMON_ERROR_SEND_FAILED
*/
-int dlt_daemon_socket_sendreliable(int sock, void *data_buffer, int message_size, int *bytes_sent);
+int dlt_daemon_socket_sendreliable(int sock, void *data_buffer, int message_size);
#endif /* DLT_DAEMON_SOCKET_H */