ninenines / gun

HTTP/1.1, HTTP/2, Websocket client (and more) for Erlang/OTP.
ISC License
898 stars 231 forks source link

Resolved missing function clause for '{gun_http2,frame,[{headers,1,no… #160

Closed onepremise closed 6 years ago

onepremise commented 6 years ago

Resolved missing function clause for '{gun_http2,frame,[{headers,1,nofin,head_fin,shared,...'. Gun didn't handle the 'shared' atom from a given parse return. While using gun for http2 requests, i encountered the following exception:

exception exit: {{function_clause,[{gun_http2,frame,[{headers,1,nofin,head_fin,shared,0,16,<<SOME DATA>>},{http2_state,<0.1344.0>,{sslsocket,{gen_tcp,#Port<0.22879>,tls_connection,undefined},<0.1347.0>},gun_tls,#{},[gun_data_h],<<>>,#{initial_window_size => 65535,max_frame_size => 16384},#{initial_window_size => 2147483647,max_concurrent_streams => 100,max_header_list_size => 40960},2147483647,65535,[{stream,1,#Ref<0.0.4.745>,<0.1344.0>,fin,2147483647,{[],[]},0,undefined,nofin,65535,undefined}],3,{state,0,4096,4096,[]},{state,767,4096,4096,[{640,{<<"authorization">>,<<"Bearer XXXXXXXX>>}},{58,{<<":path">>,<<"/v20160207/directives">>}},{69,{<<":authority">>,<<"avs-alexa-na.amazon.com:443">>}}]}}],[{file,"/Users/user/projects/tavs/_build/default/lib/gun/src/gun_http2.erl"},{line,131}]},{gun_http2,parse,2,[{file,"/Users/user/projects/tavs/_build/default/lib/gun/src/gun_http2.erl"},{line,118}]},

Adding the guard resolved the issue.