Skip to content

Commit

Permalink
Merge pull request #460 from nlrcomcast/xmidt_fix
Browse files Browse the repository at this point in the history
Added cloud_status check before sending message
  • Loading branch information
sadhyama authored Oct 23, 2024
2 parents 1d129c7 + 963ad10 commit ef67b7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 9 additions & 1 deletion src/upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit ef67b7f

Please sign in to comment.