anchor.diff:  
   %% Stream functions.
   
  -stream_init(State0=#state{ref=Ref, socket=Socket, transport=Transport, peer=Peer, decode_state=DecodeState0},
  -		StreamID, IsFin, HeaderBlock) ->
  +stream_decode_init(State=#state{socket=Socket, transport=Transport,
  +		decode_state=DecodeState0}, StreamID, IsFin, HeaderBlock) ->
   	%% @todo Add clause for CONNECT requests (no scheme/path).
   	try headers_decode(HeaderBlock, DecodeState0) of
  -		{Headers0=#{
  -				<<":method">> := Method,
  -				<<":scheme">> := Scheme,
  -				<<":authority">> := Authority,
  -				<<":path">> := PathWithQs}, DecodeState} ->
  -			State = State0#state{decode_state=DecodeState},
  -			Headers = maps:without([<<":method">>, <<":scheme">>, <<":authority">>, <<":path">>], Headers0),
  -			BodyLength = case Headers of
  -				_ when IsFin =:= fin ->
  -					0;
  -				#{<<"content-length">> := <<"0">>} ->
  -					0;
  -				#{<<"content-length">> := BinLength} ->
  -					Length = try
  -						cow_http_hd:parse_content_length(BinLength)
  -					catch _:_ ->
  -						terminate(State0, {stream_error, StreamID, protocol_error,
  -							'The content-length header is invalid. (RFC7230 3.3.2)'})
  -						%% @todo Err should terminate here...
  -					end,
  -					Length;
  -				_ ->
  -					undefined
  -			end,
  -			{Host, Port} = cow_http_hd:parse_host(Authority),
  -			{Path, Qs} = cow_http:parse_fullpath(PathWithQs),
  -			Req = #{
  -				ref => Ref,
  -				pid => self(),
  -				streamid => StreamID,
  -				peer => Peer,
  -				method => Method,
  -				scheme => Scheme,
  -				host => Host,
  -				port => Port,
  -				path => Path,
  -				qs => Qs,
  -				version => 'HTTP/2',
  -				headers => Headers,
  -				has_body => IsFin =:= nofin,
  -				body_length => BodyLength
  -			},
  -			stream_handler_init(State, StreamID, IsFin, idle, Req);
  +		{Headers=#{<<":method">> := _, <<":scheme">> := _,
  +				<<":authority">> := _, <<":path">> := _}, DecodeState} ->
  +			stream_req_init(State#state{decode_state=DecodeState}, StreamID, IsFin, Headers);
   		{_, DecodeState} ->
   			Transport:send(Socket, cow_http2:rst_stream(StreamID, protocol_error)),
  -			State0#state{decode_state=DecodeState}
  +			State#state{decode_state=DecodeState}
   	catch _:_ ->
  -		terminate(State0, {connection_error, compression_error,
  +		terminate(State, {connection_error, compression_error,
   			'Error while trying to decode HPACK-encoded header block. (RFC7540 4.3)'})
   	end.
  +
  +stream_req_init(State=#state{ref=Ref, peer=Peer}, StreamID, IsFin, Headers0=#{
  +		<<":method">> := Method, <<":scheme">> := Scheme,
  +		<<":authority">> := Authority, <<":path">> := PathWithQs}) ->
  +	Headers = maps:without([<<":method">>, <<":scheme">>, <<":authority">>, <<":path">>], Headers0),
  +	BodyLength = case Headers of
  +		_ when IsFin =:= fin ->
  +			0;
  +		#{<<"content-length">> := <<"0">>} ->
  +			0;
  +		#{<<"content-length">> := BinLength} ->
  +			try
  +				cow_http_hd:parse_content_length(BinLength)
  +			catch _:_ ->
  +				terminate(State, {stream_error, StreamID, protocol_error,
  +					'The content-length header is invalid. (RFC7230 3.3.2)'})
  +			end;
  +		_ ->
  +			undefined
  +	end,
  +	{Host, Port} = cow_http_hd:parse_host(Authority),
  +	{Path, Qs} = cow_http:parse_fullpath(PathWithQs),
  +	Req = #{
  +		ref => Ref,
  +		pid => self(),
  +		streamid => StreamID,
  +		peer => Peer,
  +		method => Method,
  +		scheme => Scheme,
  +		host => Host,
  +		port => Port,
  +		path => Path,
  +		qs => Qs,
  +		version => 'HTTP/2',
  +		headers => Headers,
  +		has_body => IsFin =:= nofin,
  +		body_length => BodyLength
  +	},
  +	stream_handler_init(State, StreamID, IsFin, idle, Req).
   
   stream_handler_init(State=#state{opts=Opts,
   		local_settings=#{initial_window_size := RemoteWindow},
  
positive.code: 
  continuation_frame(State=#state{parse_state={continuation, StreamID, IsFin, HeaderBlockFragment0}},
  		{continuation, StreamID, head_fin, HeaderBlockFragment1}) ->
  	stream_init(State#state{parse_state=normal}, StreamID, IsFin,
  		<< HeaderBlockFragment0/binary, HeaderBlockFragment1/binary >>);
  continuation_frame(State=#state{parse_state={continuation, StreamID, IsFin, HeaderBlockFragment0}},
  		{continuation, StreamID, head_nofin, HeaderBlockFragment1}) ->
  
negative.code: %% Single HEADERS frame headers block.
  frame(State, {headers, StreamID, IsFin, head_fin, HeaderBlock}) ->
  	%% @todo We probably need to validate StreamID here and in 4 next clauses.
  	stream_decode_init(State, StreamID, IsFin, HeaderBlock);
  %% HEADERS frame starting a headers block. Enter continuation mode.
  frame(State, {headers, StreamID, IsFin, head_nofin, HeaderBlockFragment}) ->
  	State#state{parse_state={continuation, StreamID, IsFin, HeaderBlockFragment}};
  