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.OnAuth = pa.OnAuth
|
||||||
newApp.OnClose = pa.OnClose
|
newApp.OnClose = pa.OnClose
|
||||||
newApp.OnConnecting = pa.OnConnecting
|
newApp.OnConnecting = pa.OnConnecting
|
||||||
newApp.version.Store(0x01)
|
newApp.version.Store(Version1)
|
||||||
return newApp
|
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.
|
// 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
|
// as a rule cwtch ignores getval requests that it cannot deserialize so older clients will ignore this
|
||||||
// message.
|
// message.
|
||||||
// version *must* be the first message sent to prevent race conditions for aut events fired on auth
|
// version *must* be the first message sent to prevent race conditions for other events fired after-auth
|
||||||
// we send the message before we update the rest of the system
|
// (e.g. getVal requests)
|
||||||
|
// as such, we send this message before we update the rest of the system
|
||||||
pa.SendMessage(model2.PeerMessage{
|
pa.SendMessage(model2.PeerMessage{
|
||||||
ID: event.ContextVersion,
|
ID: event.ContextVersion,
|
||||||
Context: event.ContextGetVal,
|
Context: event.ContextGetVal,
|
||||||
Data: []byte{Version1},
|
Data: []byte{Version2},
|
||||||
})
|
})
|
||||||
|
|
||||||
pa.OnAuth(connection.Hostname())
|
pa.OnAuth(connection.Hostname())
|
||||||
|
|
Loading…
Reference in New Issue