diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2020-05-14 19:30:29 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2020-05-28 19:22:54 -0300 |
| commit | 0e10aeeb1821729d24871e12d867d6037ebf6012 (patch) | |
| tree | 828ff71a03389376b2f5e2189a5b82d5c1540332 | |
| parent | 0b3eed388c88576b947b64863d89bf102547cf07 (diff) | |
lib: fix issue were a few gRPC RPCs were being logged twice
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| -rw-r--r-- | lib/northbound_grpc.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/northbound_grpc.cpp b/lib/northbound_grpc.cpp index 5dbfe877f0..83d7e0ce95 100644 --- a/lib/northbound_grpc.cpp +++ b/lib/northbound_grpc.cpp @@ -175,14 +175,13 @@ class NorthboundImpl void HandleGetCapabilities(RpcState<frr::GetCapabilitiesRequest, frr::GetCapabilitiesResponse> *tag) { - if (nb_dbg_client_grpc) - zlog_debug("received RPC GetCapabilities()"); - switch (tag->state) { case CREATE: REQUEST_RPC(GetCapabilities); tag->state = PROCESS; case PROCESS: { + if (nb_dbg_client_grpc) + zlog_debug("received RPC GetCapabilities()"); // Response: string frr_version = 1; tag->response.set_frr_version(FRR_VERSION); @@ -298,14 +297,14 @@ class NorthboundImpl void HandleCreateCandidate(RpcState<frr::CreateCandidateRequest, frr::CreateCandidateResponse> *tag) { - if (nb_dbg_client_grpc) - zlog_debug("received RPC CreateCandidate()"); - switch (tag->state) { case CREATE: REQUEST_RPC(CreateCandidate); tag->state = PROCESS; case PROCESS: { + if (nb_dbg_client_grpc) + zlog_debug("received RPC CreateCandidate()"); + struct candidate *candidate = create_candidate(); if (!candidate) { tag->responder.Finish( @@ -756,9 +755,6 @@ class NorthboundImpl HandleListTransactions(RpcState<frr::ListTransactionsRequest, frr::ListTransactionsResponse> *tag) { - if (nb_dbg_client_grpc) - zlog_debug("received RPC ListTransactions()"); - switch (tag->state) { case CREATE: REQUEST_RPC_STREAMING(ListTransactions); @@ -768,6 +764,9 @@ class NorthboundImpl tag->context); tag->state = PROCESS; case PROCESS: { + if (nb_dbg_client_grpc) + zlog_debug("received RPC ListTransactions()"); + auto list = static_cast<std::list<std::tuple< int, std::string, std::string, std::string>> *>( tag->context); @@ -876,14 +875,14 @@ class NorthboundImpl void HandleLockConfig( RpcState<frr::LockConfigRequest, frr::LockConfigResponse> *tag) { - if (nb_dbg_client_grpc) - zlog_debug("received RPC LockConfig()"); - switch (tag->state) { case CREATE: REQUEST_RPC(LockConfig); tag->state = PROCESS; case PROCESS: { + if (nb_dbg_client_grpc) + zlog_debug("received RPC LockConfig()"); + if (nb_running_lock(NB_CLIENT_GRPC, NULL)) { tag->responder.Finish( tag->response, @@ -909,14 +908,14 @@ class NorthboundImpl void HandleUnlockConfig(RpcState<frr::UnlockConfigRequest, frr::UnlockConfigResponse> *tag) { - if (nb_dbg_client_grpc) - zlog_debug("received RPC UnlockConfig()"); - switch (tag->state) { case CREATE: REQUEST_RPC(UnlockConfig); tag->state = PROCESS; case PROCESS: { + if (nb_dbg_client_grpc) + zlog_debug("received RPC UnlockConfig()"); + if (nb_running_unlock(NB_CLIENT_GRPC, NULL)) { tag->responder.Finish( tag->response, |
