Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
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.
|
|
|
|
|
|
This is a preparation for allowing init/4 to return an ok or an
error tuple.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
The cookie_ignore_informational has been moved to http_opts and
http2_opts.
Also fix an issue when using 'protocols' in gun:open.
When connecting via TLS the protocol's options were
discarded.
|
|
There is a race condition: After receiving data, before setting the
socket back to {active, once}, the server may have closed the socket
or an error may have occurred. Since the socket was in passive mode,
no message is received. Handling the return value of setopts solves
the issue.
Amended by Loïc Hoguin to handle the return value from the active/1
function call.
|
|
There are still small issues left to fix. In particular the
set_cookie command should be replaced with doing the same
in the protocol itself so that the scheme is correct. So
CookieStore must be propagated to all callbacks.
|
|
|
|
It doesn't provide any new information compared to the other
events.
|
|
|
|
|
|
In the documentation headers passed to ws_upgrade are typed as
gun:req_headers(), however if a map of headers is passed (which is
allowed by the type), the gun process will crash when trying to operate
on it as if it were a list.
|
|
|
|
|
|
The test suite is 216 tests with a tunnel created via two
proxies leading to one origin server. The tests are for
example socks5_h2_https where socks5 identifies the first
SOCKS5 proxy, h2 the second HTTP/2 CONNECT proxy and https
the secure HTTP/1.1 origin server.
The test not only sets up the tunnel and does a request
(or sends/receives data in the case of raw origin servers)
but also confirms that the stream_info and info data is
correct.
|
|
|
|
|
|
|
|
|
|
Also fixes all the tests. Lots of work remain around protocols
(how best to pass the base stream_ref to them? maybe the current
solution, maybe a new argument to Protocol:init) and strengthen
the concept of stream_ref, at least with its own type.
|
|
|
|
|
|
Has a timer:sleep/1 though because there is currently no way
to wait for the TLS handshake to complete.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also add a test for CONNECT to TLS via 2 TLS proxies.
|
|
The call to Transport:sockname/1 can return an error if the
socket was closed as we were gathering info. In that case we
simply do not fill in the address and port information.
|
|
Also contains a few small changes and Dialyzer fixes.
|
|
|