mirror of
https://github.com/outbackdingo/parodus.git
synced 2026-01-28 02:20:02 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9abb37a005 | ||
|
|
c0edaaf31c |
@@ -40,7 +40,7 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
void *metadataPack;
|
||||
size_t metaPackSize=0;
|
||||
size_t metaPackSize=-1;
|
||||
|
||||
|
||||
UpStreamMsg *UpStreamMsgQ = NULL;
|
||||
|
||||
@@ -174,11 +174,15 @@ 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);
|
||||
|
||||
@@ -195,5 +199,13 @@ 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
|
||||
|
||||
@@ -45,6 +45,10 @@ 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)
|
||||
@@ -399,6 +403,7 @@ 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
|
||||
@@ -429,23 +434,25 @@ 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");
|
||||
|
||||
@@ -74,6 +74,7 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user