mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
Fixed comment typos and some rewording
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -1228,10 +1228,11 @@ func (c *client) readLoop(pre []byte) {
|
||||
for i := 0; i < len(bufs); i++ {
|
||||
if err := c.parse(bufs[i]); err != nil {
|
||||
if err == ErrMinimumVersionRequired {
|
||||
// Special case here, currently onle for leaf node connections.
|
||||
// When processing the connect, an error was printed and sent
|
||||
// back to the remote, but the connection is closed after a
|
||||
// certain delay (to avoid "rapid" remote reconnection).
|
||||
// Special case here, currently only for leaf node connections.
|
||||
// When process the CONNECT protocol, if the minimum version
|
||||
// required was not met, an error was printed and sent back to
|
||||
// the remote, and connection was closed after a certain delay
|
||||
// (to avoid "rapid" reconnection from the remote).
|
||||
// We don't need to do any of the things below, simply return.
|
||||
return
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ const leafNodeLoopDetectionSubjectPrefix = "$LDS."
|
||||
const leafNodeWSPath = "/leafnode"
|
||||
|
||||
// This is the time the server will wait, when receiving a CONNECT,
|
||||
// before closing the connection is the required minimum version is not met.
|
||||
// before closing the connection if the required minimum version is not met.
|
||||
const leafNodeWaitBeforeClose = 5 * time.Second
|
||||
|
||||
type leaf struct {
|
||||
@@ -1386,7 +1386,7 @@ func (c *client) processLeafNodeConnect(s *Server, arg []byte, lang string) erro
|
||||
if !versionAtLeast(proto.Version, major, minor, update) {
|
||||
// We are going to send back an INFO because otherwise recent
|
||||
// versions of the remote server would simply break the connection
|
||||
// after 2 seconds without receiving that. Instead, we want the
|
||||
// after 2 seconds if not receiving it. Instead, we want the
|
||||
// other side to just "stall" until we finish waiting for the holding
|
||||
// period and close the connection below.
|
||||
s.sendPermsAndAccountInfo(c)
|
||||
|
||||
@@ -143,9 +143,11 @@ type LeafNodeOpts struct {
|
||||
// For solicited connections to other clusters/superclusters.
|
||||
Remotes []*RemoteLeafOpts `json:"remotes,omitempty"`
|
||||
|
||||
// The accepting side can set a minimum version for connected server.
|
||||
// Note that since the server version in the CONNECT protocol is
|
||||
// added started in v2.8.0, any version below that is invalid.
|
||||
// This is the minimum version that is accepted for remote connections.
|
||||
// Note that since the server version in the CONNECT protocol was added
|
||||
// only starting at v2.8.0, any version below that would result in the
|
||||
// connection being rejected (since empty version string in CONNECT would
|
||||
// fail the "version at least" test).
|
||||
MinVersion string
|
||||
|
||||
// Not exported, for tests.
|
||||
|
||||
Reference in New Issue
Block a user