Age | Commit message (Collapse) | Author |
|
As reported by Dialyzer.
|
|
|
|
And make sure all HTTP/2 connection_error(s) result in a
gun_down message containing the error. In the preface case
we do not send a gun_error message (because there's no stream
open yet) and gun_down was always saying normal.
Also make sure the human readable reason is included in the
gun_error message, if any.
|
|
|
|
|
|
This should be much faster than using lists:keyfind and friends.
This matters for connections that have a lot of concurrent
streams.
|
|
|
|
|
|
|
|
The reply_to option is also propagated when we switch protocols.
|
|
The auto-ping will at regular interval send a ping frame.
The silence_pings option defaults to true. It can be set
to false when the user needs to receive ping/pong frames.
|
|
|
|
|
|
|
|
This commit also reworks the switch_protocol command.
The `P | {P, Opts}` type is used here as well. This
allows us to remove the code specific to Websocket.
In addition a few new protocol functions allow us
to declare what's the name of the options key for
the protocol and what the capabilities are with
regard to keepalive.
|
|
There's now an initial_tls_handshake state for the initial
connection with handshake, and tls_handshake state for any
subsequent TLS handshakes.
The Socks5 code will be able to reuse this tls_handshake
state to perform its own transport switches.
|
|
Gun was very inefficient at receiving HTTP/2 bodies. Switching
to ensure_window and increasing the default window sizes brings
the response body reading performance at least on par with the
one for HTTP/1.1.
This has a small negative impact on message flow control because
we stop updating the window later than we did before, increasing
the number of extra messages we may send. The exact amount depends
on configuration and the exact moment flow control kicks in.
|
|
|
|
|
|
The graceful shutdown is implemented through a new 'closing'
state. This state is entered under different circumstances
depending on the protocol.
The gun:shutdown/1 function is now implemented and documented.
It allows shutting down the connection gracefully regardless
of the current state of the connection and for all protocols.
The behavior is entirely dependent on the protocol.
For HTTP/1.1 the connection stays up only until after the
current stream is complete; other streams are immediately
canceled.
For HTTP/2 a GOAWAY frame is sent and existing streams
continue to be processed. The connection is closed after
all streams are processed and the server's GOAWAY frame
is received.
For Websocket a close frame is sent. The connection is
closed when receiving the server's close frame.
In all cases the closing_timeout option defines how long
we wait, as a maximum, before closing the connection after
the graceful shutdown was started.
The graceful shutdown is also initiated when the owner
process goes away; when sending an HTTP/1.1 request
with the connection: close header; when receiving an
HTTP/1.1 response with the connection: close header;
when receiving an HTTP/1.0 response without a connection
header; when the server sends a GOAWAY HTTP/2 frame;
or when we send or receive a Websocket close frame.
Along with these changes, the gun:ws_send/2 function
now accepts a list of frames as argument. Those frames
may include a close frame that initiates the graceful
shutdown.
|
|
Flow control is disabled by default. The initial flow value
must be set to enable it (either for the entire connection
or on a per-request basis). Flow applies to all HTTP streams
as well as Websocket. HTTP/2 pushed streams receive the same
value as their originating stream.
|
|
|
|
|
|
|
|
|
|
|
|
Thought it needed cow_http2_machine changes but everything
was available. For HTTP/1.1 it is triggered when receiving
data while expecting headers. For HTTP/2 it is triggered
after we have received a HEADERS frame for streams in idle
state.
|
|
This covers many scenarios but more need to be added.
|
|
|
|
|
|
|
|
Also fix an http into http2 for one option.
|
|
|
|
|
|
This cleaner separation gets rid of the implicit body check
that was causing issues for many users. Now the body is
either given explicitly or it is expected via future
gun:data/3 calls.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
Fixes most h2specd tests.
|
|
|
|
|
|
Gun can now be used to connect through TCP HTTP/1.1 proxies
using all supported protocols. It is also possible to create
a tunnel through multiple proxies.
Also updates Cowlib to 2.6.0.
|
|
The integer form is expected, not the binary.
|
|
|
|
|
|
|
|
|