Skip to content

Commit

Permalink
Change error to too_many_streams
Browse files Browse the repository at this point in the history
  • Loading branch information
zuiderkwast committed Mar 14, 2024
1 parent 3f6567a commit 9a04212
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gun_http2.erl
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ request(State=#http2_state{http2_machine=HTTP2Machine}, StreamRef, ReplyTo, Meth
case cow_http2_machine:is_remote_concurrency_limit_reached(HTTP2Machine) of
true ->
ReplyTo ! {gun_error, self(), stream_ref(State, StreamRef),
{badstate, "The maximum number of concurrent streams is reached."}},
too_many_streams},
{[], CookieStore, EvHandlerState};
false ->
request1(State, StreamRef, ReplyTo, Method, Host, Port,
Expand Down
4 changes: 2 additions & 2 deletions test/rfc7540_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ respect_max_concurrent_streams(_) ->
StreamRef1 = gun:get(ConnPid, "/"),
timer:sleep(100),
StreamRef2 = gun:get(ConnPid, "/"),
{error, {stream_error, {badstate, Message}}} = gun:await(ConnPid, StreamRef2),
"The maximum number of concurrent streams is reached." = Message,
{error, {stream_error, Reason}} = gun:await(ConnPid, StreamRef2),
too_many_streams = Reason,
{response, nofin, 200, _} = gun:await(ConnPid, StreamRef1),
{ok, _} = gun:await_body(ConnPid, StreamRef1),
gun:close(ConnPid)
Expand Down

0 comments on commit 9a04212

Please sign in to comment.