]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: messenger uses dispatch gate for authorizer callbacks 24090/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 14 Sep 2018 18:43:21 +0000 (14:43 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 14 Sep 2018 18:47:32 +0000 (14:47 -0400)
this also removes the checks for null dispatcher - start() must be
called with a valid dispatcher before getting here

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/crimson/net/SocketMessenger.cc

index 35db46a1994b869d9a241842a7b2ab0fa58962b2..f86a52fb752ba8e7a9e4d9a76f580ce544b7ced6 100644 (file)
@@ -215,21 +215,15 @@ SocketMessenger::verify_authorizer(peer_type_t peer_type,
                                   auth_proto_t protocol,
                                   bufferlist& auth)
 {
-  if (dispatcher) {
-    return dispatcher->ms_verify_authorizer(peer_type, protocol, auth);
-  } else {
-    return seastar::make_ready_future<msgr_tag_t, bufferlist>(
-        CEPH_MSGR_TAG_BADAUTHORIZER,
-        bufferlist{});
-  }
+  return seastar::with_gate(pending_dispatch, [=, &auth] {
+      return dispatcher->ms_verify_authorizer(peer_type, protocol, auth);
+    });
 }
 
 seastar::future<std::unique_ptr<AuthAuthorizer>>
 SocketMessenger::get_authorizer(peer_type_t peer_type, bool force_new)
 {
-  if (dispatcher) {
-    return dispatcher->ms_get_authorizer(peer_type, force_new);
-  } else {
-    return seastar::make_ready_future<std::unique_ptr<AuthAuthorizer>>(nullptr);
-  }
+  return seastar::with_gate(pending_dispatch, [=] {
+      return dispatcher->ms_get_authorizer(peer_type, force_new);
+    });
 }