From 13803189600c724341148af34f33688497d71991 Mon Sep 17 00:00:00 2001 From: Manikandan C Date: Mon, 12 Nov 2018 14:01:47 +0100 Subject: dlt-client: logging: Extended the receiver buffer size - dlt-control couldn't receive all the GET_LOG_INFO response message when many applications and contexts are registered. Therefore the receiver buffer size was extended to 65K. Also the receive buffer size macros are reduced to one variable. - Code cleanup and improvements Signed-off-by: Saya Sugiura --- src/gateway/dlt_gateway.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/gateway/dlt_gateway.c') diff --git a/src/gateway/dlt_gateway.c b/src/gateway/dlt_gateway.c index 411630b..c5203db 100644 --- a/src/gateway/dlt_gateway.c +++ b/src/gateway/dlt_gateway.c @@ -22,7 +22,7 @@ * Christoph Lipka * Saya Sugiura * - * \copyright Copyright © 2015-2017 Advanced Driver Information Technology. \n + * \copyright Copyright © 2015-2018 Advanced Driver Information Technology. \n * License MPL-2.0: Mozilla Public License version 2.0 http://mozilla.org/MPL/2.0/. * * \file dlt_gateway.c @@ -72,7 +72,7 @@ typedef enum { * @param value string to be tested * @return 0 on success, -1 otherwise */ -STATIC int dlt_gateway_check_ip(DltGatewayConnection *con, char *value) +STATIC DltReturnValue dlt_gateway_check_ip(DltGatewayConnection *con, char *value) { struct sockaddr_in sa; int ret = DLT_RETURN_ERROR; @@ -316,7 +316,7 @@ STATIC int dlt_gateway_check_control_messages(DltGatewayConnection *con, while (token != NULL) { - if (dlt_gateway_allocate_control_messages(con) == -1) + if (dlt_gateway_allocate_control_messages(con) != DLT_RETURN_OK) { dlt_log(LOG_ERR, "Passive Control Message could not be allocated\n"); @@ -443,7 +443,7 @@ STATIC int dlt_gateway_check_periodic_control_messages(DltGatewayConnection *con con->p_control_msgs = con->p_control_msgs->next; } - if (dlt_gateway_allocate_control_messages(con) == -1) + if (dlt_gateway_allocate_control_messages(con) != DLT_RETURN_OK) { dlt_log(LOG_ERR, "Passive Control Message could not be allocated\n"); @@ -1056,7 +1056,7 @@ STATIC int dlt_gateway_parse_get_log_info(DltDaemon *daemon, int req, int verbose) { - char resp_text[DLT_RECEIVE_TEXTBUFSIZE] = {'\0'}; + char resp_text[DLT_RECEIVE_BUFSIZE] = {'\0'}; DltServiceGetLogInfoResponse *resp = NULL; AppIDsType app; ContextIDsInfoType con; @@ -1097,7 +1097,7 @@ STATIC int dlt_gateway_parse_get_log_info(DltDaemon *daemon, /* check response */ if (dlt_message_payload(msg, resp_text, - DLT_RECEIVE_TEXTBUFSIZE, + DLT_RECEIVE_BUFSIZE, DLT_OUTPUT_ASCII, 0) != DLT_RETURN_OK) { dlt_log(LOG_ERR, "GET_LOG_INFO payload failed\n"); @@ -1272,16 +1272,15 @@ STATIC int dlt_gateway_control_service_logstorage(DltDaemon *daemon, return DLT_RETURN_OK; } -int dlt_gateway_process_passive_node_messages(DltDaemon *daemon, - DltDaemonLocal *daemon_local, - DltReceiver *receiver, - int verbose) +DltReturnValue dlt_gateway_process_passive_node_messages(DltDaemon *daemon, + DltDaemonLocal *daemon_local, + DltReceiver *receiver, + int verbose) { int i = 0; DltGateway *gateway = NULL; DltGatewayConnection *con = NULL; DltMessage msg; - char local_str[DLT_DAEMON_TEXTBUFSIZE]; if ((daemon == NULL) || (daemon_local == NULL) || (receiver == NULL)) { @@ -1427,7 +1426,7 @@ int dlt_gateway_process_passive_node_messages(DltDaemon *daemon, msg.headerextra.ecu) == DLT_RETURN_ERROR) { dlt_vlog(LOG_ERR, "%s: Can't set storage header\n", __func__); - return DLT_DAEMON_ERROR_UNKNOWN; + return DLT_RETURN_ERROR; } if (dlt_daemon_client_send(DLT_DAEMON_SEND_TO_ALL, -- cgit v1.2.1