Move protocol version to a const
This commit is contained in:
parent
3baccaccac
commit
58a078b9f9
@ -183,7 +183,7 @@ func (c *Client) connectToServer(op secure.OperationTypeEnum, enc *gob.Encoder,
|
||||
startPacket := secure.PacketStartRequest{
|
||||
OperationType: op,
|
||||
ClientName: "",
|
||||
ProtocolVersion: "1.1",
|
||||
ProtocolVersion: ProtocolVersion,
|
||||
AuthToken: c.authToken,
|
||||
}
|
||||
err := enc.Encode(startPacket)
|
||||
|
2
main.go
2
main.go
@ -15,6 +15,8 @@ import (
|
||||
|
||||
var CurrentVersion = "v0.0.3"
|
||||
|
||||
const ProtocolVersion = "1.1"
|
||||
|
||||
type PasteValue struct {
|
||||
PasteRequired bool
|
||||
PasteNumber uint
|
||||
|
@ -105,10 +105,10 @@ func (s *Server) handleConnection(conn *net.TCPConn) {
|
||||
return
|
||||
}
|
||||
|
||||
// tell teh client the dealio
|
||||
// tell the client if the connection is ok.
|
||||
startResponse := secure.PacketStartResponse{}
|
||||
|
||||
if start.ProtocolVersion != "1.1" {
|
||||
if start.ProtocolVersion != ProtocolVersion {
|
||||
log.Errorf("bad protocol version")
|
||||
startResponse.Response = secure.PacketStartResponseEnumWrongProtocol
|
||||
enc.Encode(startResponse)
|
||||
|
Loading…
x
Reference in New Issue
Block a user