Commit 65c102df authored by Claes's avatar Claes Committed by Esteban Blanc

Sev server error handling bugfix for get events, and localhost valid as server name

parent fd156132
...@@ -1330,11 +1330,7 @@ void* sev_server::send_events_thread(void* arg) ...@@ -1330,11 +1330,7 @@ void* sev_server::send_events_thread(void* arg)
endtime = net_NetTimeToTime(&rmsg->EndTime); endtime = net_NetTimeToTime(&rmsg->EndTime);
sev->m_db->get_item_idx(&sts, &item_idx, rmsg->Oid, (char *)"Events"); sev->m_db->get_item_idx(&sts, &item_idx, rmsg->Oid, (char *)"Events");
if (EVEN(sts)) { if (ODD(sts)) {
qcom_Free(&lsts, rmsg);
return (void*)1;
}
if (sev->m_read_threads) if (sev->m_read_threads)
thread = sev->m_db->new_thread(); thread = sev->m_db->new_thread();
...@@ -1342,6 +1338,7 @@ void* sev_server::send_events_thread(void* arg) ...@@ -1342,6 +1338,7 @@ void* sev_server::send_events_thread(void* arg)
sev->m_db->m_items[item_idx].options, rmsg->EventTypeMask, sev->m_db->m_items[item_idx].options, rmsg->EventTypeMask,
rmsg->EventPrioMask, rmsg->EventText, rmsg->EventName, rmsg->EventPrioMask, rmsg->EventText, rmsg->EventName,
&starttime, &endtime, rmsg->MaxEvents, list); &starttime, &endtime, rmsg->MaxEvents, list);
}
if (ODD(sts) && list.size() != 0) if (ODD(sts) && list.size() != 0)
msize = sizeof(*msg) + (list.size() - 1) * sizeof(sev_sEvents); msize = sizeof(*msg) + (list.size() - 1) * sizeof(sev_sEvents);
else else
......
...@@ -123,7 +123,7 @@ int sevcli_set_servernode(pwr_tStatus* sts, sevcli_tCtx ctx, char* nodename) ...@@ -123,7 +123,7 @@ int sevcli_set_servernode(pwr_tStatus* sts, sevcli_tCtx ctx, char* nodename)
if (EVEN(*sts)) if (EVEN(*sts))
return 0; return 0;
if (str_NoCaseStrcmp(node.name, nodename) == 0) { if (str_NoCaseStrcmp(node.name, nodename) == 0 || str_NoCaseStrcmp(nodename, "localhost") == 0) {
ctx->server = node.nid; ctx->server = node.nid;
*sts = SEV__SUCCESS; *sts = SEV__SUCCESS;
return 1; return 1;
...@@ -813,6 +813,8 @@ int sevcli_get_events(pwr_tStatus* sts, sevcli_tCtx ctx, pwr_tOid oid, ...@@ -813,6 +813,8 @@ int sevcli_get_events(pwr_tStatus* sts, sevcli_tCtx ctx, pwr_tOid oid,
for (;;) { for (;;) {
rmsg = (sev_sMsgEventsGet*)qcom_Get(sts, &ctx->qid, &get, tmo); rmsg = (sev_sMsgEventsGet*)qcom_Get(sts, &ctx->qid, &get, tmo);
if (*sts == QCOM__TMO || !rmsg) { if (*sts == QCOM__TMO || !rmsg) {
if (!rmsg)
*sts = 0;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment