anchor.diff:               #connection{}=Conn) ->
       {keep_state,
        send_settings(Http2Settings, Conn)};
  -handle_event(_, {send_headers, StreamId, Headers, Opts},
  -             #connection{
  -                encode_context=EncodeContext,
  -                streams = Streams,
  -                socket = Socket
  -               }=Conn
  -            ) ->
  -   StreamComplete = proplists:get_value(send_end_stream, Opts, false),
  -
  -    Stream = h2_stream_set:get(StreamId, Streams),
  -    case h2_stream_set:type(Stream) of
  -        active ->
  -            {FramesToSend, NewContext} =
  -                h2_frame_headers:to_frames(h2_stream_set:stream_id(Stream),
  -                                           Headers,
  -                                           EncodeContext,
  -                                            (Conn#connection.peer_settings)#settings.max_frame_size,
  -                                           StreamComplete
  -                                          ),
  -            [sock:send(Socket, h2_frame:to_binary(Frame)) || Frame <- FramesToSend],
  -            send_h(Stream, Headers),
  -            {keep_state,
  -             Conn#connection{
  -               encode_context=NewContext
  -              }};
  -        idle ->
  -            %% In theory this is a client maybe activating a stream,
  -            %% but in practice, we've already activated the stream in
  -            %% new_stream/1
  -            {keep_state, Conn};
  -        closed ->
  -            {keep_state, Conn}
  -    end;
  +handle_event(_, {send_headers, StreamId, Headers, Opts}, Conn) ->
  +    send_headers_(StreamId, Headers, Opts, Conn);
   handle_event(_, {send_trailers, StreamId, Headers, Opts},
                #connection{
                   encode_context=EncodeContext,
  
positive.code:          new_stream/1,
           new_stream/2,
           new_stream/4,
           send_promise/4,
           get_response/2,
           get_peer/1,
  
negative.code:     new_stream_(From, CallbackMod, CallbackOpts, NotifyPid, Conn);
  handle_event({call, From}, {new_stream, CallbackMod, CallbackState, NotifyPid}, Conn) ->
      new_stream_(From, CallbackMod, CallbackState, NotifyPid, Conn);
  handle_event({call, From}, {new_stream, CallbackMod, CallbackState, Headers, Opts, NotifyPid}, Conn) ->
      new_stream_(From, CallbackMod, CallbackState, Headers, Opts, NotifyPid, Conn);
  handle_event({call, From}, is_push,
                    #connection{
                       peer_settings=#settings{enable_push=Push}
  