X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/130f2d53438eb6193accb445aca52fa8e2fe4158..4b9798f44ae94deabf87dd534337b55259272950:/rpc/rpc.cc?ds=sidebyside diff --git a/rpc/rpc.cc b/rpc/rpc.cc index a5d5b1f..a3ffef1 100644 --- a/rpc/rpc.cc +++ b/rpc/rpc.cc @@ -387,7 +387,6 @@ compress: } } - rpcs::rpcs(unsigned int p1, int count) : port_(p1), counting_(count), curr_counts_(count), lossytest_(0), reachable_ (true) { @@ -400,7 +399,7 @@ rpcs::rpcs(unsigned int p1, int count) lossytest_ = atoi(loss_env); } - reg(rpc_const::bind, this, &rpcs::rpcbind); + reg(rpc_const::bind, &rpcs::rpcbind, this); dispatchpool_ = new ThrPool(6,false); listener_ = new tcpsconn(this, port_, lossytest_); @@ -564,14 +563,14 @@ rpcs::dispatch(djob_t *j) updatestat(proc); } - rh.ret = f->fn(req, rep); - if (rh.ret == rpc_const::unmarshal_args_failure) { - fprintf(stderr, "rpcs::dispatch: failed to" - " unmarshall the arguments. You are" - " probably calling RPC 0x%x with wrong" - " types of arguments.\n", proc); - VERIFY(0); - } + rh.ret = (*f)(req, rep); + if (rh.ret == rpc_const::unmarshal_args_failure) { + fprintf(stderr, "rpcs::dispatch: failed to" + " unmarshall the arguments. You are" + " probably calling RPC 0x%x with wrong" + " types of arguments.\n", proc); + VERIFY(0); + } VERIFY(rh.ret >= 0); rep.pack_reply_header(rh); @@ -725,7 +724,7 @@ rpcs::free_reply_window(void) // rpc handler int -rpcs::rpcbind(int a, int &r) +rpcs::rpcbind(int &r, int a) { jsl_log(JSL_DBG_2, "rpcs::rpcbind called return nonce %u\n", nonce_); r = nonce_;