diff --git a/src/conn_interface.c b/src/conn_interface.c index 9375fa44..f5d3af02 100644 --- a/src/conn_interface.c +++ b/src/conn_interface.c @@ -110,7 +110,6 @@ void createSocketConnection(void (* initKeypress)()) OnboardLog("Unrecovered error, terminating the process\n"); abort(); } - packMetaData(); UpStreamMsgQ = NULL; StartThread(handle_upstream, &upstream_tid); diff --git a/src/connection.c b/src/connection.c index 56c5a30d..b3089bb2 100644 --- a/src/connection.c +++ b/src/connection.c @@ -32,6 +32,7 @@ #include "ParodusInternal.h" #include "heartBeat.h" #include "close_retry.h" +#include "upstream.h" /*----------------------------------------------------------------------------*/ /* Macros */ /*----------------------------------------------------------------------------*/ @@ -831,6 +832,7 @@ int createNopollConnection(noPollCtx *ctx, server_list_t *server_list) ParodusPrint("LastReasonStatus reset after successful connection\n"); setMessageHandlers(); stop_conn_in_progress (); + packMetaData(); ParodusPrint("set cloud_status\n"); set_cloud_status(CLOUD_STATUS_ONLINE); ParodusInfo("cloud_status set as %s after successful connection\n", get_cloud_status()); diff --git a/src/upstream.c b/src/upstream.c index 0c742fbf..bc1b11ac 100644 --- a/src/upstream.c +++ b/src/upstream.c @@ -103,7 +103,7 @@ void packMetaData() if (metaPackSize > 0) { - ParodusPrint("metadata encoding is successful with size %zu\n", metaPackSize); + ParodusInfo("metadata encoding is successful with size %zu\n", metaPackSize); } else { diff --git a/tests/test_conn_interface.c b/tests/test_conn_interface.c index 138c07a5..a6374b18 100644 --- a/tests/test_conn_interface.c +++ b/tests/test_conn_interface.c @@ -88,6 +88,7 @@ void clear_metadata() void free_server_list (server_list_t *server_list) { + UNUSED(server_list); return; } @@ -344,7 +345,6 @@ void test_createSocketConnection() expect_function_call(nopoll_log_set_handler); will_return(createNopollConnection, nopoll_true); expect_function_call(createNopollConnection); - expect_function_call(packMetaData); expect_function_calls(StartThread, 5); expect_function_call(initKeypress); @@ -381,7 +381,6 @@ void test_createSocketConnection1() expect_function_call(nopoll_log_set_handler); will_return(createNopollConnection, nopoll_true); expect_function_call(createNopollConnection); - expect_function_call(packMetaData); expect_function_calls(StartThread, 5); will_return(nopoll_loop_wait, 1); @@ -429,7 +428,6 @@ void test_PingMissIntervalTime() expect_function_call(nopoll_log_set_handler); will_return(createNopollConnection, nopoll_true); expect_function_call(createNopollConnection); - expect_function_call(packMetaData); expect_function_calls(StartThread, 5); //Increment ping interval time to 1 sec for each nopoll_loop_wait call @@ -470,7 +468,6 @@ void err_createSocketConnection() expect_function_call(nopoll_log_set_handler); will_return(createNopollConnection, nopoll_true); expect_function_call(createNopollConnection); - expect_function_call(packMetaData); expect_function_calls(StartThread, 5); will_return(nopoll_loop_wait, 1); @@ -508,7 +505,6 @@ void test_createSocketConnection_cloud_disconn() expect_function_call(nopoll_log_set_handler); will_return(createNopollConnection, nopoll_true); expect_function_call(createNopollConnection); - expect_function_call(packMetaData); expect_function_calls(StartThread, 5); will_return(nopoll_loop_wait, 1); diff --git a/tests/test_connection.c b/tests/test_connection.c index f6c1f64e..dce18854 100644 --- a/tests/test_connection.c +++ b/tests/test_connection.c @@ -121,6 +121,11 @@ int readFromFile(const char *file_name, char **data) return 1; } +void packMetaData() +{ + return; +} + noPollConn * nopoll_conn_new_opts (noPollCtx * ctx, noPollConnOpts * opts, const char * host_ip, const char * host_port, const char * host_name,const char * get_url,const char * protocols, const char * origin) { UNUSED(host_port); UNUSED(host_name); UNUSED(get_url); UNUSED(protocols);