From a7dd09213680afc8b71ea2a5be4e0085579c9bf4 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Fri, 29 Jun 2018 10:43:08 -0700 Subject: [PATCH] Add in proto to INFO Signed-off-by: Derek Collison --- server/const.go | 8 +++++++- server/server.go | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/server/const.go b/server/const.go index bb4a3012..05cd6da8 100644 --- a/server/const.go +++ b/server/const.go @@ -35,7 +35,13 @@ var ( const ( // VERSION is the current version for the server. - VERSION = "1.2.0-beta3" + VERSION = "1.2.0-beta4" + + // PROTO is the currently supported protocol. + // 0 was the original + // 1 maintains proto 0, adds echo abilities for CONNECT from the client. Clients + // should not send echo unless proto in INFO is >= 1. + PROTO = 1 // DEFAULT_PORT is the default port for client connections. DEFAULT_PORT = 4222 diff --git a/server/server.go b/server/server.go index 10fa85fd..35e0e373 100644 --- a/server/server.go +++ b/server/server.go @@ -41,6 +41,7 @@ import ( type Info struct { ID string `json:"server_id"` Version string `json:"version"` + Proto int `json:"proto"` GitCommit string `json:"git_commit,omitempty"` GoVersion string `json:"go"` Host string `json:"host"` @@ -144,6 +145,7 @@ func New(opts *Options) *Server { info := Info{ ID: genID(), Version: VERSION, + Proto: PROTO, GitCommit: gitCommit, GoVersion: runtime.Version(), Host: opts.Host,