Skip to content

Commit

Permalink
Switch to cow_http2_machine for HTTP/2
Browse files Browse the repository at this point in the history
A common state machine for Gun and Cowboy will be easier to
maintain. This fixes numerous issues including some test
failures that were hidden because the h2specd_SUITE was
flawed.

We temporarily depend on Cowlib master until a new version
is released.
  • Loading branch information
essen committed Oct 30, 2018
1 parent f6e61f4 commit 871989e
Show file tree
Hide file tree
Showing 5 changed files with 282 additions and 505 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CT_OPTS += -pa test -ct_hooks gun_ct_hook [] # -boot start_sasl
LOCAL_DEPS = ssl

DEPS = cowlib
dep_cowlib = git https://github.com/ninenines/cowlib 2.6.0
dep_cowlib = git https://github.com/ninenines/cowlib master

DOC_DEPS = asciideck

Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{deps, [
{cowlib,".*",{git,"https://github.com/ninenines/cowlib","2.6.0"}}
{cowlib,".*",{git,"https://github.com/ninenines/cowlib","master"}}
]}.
{erl_opts, [debug_info,warn_export_vars,warn_shadow_vars,warn_obsolete_guard]}.
3 changes: 3 additions & 0 deletions src/gun.erl
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,9 @@ loop(State=#state{parent=Parent, owner=Owner, owner_ref=OwnerRef,
{system, From, Request} ->
sys:handle_system_msg(Request, From, Parent, ?MODULE, [],
{loop, State});
%% @todo HTTP/2 requires more timeouts than just the keepalive timeout.
%% We should have a timeout function in protocols that deal with
%% received timeouts. Currently the timeout messages are ignored.
{ws_upgrade, _, StreamRef, _, _} ->
Owner ! {gun_error, self(), StreamRef, {badstate,
"Websocket is only supported over HTTP/1.1."}},
Expand Down
Loading

0 comments on commit 871989e

Please sign in to comment.