From 35d9f47fbcff23395c256b7814ce6af1d85129a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 26 Aug 2020 17:19:29 +0200 Subject: Add a gun:stream_ref() type and fix Dialyzer --- src/gun_http2.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gun_http2.erl') diff --git a/src/gun_http2.erl b/src/gun_http2.erl index d8a84b4..6863b84 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -41,6 +41,7 @@ id = undefined :: cow_http2:streamid(), %% Reference used by the user of Gun to refer to this stream. + %% This may be only a part of a stream_ref() for tunneled streams. ref :: reference(), %% Process to send messages to. @@ -72,7 +73,7 @@ %% Base stream ref, defined when the protocol runs %% inside an HTTP/2 CONNECT stream. - base_stream_ref = undefined :: undefined | reference() | [reference()], + base_stream_ref = undefined :: undefined | gun:stream_ref(), %% Current status of the connection. We use this to ensure we are %% not sending the GOAWAY frame more than once, and to validate @@ -1050,7 +1051,7 @@ connect(State=#http2_state{socket=Socket, transport=Transport, opts=Opts, Authority = [Host, $:, integer_to_binary(Port)], PseudoHeaders = #{ method => <<"CONNECT">>, - authority => Authority + authority => iolist_to_binary(Authority) }, Headers1 = lists:keydelete(<<"host">>, 1, -- cgit v1.2.3