Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove forward reference overload in KV RPC #640

Merged
merged 2 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions node/silkworm/rpc/call.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,17 +510,6 @@ class BidirectionalStreamingRpc : public BaseRpc {
return false;
}

bool send_response(Response&& response) {
response_queue_.push_back(std::move(response));
SILK_DEBUG << "BidirectionalStreamingRpc::send_response enqueued response [" << this << "]";

if (!write_in_progress()) {
write();
return true;
}
return false;
}

/// Call this to indicate the completion of server-side streaming.
bool close() {
SILK_DEBUG << "BidirectionalStreamingRpc::close peer " << peer() << " [" << this << "]";
Expand Down
34 changes: 17 additions & 17 deletions node/silkworm/rpc/kv_calls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void TxCall::start() {
// Send an unsolicited message containing the transaction ID.
remote::Pair kv_pair;
kv_pair.set_txid(read_only_txn_.id());
const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_DEBUG << "TxCall::start message with txid=" << read_only_txn_.id() << " sent: " << sent;

// Start a guard timer for closing and reopening to avoid long-lived transactions.
Expand Down Expand Up @@ -175,7 +175,7 @@ void TxCall::handle_cursor_open(const remote::Cursor* request) {
remote::Pair kv_pair;
kv_pair.set_cursorid(cursor_it->first);
SILK_INFO << "Tx peer: " << peer() << " opened cursor: " << kv_pair.cursorid();
const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_cursor_open " << this << " sent: " << sent;
}

Expand Down Expand Up @@ -393,7 +393,7 @@ void TxCall::handle_first(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_first " << this << " sent: " << sent << " END";
}

Expand All @@ -409,7 +409,7 @@ void TxCall::handle_first_dup(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_first_dup " << this << " sent: " << sent << " END";
}

Expand All @@ -427,7 +427,7 @@ void TxCall::handle_seek(const remote::Cursor* request, db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_seek " << this << " sent: " << sent << " END";
}

Expand All @@ -443,7 +443,7 @@ void TxCall::handle_seek_both(const remote::Cursor* request, db::Cursor& cursor)
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_seek_both " << this << " sent: " << sent << " END";
}

Expand All @@ -458,7 +458,7 @@ void TxCall::handle_seek_exact(const remote::Cursor* request, db::Cursor& cursor
kv_pair.set_k(request->k());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_seek_exact " << this << " sent: " << sent << " END";
}

Expand All @@ -475,7 +475,7 @@ void TxCall::handle_seek_both_exact(const remote::Cursor* request, db::Cursor& c
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_seek_both_exact " << this << " sent: " << sent << " END";
}

Expand All @@ -490,7 +490,7 @@ void TxCall::handle_current(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_current " << this << " sent: " << sent << " END";
}

Expand All @@ -505,7 +505,7 @@ void TxCall::handle_last(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_last " << this << " sent: " << sent << " END";
}

Expand All @@ -521,7 +521,7 @@ void TxCall::handle_last_dup(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_last_dup " << this << " sent: " << sent << " END";
}

Expand All @@ -536,7 +536,7 @@ void TxCall::handle_next(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_next " << this << " sent: " << sent << " END";
}

Expand All @@ -552,7 +552,7 @@ void TxCall::handle_next_dup(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_next_dup " << this << " sent: " << sent << " END";
}

Expand All @@ -567,7 +567,7 @@ void TxCall::handle_next_no_dup(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_next_no_dup " << this << " sent: " << sent << " END";
}

Expand All @@ -582,7 +582,7 @@ void TxCall::handle_prev(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_prev " << this << " sent: " << sent << " END";
}

Expand All @@ -598,7 +598,7 @@ void TxCall::handle_prev_dup(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_prev_dup " << this << " sent: " << sent << " END";
}

Expand All @@ -613,7 +613,7 @@ void TxCall::handle_prev_no_dup(db::Cursor& cursor) {
kv_pair.set_v(result.value.as_string());
}

const bool sent = send_response(std::move(kv_pair));
const bool sent = send_response(kv_pair);
SILK_TRACE << "TxCall::handle_prev_no_dup " << this << " sent: " << sent << " END";
}

Expand Down