Beispiel #1
0
void
svccb::reply (const void *reply, sfs::xdrproc_t xdr, bool nocache)
{
    rpc_msg rm;

    rm.rm_xid = xid ();
    rm.rm_direction = REPLY;
    rm.rm_reply.rp_stat = MSG_ACCEPTED;
    rm.acpted_rply.ar_verf = _null_auth;
    rm.acpted_rply.ar_stat = SUCCESS;
    rm.acpted_rply.ar_results.where = (char *) reply;
    rm.acpted_rply.ar_results.proc
        = reinterpret_cast<sun_xdrproc_t> (xdr ? xdr : srv->tbl[proc ()].xdr_res);

    get_rpc_stats ().end_call (this, ts_start);

    xdrsuio x (XDR_ENCODE);
    if (!xdr_replymsg (x.xdrp (), &rm)) {
        warn ("svccb::reply: xdr_replymsg failed\n");
        delete this;
        return;
    }

    trace (4, "reply %s:%s x=%x\n",
           srv->rpcprog->name, srv->tbl[msg.rm_call.cb_proc].name,
           xidswap (msg.rm_xid));
    if (asrvtrace >= 5 && !xdr && srv->tbl[msg.rm_call.cb_proc].print_res)
        srv->tbl[msg.rm_call.cb_proc].print_res (reply, NULL, asrvtrace - 4,
                "REPLY", "");
    srv->sendreply (this, &x, nocache);
}
Beispiel #2
0
bool
svccb::operator== (const svccb &a) const
{
    return (xid () == a.xid () && prog () == a.prog ()
            && vers () == a.vers () && proc () == a.proc ()
            && addrlen == a.addrlen && addreq (addr, a.addr, addrlen));
}
Beispiel #3
0
static void
assert_expr1 (expr_t p, char *s)
{
  if (xid (p) != id_expr)
    {
      nu_error ("syntax error: expr expected: %s", s);
    }
}
Beispiel #4
0
void
svccb::reject (auth_stat stat)
{
    trace (3, "reject (auth_stat %d) %s:%s x=%x\n",
           stat, srv->rpcprog->name, srv->tbl[msg.rm_call.cb_proc].name,
           xidswap (msg.rm_xid));

    if (!srv->xi->ateof ())
        asrv_auth_reject (srv->xi, addr, xid (), stat);
    srv->sendreply (this, NULL, true);
}
Beispiel #5
0
boolean
ident_p (expr_t e)
{
  if (xid (e) == id_ident)
    {
      return 1;
    }
  else
    {
      nu_error ("identifier expected");
      return 0;
    }
}
Beispiel #6
0
void
TplRecordset::recover(std::set<std::string>& xids)
{
    openRs();
    if (rs->BOF && rs->EndOfFile)
        return;   // Nothing to do
    rs->MoveFirst();
    while (!rs->EndOfFile) {
        _variant_t wxid = rs->Fields->Item["xid"]->Value;
        char *xidBytes;
        SafeArrayAccessData(wxid.parray, (void **)&xidBytes);
        std::string xid(xidBytes, rs->Fields->Item["xid"]->ActualSize);
        xids.insert(xid);
        SafeArrayUnaccessData(wxid.parray);
        rs->MoveNext();
    }
}
Beispiel #7
0
u_int
svccb::hash_value () const
{
    return xid () ^ hash_bytes (addr, addrlen);
}
// ---------------------------------------------------------------------------
// CxaTM_RMMessage::link
// Purpose : Call to BMSG_LINK_.
// This function will retry any retriable errors such as FENOLCB (30).
// Parameters:
//  pv_maxretries - maximum retries for retriable errors.
//  Returns error from BMSG_LINK_ call.
// ---------------------------------------------------------------------------
short CxaTM_RMMessage::link(int32 pv_maxretries)

{
    short lv_ret = 0;
    int32 lv_retries = 0;
    bool lv_exit = false;
    TM_Txid_Internal *lp_transid = (TM_Txid_Internal *) &xid()->data[0];

    XATrace(XATM_TraceExit, ("CxaTM_RMMessage::link ENTRY : ID (%d,%d), linker "
            "tag(rmid) %d.\n", lp_transid->iv_node, lp_transid->iv_seq_num, 
            ip_RM->getRmid()));

    do {
         lv_ret = BMSG_LINK_(ip_RM->getRmPhandle(),     // phandle, 
                           &iv_msgid,                   // msgid
                           NULL,                        // reqctrl
                           0,                           // reqctrlsize
                           NULL,                        // replyctrl
                           0,                           // replyctrlmax
                           (char *) Req(),              // reqdata
                           ReqLen(),                    // reqdatasize
                           (char *) Rsp(),              // replydata
                           RspLen(),                    // replydatamax
                           ip_RM->getRmid(),            // linkertag
                           TSE_LINK_PRIORITY,           // pri
                           0,                           // xmitclass
                           BMSG_LINK_LDONEQ);           // linkopts

       lv_retries++;
       if (lv_ret == FENOLCB && 
          //((pv_maxretries == -1 && (lv_retries % TM_LINKRETRY_RETRIES == 0)) ||
          (pv_maxretries == -1 ||
           (pv_maxretries > 0 && (lv_retries <= pv_maxretries))))
       {  // Message Descriptor depletion.  This means we ran out of MDs.
          // This is retriable, and we want to slow down the TM to allow
          // some of the outstanding requests to complete.
          XATrace(XATM_TraceError, ("CxaTM_RMMessage::link BMSG_LINK_ error %d, "
                       "linker tag(rmid) %d, retires %d/%d - Pausing thread for "
                       "%dms before retrying.\n", lv_ret, ip_RM->getRmid(), 
                       lv_retries, pv_maxretries, TM_LINKRETRY_PAUSE));
          tm_log_event(DTM_TM_LINK_PAUSED, SQ_LOG_WARNING, "DTM_TM_LINK_PAUSED", 
                   lv_ret, -1, lp_transid->iv_node, lp_transid->iv_seq_num, -1, -1, -1, -1, lv_retries, 
                   -1, -1, -1, -1, TM_LINKRETRY_PAUSE /*pause in ms*/, ip_RM->getRmid());
          SB_Thread::Sthr::sleep(TM_LINKRETRY_PAUSE); // in msec
       }
       if (lv_ret != FENOLCB)
          lv_exit = true;
       else
          if (pv_maxretries > 0 && lv_retries >= pv_maxretries)
             lv_exit = true;

    } while (!lv_exit);

    if (lv_ret)
    {
       XATrace(XATM_TraceExit, ("CxaTM_RMMessage::link EXIT : returning error %d.\n", lv_ret));
    }
    else
    {
       XATrace(XATM_TraceExit, ("CxaTM_RMMessage::link EXIT : returning msgid %d.\n", iv_msgid));
    }
    return lv_ret;
} //CxaTM_RMMessage::link