Age | Commit message (Collapse) | Author |
|
The "normal" errors are still silenced when calling ranch:handshake.
|
|
A map should now be used when specifying transport options
that contain more than just socket options. It is still
possible to pass a list of socket options directly as a
convenience.
The ack_timeout is renamed to handshake_timeout when
specified as a map. This corresponds to the new function
ranch:handshake/1,2 that will be favored in Ranch 2.0.
Specifying Ranch-specific options via the proplist will
no longer be possible starting from Ranch 2.0.
|
|
|
|
This commit deprecates Transport:accept_ack/1 in favor of
a new forward-compatible function. Transport:handshake/1,2
will use ssl:handshake/2,3 from Ranch 2.0 onward.
|
|
LH: Reworked validation style and added a -dialyzer
attribute to acceptor_SUITE to silence expected errors.
|
|
This allows graceful draining of connections, updating transport
options on a running listener without having to drop connections
and other similar scenarios.
Note that when updating transport options the listener must be
suspended which means that new connections will be rejected until
the listener is resumed.
|
|
|
|
|
|
|
|
The NumAcceptors argument has been moved to transport option
num_acceptor, which defaults to 10. The functions now take
one less argument. The old functions are still here, though
deprecated.
|
|
Amended with small whitespace changes and removing an unused clause.
|
|
Provides detailed information about Ranch listeners
|
|
Ranch now depends on SSL. Users embedding listeners in
their supervision tree are expected to depend on SSL too
if they are using it.
|
|
|
|
|
|
Simplify some return values, improve error messages for
eaddrinuse and no_cert.
Amended to add tests and simpler code. Also hides the
contents of cert and key transport options, if any.
|
|
Dialyzer will still complain about unknown options, but at
least users won't be stuck waiting for an upstream update.
|
|
|
|
When SSL is stopped before Ranch, the acceptors crash and
Ranch tries to restart them. The problem is that the
ranch_ssl:listen/1 call was trying to start the SSL
application to make sure it works (an old artifact from
when releases were not ubiquitous). Because the application
controller is trying to shutdown Ranch, and Ranch tries to
tell it to start an application, everything would get stuck.
To avoid a breaking change, we move this in the start_listener
call (or child_spec). Note that there are still logs when the
SSL application is closed, because the acceptors crash. But
at least we don't block node shutdown anymore.
In Ranch 2.0, we will implement the proper fix which is to
simply depend on the SSL application normally. Nowadays, it's
not too difficult to build a release that excludes applications
we don't want, although we should document that in the Ranch
user guide.
|
|
|
|
|
|
For example 'binary' was making things crash.
|
|
|
|
We are now up to date with regard to transport options we should
accept for the listening socket. Documentation of existing options
has been updated with regard to recent changes in the OTP docs
and type specifications.
|
|
Should fix Dialyzer issues. The options are now also
documented in the Ranch module, and there's new ranch:opt(),
ranch_tcp:opt() and ranch_ssl:opt() for use in third party
code.
|
|
|
|
|
|
Order of options in listen is undocumented but significant. Now user option will
replace default value if user set it.
|
|
All of it can be found in the manual, which defines what the
code must do, and is always up to date unlike the code comments.
|
|
Implements the `shutdown` option as documented previously.
|
|
Doing this in the connection process allows us to free acceptors
to start accepting more connections quicker, especially under load.
|
|
|
|
|
|
|
|
We just don't need this process anymore. Less, simpler code!
API changes:
* Protocols start_link first argument is now Ref instead of ListenerPid
* ranch:accept_ack/1 argument is now Ref instead of ListenerPid
* ranch_listener:remove_connection/1 becomes ranch:remove_connection/1
and its argument is now Ref instead of ListenerPid
Ref is the name of the listener given as first argument to start_listener/6.
|
|
This patch lets the user set and use raw socket options as described in
inet:setopts/2 documentation.
The raw options can be useful to use TCP features that are platform-
specific and not supported in inet in general, such as TCP_DEFER_ACCEPT
or TCP_LINGER2 in linux stacks, for example.
|
|
It is non_neg_integer() | infinity. Introduce the type
`ranch:max_conns/0` for easier manipulation.
|
|
|
|
Tests were constantly failing without this patch. It seems ct
starts erlang code server in interactive mode, so application
module loading is defered.
|
|
|
|
|
|
At the same time we make the 'port' option optional, defaulting to 0.
|
|
|
|
ranch:get_port/1 returns the given listener's port.
|
|
Also use one export per line to improve future diffs.
Bump the version to 0.2.1 to reflect this change.
|
|
Modules were renamed. The 'cowboy_' prefix became 'ranch_'.
At the same time, ranch_ssl_transport became ranch_ssl,
and ranch_tcp_transport became ranch_tcp, because appending
'_transport' felt a bit redundant considering SSL and TCP
clearly are transports.
One test has been added to make sure everything is working.
|