Version Fixups
This commit is contained in:
parent
a088e588b1
commit
ec6e025284
|
@ -48,7 +48,7 @@ func (pa *PeerApp) NewInstance() tapir.Application {
|
|||
newApp.OnAuth = pa.OnAuth
|
||||
newApp.OnClose = pa.OnClose
|
||||
newApp.OnConnecting = pa.OnConnecting
|
||||
newApp.version.Store(0x01)
|
||||
newApp.version.Store(Version1)
|
||||
return newApp
|
||||
}
|
||||
|
||||
|
@ -72,12 +72,13 @@ func (pa *PeerApp) Init(connection tapir.Connection) {
|
|||
// we are abusing the context here slightly by sending a "malformed" GetVal request.
|
||||
// as a rule cwtch ignores getval requests that it cannot deserialize so older clients will ignore this
|
||||
// message.
|
||||
// version *must* be the first message sent to prevent race conditions for aut events fired on auth
|
||||
// we send the message before we update the rest of the system
|
||||
// version *must* be the first message sent to prevent race conditions for other events fired after-auth
|
||||
// (e.g. getVal requests)
|
||||
// as such, we send this message before we update the rest of the system
|
||||
pa.SendMessage(model2.PeerMessage{
|
||||
ID: event.ContextVersion,
|
||||
Context: event.ContextGetVal,
|
||||
Data: []byte{Version1},
|
||||
Data: []byte{Version2},
|
||||
})
|
||||
|
||||
pa.OnAuth(connection.Hostname())
|
||||
|
|
Loading…
Reference in New Issue