Change log message if session was resumed.

This commit is contained in:
Joachim Bauch 2020-09-07 09:12:32 +02:00
parent 1e11eac284
commit 5206490fef
Failed to extract signature

View file

@ -626,6 +626,7 @@ func (c *mcuProxyConnection) processMessage(msg *ProxyServerMessage) {
log.Printf("Hello connection to %s failed with %+v, reconnecting", c.url, msg.Error)
c.scheduleReconnect()
case "hello":
resumed := c.sessionId == msg.Hello.SessionId
c.sessionId = msg.Hello.SessionId
country := ""
if msg.Hello.Server != nil {
@ -635,7 +636,9 @@ func (c *mcuProxyConnection) processMessage(msg *ProxyServerMessage) {
}
}
c.country.Store(country)
if country != "" {
if resumed {
log.Printf("Resumed session %s on %s", c.sessionId, c.url)
} else if country != "" {
log.Printf("Received session %s from %s (in %s)", c.sessionId, c.url, country)
} else {
log.Printf("Received session %s from %s", c.sessionId, c.url)