anchor.diff:  -spec takeover(pid(), ranch:ref(), inet:socket(), module(), any(), binary(),
       any()) -> no_return().
   takeover(_Parent, Ref, Socket, Transport, _Opts, _Buffer, _HandlerState) ->
  +    % Remove connection from the overall connections count so it will not be
  +    % included in limiting the number of e.g. REST connections.
       ranch:remove_connection(Ref),
  +
       {Ok, Closed, Error} = Transport:messages(),
  -    SocketMode = ?DEFAULT_SOCKET_MODE,
   
       State = #state{
           socket = Socket,
  -        socket_mode = SocketMode,
  +        socket_mode = ?DEFAULT_SOCKET_MODE,
           transport = Transport,
           ok = Ok,
           closed = Closed,
  
positive.code:     end;
  
  handle_info({Ok, Socket, Data}, #state{status = upgrading_protocol, socket = Socket, ok = Ok} = State) ->
      case handle_protocol_upgrade(State, Data) of
          {ok, State1} ->
              State2 = State1#state{status = performing_handshake},
              activate_socket_once(State2),
              {noreply, State2, ?PROTO_CONNECTION_TIMEOUT};
          {error, Reason} ->
              {stop, Reason, State}
  
negative.code:         peer_id = ProviderId,
          verify_msg = ?DEFAULT_VERIFY_MSG_FLAG
      },
      activate_socket(State, true),
  
      State.
  
  
  %% @private
  -spec verify_provider_identity(od_provider:id()) -> ok | no_return().
  verify_provider_identity(ProviderId) ->
      case provider_logic:verify_provider_identity(ProviderId) of
          ok ->
              ok;
          Error ->
              ?warning("Cannot verify identity of provider ~p, skipping connection - ~p", [
                  ProviderId, Error
              ]),
              throw(cannot_verify_identity)
      end.
  
  
  %%--------------------------------------------------------------------
  