anchor.diff:              streams=Streams,
               next_available_stream_id=NextId
           }=Conn) ->
  -        case
  -            h2_stream_set:new_stream(
  -                NextId,
  -                NotifyPid,
  -                Conn#connection.stream_callback_mod,
  -                Conn#connection.socket,
  -                Conn#connection.peer_settings#settings.initial_window_size,
  -                Conn#connection.self_settings#settings.initial_window_size,
  -                Streams)
  -        of
  -            {error, Code, _NewStream} ->
  -                lager:warning("[~p] tried to create new_stream ~p, but error ~p",
  -                    [Conn#connection.type, NextId, Code]),
  -
  -                {next_state, StateName, Conn};
  -            GoodStreamSet ->
  -                lager:debug("[~p] added stream #~p to ~p",
  -                    [Conn#connection.type, NextId, GoodStreamSet]),
  -
  -                send_headers(self(), NextId, Headers),
  -                send_body(self(), NextId, Body),
  -
  -                {next_state, StateName, Conn#connection{
  -                    next_available_stream_id=NextId+2,
  -                    streams=GoodStreamSet
  -                }}
  -        end;
  +    case send_request(NextId, NotifyPid, Conn, Streams, Headers, Body) of
  +        {ok, GoodStreamSet} ->
  +            {next_state, StateName, Conn#connection{
  +                next_available_stream_id=NextId+2,
  +                streams=GoodStreamSet
  +            }};
  +        {error, _Code} ->
  +            {next_state, StateName, Conn}
  +    end;
   
   handle_event({send_promise, StreamId, NewStreamId, Headers},
                StateName,
  
positive.code:         {ok, _Cert}=OK ->
              {reply, OK, StateName, Conn}
      end;
  handle_sync_event(_E, _F, StateName,
                    #connection{}=Conn) ->
      {next_state, StateName, Conn}.
  
negative.code: 
  -spec send_request(pid(), hpack:headers(), binary()) -> ok.
  send_request(Pid, Headers, Body) ->
      gen_fsm:sync_send_all_state_event(Pid, {send_request, self(), Headers, Body}, infinity),
      ok.
  
  -spec get_peer(pid()) ->
  