Age | Commit message (Collapse) | Author |
|
In order to simplify the implementation the CookieStore is
given to the connect function now, even though it's not
currently used.
|
|
If the limit has been reached, new requests are failed immediately,
so that the application can retry them on a different connection.
Co-authored-by: Björn Svensson <[email protected]>
|
|
LH: Minor tweaks.
|
|
Adds event_handler and event_handler_state in the map returned by
gun:info/1.
Signed-off-by: Viktor Söderqvist <[email protected]>
|
|
LH: I have fixed types, extended tests and tweaked a bit.
|
|
|
|
|
|
* Tunneled streams can now close the stream.
* Data received on tunneled streams now result in
WINDOW_UPDATE frames being sent if necessary,
and flow control is handled.
This was detected as part of writing a new Cowboy test
suite for benchmarking Websocket, but should help other
uses too.
|
|
|
|
Since quicer, which provides the QUIC implementation,
is a NIF, Gun cannot depend directly on it. In order
to enable QUIC and HTTP/3, users have to set the
GUN_QUICER environment variable:
export GUN_QUICER=1
Gun is now tested using GitHub Actions. As a result
OTP-24+ is now required. In addition, the number
of OTP releases tested has been reduced; only the
latest of each major version is now tested.
This also updates Erlang.mk.
|
|
Also "fix" many TLS test failures due to yet more changes
in the default options for TLS.
Also small changes to make Dialyzer happy.
|
|
|
|
|
|
And ensure that we don't infinite loop when retries are
enabled, by decrementing the retry count instead of using
a new one.
Also check for ssl:negotiated_protocol {error,closed}
which was possible but was not documented in OTP before
this change.
Thanks @voluntas for the help.
|
|
|
|
|
|
This is to avoid reconnecting forever in a loop on bad
configuration (such as IP in a different subnet).
|
|
The number of unacknowledged pings that can be tolerated
before the connection is forcefully closed.
When a keepalive ping is sent to the peer, a counter is
incremented and if this counter exceeds the tolerance limit,
the connection is forcefully closed. The counter is
decremented whenever a ping ack is received from the peer.
By default, the mechanism for closing the connection based
on ping and ping ack is disabled.
Loïc Hoguin: I have edited a lot of the code and renamed
a few things as well as simplified the docs and increased
test timeouts to avoid race conditions.
|
|
|
|
We leave the pool in a degraded state if the configuration
given is invalid and a lookup/connect can't be made.
|
|
|
|
When no TCP options are provided, Gun will enable send
timeouts at 15s. The value was chosen large enough to
be safe while still allowing Gun to detect send errors
eventually. Different applications may need to tweak
and lower this value.
|
|
Loïc: I have reworded a couple things and reordered the tests.
It would be great to also test these things over proxies.
|
|
|
|
|
|
|
|
|
|
The following functions used to return a state, but now
return {state, State} or {error, Reason}:
* frame/5
* update_window/1,2
* maybe_ack_or_notify/2
* reset_stream/3
* push_promise_frame/7
* goaway/2
* maybe_send_data/6
* send_data/4
* send_data/6
* send_data_frame/4
Dialyzer will temporarily fail until functions start to
return error tuples.
|
|
|
|
|
|
The http-state tests were removed and replaced with
tests in HTML pages. I have devised a way to semi-
automatically import them and test them.
Additional fixes were made following changes in
the rfc6265bis draft.
|
|
|
|
This is a preparation for allowing init/4 to return an ok or an
error tuple.
|
|
Amended to make the test case hit the problem.
|
|
|
|
|
|
|
|
This will make it more obvious what callbacks return.
|
|
|
|
|
|
|
|
|
|
The approach taken here is very similar to what browsers are
doing. A separate pool is created for each host/port/scope.
The authority (host header) is used to determine which pool
will execute requests. A connection process is semi-randomly
chosen, from the connections that have capacity. Maximum
capacity is determined by the protocol (the HTTP/2 setting
set by the server is used, for example). Multiple processes
can process requests/responses on the same connection
concurrently. There is no need to "give back" the response
to the pool, the number of ongoing streams is maintained via
an event handler.
The implementation is currently not strict, there may be
more attempts to create requests than there is capacity.
I'm not sure if it should be made strict or if Gun should
just wait before sending requests (it only matters in the
HTTP/2 case at the moment).
When there is no connection with capacity available in the
pool (because they have too many streams, or are reconnecting,
or any other reason), checking out fails. There is no timeout
to wait for a connection to be available. On the other hand
the checkout_retry option allows setting multiple timeouts
to retry checking out a connection. Each retry attempt's
wait time can have a different value.
The initial implementation of this work was sponsored by
Kobil and made at the suggestion of Ilya Khaprov.
|
|
I've made some more test timeouts infinity in order
to fix additional intermittent issues that popped up.
|
|
|
|
|
|
If a request/headers/connect/ws_upgrade is created when a connection is in state
'closing', such as after receiving an HTTP/2 GOAWAY frame or an HTTP/1.1
"Connection: close" header, an error message is sent back to the caller
immediately, if reconnect is off (that is if the option retry is set to 0).
This allows an application to retry the request on another connection without
waiting for all streams on the current connection to complete.
|
|
|
|
Switching from /2 to /3 should be easy enough.
Also update the documentation about HTTP/2 Websocket support.
|
|
HTTP/1.1 Upgrade to HTTP/2 will not be implemented. There are
discussions for this functionality to be removed from the
HTTP/2 spec.
HTTP/1.1 Upgrade to TLS will most likely not be implemented.
|