Skip to content

Commit

Permalink
fix the bug when recv headers in open state
Browse files Browse the repository at this point in the history
  • Loading branch information
tony612 committed Nov 6, 2016
1 parent d347e59 commit 8022a12
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/h2_stream.erl
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,14 @@ open({recv_data,
NewStream}
end;

%% Trailers
open({recv_h, Trailers},
open({recv_h, Headers},
#stream_state{}=Stream) ->
case is_valid_headers(request, Trailers) of
case is_valid_headers(response, Headers) of
ok ->
{next_state,
open,
Stream#stream_state{
request_headers=Stream#stream_state.request_headers ++ Trailers
response_headers=Stream#stream_state.response_headers ++ Headers
}};
{error, Code} ->
rst_stream_(Code, Stream)
Expand Down Expand Up @@ -423,7 +422,7 @@ half_closed_local(
{next_state,
half_closed_local,
Stream#stream_state{
response_headers=Headers}};
response_headers=Stream#stream_state.response_headers ++ Headers}};
{error, Code} ->
rst_stream_(Code, Stream)
end;
Expand Down

0 comments on commit 8022a12

Please sign in to comment.