Fixed comment typos and some rewording

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2022-04-07 09:22:51 -06:00
parent 9e6f965913
commit 7fa2676353
3 changed files with 12 additions and 9 deletions

View File

@@ -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
}

View File

@@ -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)

View File

@@ -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.