diff --git a/conanfile.py b/conanfile.py index f39e08fd..1fb81235 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,7 +9,7 @@ class SISLConan(ConanFile): name = "sisl" - version = "12.2.3" + version = "12.2.4" homepage = "https://github.com/eBay/sisl" description = "Library for fast data structures, utilities" diff --git a/include/sisl/grpc/generic_service.hpp b/include/sisl/grpc/generic_service.hpp index 0ec71647..83e319ca 100644 --- a/include/sisl/grpc/generic_service.hpp +++ b/include/sisl/grpc/generic_service.hpp @@ -87,7 +87,7 @@ class GenericRpcData : public RpcDataAbstract, sisl::ObjLifeCounter< GenericRpcD bool do_authorization(); RpcDataAbstract* on_request_received(bool ok); - RpcDataAbstract* on_buf_read(bool); + RpcDataAbstract* on_buf_read(bool ok); RpcDataAbstract* on_buf_write(bool); RpcDataAbstract* on_request_completed(bool); diff --git a/src/grpc/generic_service.cpp b/src/grpc/generic_service.cpp index 4ae466ea..b3734cf7 100644 --- a/src/grpc/generic_service.cpp +++ b/src/grpc/generic_service.cpp @@ -98,13 +98,15 @@ RpcDataAbstract* GenericRpcData::on_request_received(bool ok) { return in_shutdown ? nullptr : create_new(); } -RpcDataAbstract* GenericRpcData::on_buf_read(bool) { - auto this_rpc_data = boost::intrusive_ptr< GenericRpcData >{this}; - // take a ref before the handler cb is called. - // unref is called in send_response which is handled by us (in case of sync calls) - // or by the handler (for async calls) - ref(); - if (RPCHelper::run_generic_handler_cb(m_rpc_info->m_server, m_ctx.method(), this_rpc_data)) { send_response(); } +RpcDataAbstract* GenericRpcData::on_buf_read(bool ok) { + if (ok) { + auto this_rpc_data = boost::intrusive_ptr< GenericRpcData >{this}; + // take a ref before the handler cb is called. + // unref is called in send_response which is handled by us (in case of sync calls) + // or by the handler (for async calls) + ref(); + if (RPCHelper::run_generic_handler_cb(m_rpc_info->m_server, m_ctx.method(), this_rpc_data)) { send_response(); } + } return nullptr; }