TEMPLATE MAGIC FOR GREAT JUSTICE
[invirt/third/libt4.git] / rpc / rpc.cc
index a5d5b1f..a3ffef1 100644 (file)
@@ -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_;