Age | Commit message (Collapse) | Author |
|
Also consolidate the ALPN code in the tls_handshake state
rather than doing it in CONNECT/Socks separately.
Also improves the origin tests by sending a message once
the handshake is completed instead of having timeouts.
|
|
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.
|
|
|
|
|
|
On Windows the timings can be flaky. It's better to retry a
few times rather than fail immediately.
|
|
|
|
|
|
|
|
This changes the way we connect to servers entirely. We now have
three states when connecting (domain_lookup, connect and
tls_handshake when applicable) and as a result three corresponding
timeout options. Each state has a start/end event associated and
the event data was tweaked to best match each event. Since the
TLS handshake is separate, the transport_opts option was also
split into two: tcp_opts and tls_opts.
|
|
|
|
|
|
No need to have the error repeated in the logs by the Gun process.
|
|
On Windows when the connection is refused the OS will retry
3 times before giving up, with a 500ms delay between tries.
This adds approximately 1 second to connection failures.
|
|
|
|
|
|
|
|
|
|
Header names can now be provided as binary, string or atom
and Gun no longer requires them to be in lowercase. The list
of headers can also be provided as a map as well.
|
|
We need to close the Gun connection to avoid owner_gone errors.
|
|
|
|
|
|
|
|
This was a bug in the case of HTTP/1.1 and an inconvenience
in the case of HTTP/2.
|
|
|
|
|
|
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.
|
|
Some intermittent failures occurred because of trying to
connect to google.com or echo.websocket.org.
|
|
|
|
|
|
|
|
|
|
The reason for this change is to avoid annoying supervisor logs
when SASL logging is enabled.
|
|
|
|
This disables the keepalive mechanism entirely.
|
|
|
|
|
|
So far only for getting the socket ip and port on the local
side. More values may be added later on.
|
|
|
|
|
|
|
|
Forgot to commit it earlier. My bad!
|