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,18 +1330,15 @@ void* sev_server::send_events_thread(void* arg)
endtime = net_NetTimeToTime(&rmsg->EndTime);
sev->m_db->get_item_idx(&sts, &item_idx, rmsg->Oid, (char *)"Events");
if (EVEN(sts)) {
qcom_Free(&lsts, rmsg);
return (void*)1;
}
if (sev->m_read_threads)
thread = sev->m_db->new_thread();
if (ODD(sts)) {
if (sev->m_read_threads)
thread = sev->m_db->new_thread();
sev->m_db->get_events(&sts, thread, rmsg->Oid,
sev->m_db->m_items[item_idx].options, rmsg->EventTypeMask,
rmsg->EventPrioMask, rmsg->EventText, rmsg->EventName,
&starttime, &endtime, rmsg->MaxEvents, list);
sev->m_db->get_events(&sts, thread, rmsg->Oid,
sev->m_db->m_items[item_idx].options, rmsg->EventTypeMask,
rmsg->EventPrioMask, rmsg->EventText, rmsg->EventName,
&starttime, &endtime, rmsg->MaxEvents, list);
}
if (ODD(sts) && list.size() != 0)
msize = sizeof(*msg) + (list.size() - 1) * sizeof(sev_sEvents);
else
......
......@@ -123,7 +123,7 @@ int sevcli_set_servernode(pwr_tStatus* sts, sevcli_tCtx ctx, char* nodename)
if (EVEN(*sts))
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;
*sts = SEV__SUCCESS;
return 1;
......@@ -813,6 +813,8 @@ int sevcli_get_events(pwr_tStatus* sts, sevcli_tCtx ctx, pwr_tOid oid,
for (;;) {
rmsg = (sev_sMsgEventsGet*)qcom_Get(sts, &ctx->qid, &get, tmo);
if (*sts == QCOM__TMO || !rmsg) {
if (!rmsg)
*sts = 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