From: Peter Iannucci Date: Fri, 17 Jan 2014 06:46:34 +0000 (-0500) Subject: Cosmetic changes X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/commitdiff_plain/e0c49ff6ba44cf5b47ab91d58b67763f5a1c7a58?ds=sidebyside Cosmetic changes --- diff --git a/config.cc b/config.cc index a177362..8a7bf65 100644 --- a/config.cc +++ b/config.cc @@ -37,7 +37,7 @@ using std::vector; config_view_change::~config_view_change() {} config::config(const string & _first, const string & _me, config_view_change *_vc) - : my_view_id(0), first(_first), me(_me), vc(_vc), + : first(_first), me(_me), vc(_vc), paxos(this, me == _first, me, me) { get_rpcs()->reg(paxos_protocol::heartbeat, &config::heartbeat, this); diff --git a/config.h b/config.h index d2b33ba..8d0c836 100644 --- a/config.h +++ b/config.h @@ -12,7 +12,7 @@ class config_view_change { class config : public paxos_change { private: - unsigned my_view_id; + unsigned my_view_id = 0; string first; string me; config_view_change *vc; diff --git a/rpc/marshall.h b/rpc/marshall.h index 8d5812a..bf3cbc7 100644 --- a/rpc/marshall.h +++ b/rpc/marshall.h @@ -4,10 +4,6 @@ #include "types.h" #include "rpc_protocol.h" -// -// Marshall and unmarshall objects -// - class marshall { private: string buf_ = string(rpc_protocol::DEFAULT_RPC_SZ, 0); diff --git a/rpc/rpc.cc b/rpc/rpc.cc index 80ec124..a74d907 100644 --- a/rpc/rpc.cc +++ b/rpc/rpc.cc @@ -145,7 +145,7 @@ void rpcc::cancel(lock & m_lock) { } } -int rpcc::call1(proc_id_t proc, milliseconds to, string & rep, marshall & req) { +int rpcc::call_marshalled(proc_id_t proc, milliseconds to, string & rep, marshall & req) { caller ca(0, &rep); xid_t xid_rep; @@ -413,9 +413,9 @@ void rpcs::dispatch(shared_ptr c, const string & buf) { conns_[h.clt_nonce] = c; } - string b1; + string stored_reply; - switch (check_duplicate_and_update(h.clt_nonce, h.xid, h.xid_rep, b1)) { + switch (check_duplicate_and_update(h.clt_nonce, h.xid, h.xid_rep, stored_reply)) { case NEW: // new request rh.ret = (*f)(std::forward(req), rep); if (rh.ret == rpc_protocol::unmarshall_args_failure) { @@ -427,13 +427,13 @@ void rpcs::dispatch(shared_ptr c, const string & buf) { VERIFY(rh.ret >= 0); rep.write_header(rh); - b1 = rep; + stored_reply = rep; - IF_LEVEL(2) LOG << "sending and saving reply of size " << b1.size() << " for rpc " + IF_LEVEL(2) LOG << "sending and saving reply of size " << stored_reply.size() << " for rpc " << h.xid << ", proc " << std::hex << proc << " ret " << std::dec << rh.ret << ", clt " << h.clt_nonce; - add_reply(h.clt_nonce, h.xid, b1); + add_reply(h.clt_nonce, h.xid, stored_reply); // get the latest connection to the client { @@ -442,12 +442,12 @@ void rpcs::dispatch(shared_ptr c, const string & buf) { c = conns_[h.clt_nonce]; } - c->send(rep); + c->send(stored_reply); break; case INPROGRESS: // server is working on this request break; case DONE: // duplicate and we still have the response - c->send(b1); + c->send(stored_reply); break; case FORGOTTEN: // very old request and we don't have the response anymore IF_LEVEL(2) LOG << "very old request " << h.xid << " from " << h.clt_nonce; diff --git a/rpc/rpc.h b/rpc/rpc.h index c0f8d43..ddf15f9 100644 --- a/rpc/rpc.h +++ b/rpc/rpc.h @@ -94,12 +94,12 @@ class rpcc : private connection_delegate { request dup_req_; int xid_rep_done_ = -1; - int call1(proc_id_t proc, milliseconds to, string & rep, marshall & req); + int call_marshalled(proc_id_t proc, milliseconds to, string & rep, marshall & req); template inline int call_m(proc_id_t proc, milliseconds to, R & r, marshall && req) { string rep; - int intret = call1(proc, to, rep, req); + int intret = call_marshalled(proc, to, rep, req); if (intret >= 0) VERIFY(unmarshall(rep, true, r).okdone()); // guaranteed by static type checking return intret;