mirror of
https://gogs.blitter.com/RLabs/xs
synced 2024-08-14 10:26:42 +00:00
Fix for ConnDead status
This commit is contained in:
parent
9244cc9785
commit
908a1bcda2
4 changed files with 18 additions and 12 deletions
|
@ -1339,7 +1339,8 @@ func (hc *Conn) Read(b []byte) (n int, err error) {
|
|||
// Throw away pkt if it's chaff (ie., caller to Read() won't see this data)
|
||||
log.Printf("[Chaff pkt, discarded (len %d)]\n", decryptN)
|
||||
case CSOKeepAlive:
|
||||
logger.LogDebug(fmt.Sprintf("[got keepAlive pkt, discarded (len %d)]\n", decryptN))
|
||||
//logger.LogDebug(fmt.Sprintf("[got keepAlive pkt, discarded (len %d)]\n", decryptN))
|
||||
// payload of keepalive (2 bytes) is not currently used (0x55aa fixed)
|
||||
_ = binary.BigEndian.Uint16(payloadBytes[0:2])
|
||||
hc.ResetKeepAlive()
|
||||
case CSOTermSize:
|
||||
|
@ -1625,7 +1626,6 @@ func (hc *Conn) StartupKeepAlive() {
|
|||
|
||||
func (hc *Conn) ShutdownKeepAlive() {
|
||||
log.Println("Conn SHUTDOWN")
|
||||
hc.SetStatus(CSEConnDead)
|
||||
hc.Close()
|
||||
}
|
||||
|
||||
|
@ -1655,6 +1655,7 @@ func (hc *Conn) keepaliveHelper() {
|
|||
|
||||
if hc.keepalive == 0 {
|
||||
logger.LogDebug(fmt.Sprintf("*** keepaliveHelper shutting down\n"))
|
||||
hc.SetStatus(CSEConnDead)
|
||||
hc.ShutdownKeepAlive()
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue