Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
|
|
An invalid stream reference (the websocket tuple wrapper)
was sent in the gun_data message.
Also moves autobahn to its own test suite.
|
|
|
|
|
|
|
|
|
|
Also improves the code and documentation about this message.
It was incorrectly specified that a gun_ws_upgrade message
could be sent on error; instead a gun_response is sent.
|
|
The flush(Pid) function was enhanced to also discard Websocket
messages and the new up/down messages.
|
|
The type option has been removed. The transport and protocols
options can be used in its place.
The transport_opts option can be used to specify transport
options.
The http_opts and spdy_opts options can be used to specify
protocol specific options.
The keepalive option is now a protocol specific option.
Defaults depending on the port number have changed. Now only
port 443 uses ssl by default, other ports use tcp.
|
|
All autobahntestsuite tests pass including the permessage-deflate
compression tests.
Some of the tests pass in a non-strict fashion. They are testing
for protocol errors and expect events to happen in a particular
order, which is not respected by Gun. Gun fails earlier than is
expected due to concurrent processing of frames.
The implementation when error occurs during handshake is probably
a bit rough at this point. The documentation is also incomplete
and/or wrong at this time, though this is the general state of
the Gun documentation and will be resolved in a separate commit.
|