diff --git a/src/h2_connection.erl b/src/h2_connection.erl index 121ee5c7..475decf6 100644 --- a/src/h2_connection.erl +++ b/src/h2_connection.erl @@ -1184,10 +1184,13 @@ spawn_data_receiver(Socket, Streams, Flow) -> h2_stream_set:set_socket_send_window_size(?DEFAULT_INITIAL_WINDOW_SIZE, Streams), Type = h2_stream_set:stream_set_type(Streams), ConnDetails = get('__h2_connection_details'), - spawn_link(fun() -> - put('__h2_connection_details', ConnDetails), - receive_data(Socket, Streams, Connection, Flow, Type, true, hpack:new_context()) - end). + spawn_opt( + fun() -> + put('__h2_connection_details', ConnDetails), + receive_data(Socket, Streams, Connection, Flow, Type, true, hpack:new_context()) + end, + [link, {fullsweep_after, 0}] + ). receive_data(Socket, Streams, Connection, Flow, Type, First, Decoder) -> diff --git a/src/h2_stream.erl b/src/h2_stream.erl index ba583b87..fe9ce7cf 100644 --- a/src/h2_stream.erl +++ b/src/h2_stream.erl @@ -124,7 +124,7 @@ start_link(StreamId, Streams, Connection, CallbackModule, CallbackOptions) -> Connection, CallbackModule, CallbackOptions], - []). + [{hibernate_after, 10000}]). -spec start( @@ -143,7 +143,7 @@ start(StreamId, Streams, Connection, CallbackModule, CallbackOptions) -> Connection, CallbackModule, CallbackOptions], - []). + [{hibernate_after, 10000}]). send_event(Pid, Event) -> gen_statem:cast(Pid, Event). diff --git a/src/h2_stream_set.erl b/src/h2_stream_set.erl index f421c0d6..97a91b1a 100644 --- a/src/h2_stream_set.erl +++ b/src/h2_stream_set.erl @@ -30,7 +30,7 @@ connection :: pid(), - table = ets:new(?MODULE, [public, {keypos, 2}, {read_concurrency, true}, {write_concurrency, true}]) :: ets:tab(), + table = ets:new(?MODULE, [public, {keypos, 2}, {read_concurrency, true}]) :: ets:tab(), %% Streams initiated by this peer %% mine :: peer_subset(), %% Streams initiated by the other peer