Compare commits

..

1 Commits

Author SHA1 Message Date
Shilpa Seshadri
d8f9dc44a9 To fix webconfig upstream event crash 2023-01-30 19:27:01 +05:30
4 changed files with 7 additions and 27 deletions

View File

@@ -40,7 +40,7 @@
/*----------------------------------------------------------------------------*/
void *metadataPack;
size_t metaPackSize=-1;
size_t metaPackSize=0;
UpStreamMsg *UpStreamMsgQ = NULL;

View File

@@ -174,15 +174,11 @@ void eventReceiveHandler( rbusHandle_t rbus_Handle, rbusEvent_t const* event, rb
rbusValue_t newValue = rbusObject_GetValue(event->data, "value");
rbusValue_t oldValue = rbusObject_GetValue(event->data, "oldValue");
ParodusInfo("Consumer received ValueChange event for param %s\n", event->name);
if(newValue) {
interface = (char *) rbusValue_GetString(newValue, NULL);
setWebpaInterface(interface);
}
else {
ParodusError("newValue is NULL\n");
}
}
if(newValue !=NULL && oldValue!=NULL && interface!=NULL) {
ParodusInfo("New Value: %s Old Value: %s New Interface Value: %s\n", rbusValue_GetString(newValue, NULL), rbusValue_GetString(oldValue, NULL), interface);
@@ -199,13 +195,5 @@ void eventReceiveHandler( rbusHandle_t rbus_Handle, rbusEvent_t const* event, rb
set_close_retry();
}
else {
if(oldValue == NULL) {
ParodusError("oldValue is NULL\n");
}
if(interface == NULL) {
ParodusError("interface is NULL\n");
}
}
}
#endif

View File

@@ -45,10 +45,6 @@ const char * contentTypeList[]={
"application/binary"
};
void printSendMsgData(char* status, int qos, char* dest, char* transaction_uuid) {
ParodusInfo("status: %s, qos: %d, dest: %s, transaction_uuid: %s\n", (status!=NULL)?status:"NULL", qos, (dest!=NULL)?dest:"NULL", (transaction_uuid!=NULL)?transaction_uuid:"NULL");
}
bool highQosValueCheck(int qos)
{
if(qos > 24)
@@ -403,7 +399,6 @@ void sendXmidtEventToServer(wrp_msg_t * msg, rbusMethodAsyncHandle_t asyncHandle
if(msg_len > 0)
{
ParodusPrint("sendUpstreamMsgToServer\n");
printSendMsgData("send to server", notif_wrp_msg->u.event.qos, notif_wrp_msg->u.event.dest, notif_wrp_msg->u.event.transaction_uuid);
sendRetStatus = sendUpstreamMsgToServer(&msg_bytes, msg_len);
}
else
@@ -434,25 +429,23 @@ void sendXmidtEventToServer(wrp_msg_t * msg, rbusMethodAsyncHandle_t asyncHandle
{
ParodusPrint("The event is having high qos retry again\n");
ParodusInfo("Wait till connection is Up\n");
pthread_mutex_lock(get_global_cloud_status_mut());
pthread_mutex_lock(get_global_cloud_status_mut());
pthread_cond_wait(get_global_cloud_status_cond(), get_global_cloud_status_mut());
pthread_mutex_unlock(get_global_cloud_status_mut());
ParodusInfo("Received cloud status signal proceed to retry\n");
printSendMsgData("send to server after cloud reconnect", notif_wrp_msg->u.event.qos, notif_wrp_msg->u.event.dest, notif_wrp_msg->u.event.transaction_uuid);
}
else
{
errorMsg = strdup("send failed due to client disconnect");
ParodusInfo("The event is having low qos proceed to dequeue\n");
printSendMsgData(errorMsg, notif_wrp_msg->u.event.qos, notif_wrp_msg->u.event.dest, notif_wrp_msg->u.event.transaction_uuid);
createOutParamsandSendAck(msg, asyncHandle, errorMsg, CLIENT_DISCONNECT, RBUS_ERROR_INVALID_RESPONSE_FROM_DESTINATION);
xmidtQDequeue();
break;
}
}
sendRetStatus = sendUpstreamMsgToServer(&msg_bytes, msg_len);
}
if(sendRetStatus == 0)
{
errorMsg = strdup("send to server success");

View File

@@ -74,7 +74,6 @@ void parseRbusInparamsToWrp(rbusObject_t inParams, char *trans_id, wrp_msg_t **e
void createOutParamsandSendAck(wrp_msg_t *msg, rbusMethodAsyncHandle_t asyncHandle, char *errorMsg, int statuscode, rbusError_t error);
int validateXmidtData(wrp_msg_t * eventMsg, char **errorMsg, int *statusCode);
void xmidtQDequeue();
void printSendMsgData(char* status, int qos, char* dest, char* transaction_uuid);
bool highQosValueCheck(int qos);
void waitTillConnectionIsUp();
void printRBUSParams(rbusObject_t params, char* file_path);