summaryrefslogtreecommitdiff
path: root/grpc/src/core/lib/channel/handshaker.h
diff options
context:
space:
mode:
Diffstat (limited to 'grpc/src/core/lib/channel/handshaker.h')
-rw-r--r--grpc/src/core/lib/channel/handshaker.h29
1 files changed, 6 insertions, 23 deletions
diff --git a/grpc/src/core/lib/channel/handshaker.h b/grpc/src/core/lib/channel/handshaker.h
index 541f38ed..b6b69da5 100644
--- a/grpc/src/core/lib/channel/handshaker.h
+++ b/grpc/src/core/lib/channel/handshaker.h
@@ -78,7 +78,7 @@ struct HandshakerArgs {
class Handshaker : public RefCounted<Handshaker> {
public:
~Handshaker() override = default;
- virtual void Shutdown(grpc_error* why) = 0;
+ virtual void Shutdown(grpc_error_handle why) = 0;
virtual void DoHandshake(grpc_tcp_server_acceptor* acceptor,
grpc_closure* on_handshake_done,
HandshakerArgs* args) = 0;
@@ -94,26 +94,13 @@ class HandshakeManager : public RefCounted<HandshakeManager> {
HandshakeManager();
~HandshakeManager() override;
- /// Add \a mgr to the server side list of all pending handshake managers, the
- /// list starts with \a *head.
- // Not thread-safe. Caller needs to synchronize.
- void AddToPendingMgrList(HandshakeManager** head);
-
- /// Remove \a mgr from the server side list of all pending handshake managers.
- // Not thread-safe. Caller needs to synchronize.
- void RemoveFromPendingMgrList(HandshakeManager** head);
-
- /// Shutdown all pending handshake managers starting at head on the server
- /// side. Not thread-safe. Caller needs to synchronize.
- void ShutdownAllPending(grpc_error* why);
-
/// Adds a handshaker to the handshake manager.
/// Takes ownership of \a handshaker.
void Add(RefCountedPtr<Handshaker> handshaker);
/// Shuts down the handshake manager (e.g., to clean up when the operation is
/// aborted in the middle).
- void Shutdown(grpc_error* why);
+ void Shutdown(grpc_error_handle why);
/// Invokes handshakers in the order they were added.
/// Takes ownership of \a endpoint, and then passes that ownership to
@@ -133,18 +120,18 @@ class HandshakeManager : public RefCounted<HandshakeManager> {
grpc_iomgr_cb_func on_handshake_done, void* user_data);
private:
- bool CallNextHandshakerLocked(grpc_error* error);
+ bool CallNextHandshakerLocked(grpc_error_handle error);
// A function used as the handshaker-done callback when chaining
// handshakers together.
- static void CallNextHandshakerFn(void* arg, grpc_error* error);
+ static void CallNextHandshakerFn(void* arg, grpc_error_handle error);
// Callback invoked when deadline is exceeded.
- static void OnTimeoutFn(void* arg, grpc_error* error);
+ static void OnTimeoutFn(void* arg, grpc_error_handle error);
static const size_t HANDSHAKERS_INIT_SIZE = 2;
- gpr_mu mu_;
+ Mutex mu_;
bool is_shutdown_ = false;
// An array of handshakers added via grpc_handshake_manager_add().
absl::InlinedVector<RefCountedPtr<Handshaker>, HANDSHAKERS_INIT_SIZE>
@@ -161,10 +148,6 @@ class HandshakeManager : public RefCounted<HandshakeManager> {
grpc_closure on_handshake_done_;
// Handshaker args.
HandshakerArgs args_;
- // Links to the previous and next managers in a list of all pending handshakes
- // Used at server side only.
- HandshakeManager* prev_ = nullptr;
- HandshakeManager* next_ = nullptr;
};
} // namespace grpc_core