Skip to content

Commit

Permalink
add comment about server fallback
Browse files Browse the repository at this point in the history
Further explain the fallback behavior for the server in protocolVersion
  • Loading branch information
jbardin committed Aug 14, 2018
1 parent 1b93606 commit 2f6638f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ func protocolVersion(opts *ServeConfig) (int, Protocol, PluginSet) {
}
}

// Return the lowest version as the fallback.
// Since we iterated over all the versions in reverse order above, these
// values are from the lowest version number plugins (which may be from
// a combination of the Handshake.ProtocolVersion and ServeConfig.Plugins
// fields). This allows serving the oldest version of our plugins to a
// legacy client that did not send a PLUGIN_PROTOCOL_VERSIONS list.
return protoVersion, protoType, pluginSet
}

Expand Down

0 comments on commit 2f6638f

Please sign in to comment.