Esempio n. 1
0
void processActiveMessage(DISPATCH_PTR dispatch)
{
  hndSelect(dispatch);
  /* Moved here from "recvMessage" because need to wait until handler
     selected, (reids 10-92) */ 
  if (dispatch->msg_class == QueryClass && !resourceSelfQuery(dispatch))
    pendingReplyAdd(dispatch);
  
  if (DISPATCH_HANDLER_CHOOSEN(dispatch)) {
    processResourceAndDeliver(dispatch);
  } else {
    X_IPC_ERROR1("ERROR: processActiveMessage: No Handler Choosen for %s.\n",
	     dispatch->msg->msgData->name);
  }
}
Esempio n. 2
0
void deliverResponse(DISPATCH_PTR dispatch)
{
  if (dispatch->respProc) {
    (*dispatch->respProc)(dispatch, dispatch->respData);
    return;
  }
  
  if (!resourceSelfQuery(dispatch))
    pendingReplyRemove(dispatch);
  
  if (dispatch->org->alive) {
    dispatch->resData->intent = QUERY_REPLY_INTENT;
    dispatch->resData->msgRef = dispatch->refId;
    
    (void)x_ipc_dataMsgSend(dispatch->org->writeSd, DISPATCH_RES_DATA(dispatch));
  } else if (!dispatch->org->repliesPending) {
    moduleFree(dispatch->org);
  }
}