diff --git a/src/connection.c b/src/connection.c index 0a87e946..8a19bcea 100644 --- a/src/connection.c +++ b/src/connection.c @@ -939,8 +939,8 @@ static void close_conn ( noPollConn *conn, bool is_shutting_down) void close_and_unref_connection(noPollConn *conn, bool is_shutting_down) { if (conn) { - close_conn (conn, is_shutting_down); set_cloud_status(CLOUD_STATUS_OFFLINE); + close_conn (conn, is_shutting_down); ParodusInfo("cloud_status set as %s after connection close\n", get_cloud_status()); int chk_ret = remove("/tmp/webpanotifyready"); if(chk_ret == 0) diff --git a/src/upstream.c b/src/upstream.c index bc1b11ac..d19c9644 100644 --- a/src/upstream.c +++ b/src/upstream.c @@ -632,7 +632,15 @@ int sendUpstreamMsgToServer(void **resp_bytes, size_t resp_size) //TODO: Upstream and downstream messages in queue should be handled and queue should be empty before parodus forcefully disconnect from cloud. if(!close_retry || (get_parodus_cfg()->cloud_disconnect !=NULL)) { - sendRetStatus = sendMessage(get_global_conn(),appendData, encodedSize); + if(strcmp(get_parodus_cfg()->cloud_status,CLOUD_STATUS_ONLINE) == 0) + { + sendRetStatus = sendMessage(get_global_conn(),appendData, encodedSize); + } + else + { + ParodusError("cloud_status is offline, unable to send metadata pack to server\n"); + sendRetStatus = 1; + } } else {