debugging

This commit is contained in:
Russ Magee 2023-11-05 16:40:12 -08:00
parent a3d8543816
commit d0f8751b2b
1 changed files with 3 additions and 2 deletions

View File

@ -1338,7 +1338,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) // 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) log.Printf("[Chaff pkt, discarded (len %d)]\n", decryptN)
case CSOKeepAlive: case CSOKeepAlive:
//log.Printf("[KeepAlive pkt, discarded (len %d)]\n", decryptN) logger.LogDebug(fmt.Sprintf("[got keepAlive pkt, discarded (len %d)]\n", decryptN))
_ = binary.BigEndian.Uint16(payloadBytes[0:2])
hc.ResetKeepAlive() hc.ResetKeepAlive()
case CSOTermSize: case CSOTermSize:
fmt.Sscanf(string(payloadBytes), "%d %d", &hc.Rows, &hc.Cols) fmt.Sscanf(string(payloadBytes), "%d %d", &hc.Rows, &hc.Cols)
@ -1639,7 +1640,7 @@ func (hc *Conn) keepaliveHelper() {
nextDuration := 10000 nextDuration := 10000
bufTmp := []byte{0x55, 0xaa} bufTmp := []byte{0x55, 0xaa}
_, err := hc.WritePacket(bufTmp, CSOKeepAlive) _, err := hc.WritePacket(bufTmp, CSOKeepAlive)
//logger.LogDebug(fmt.Sprintf("[keepalive]\n")) logger.LogDebug(fmt.Sprintf("[keepalive]\n"))
if err != nil { if err != nil {
logger.LogDebug(fmt.Sprintf("[ *** error - keepaliveHelper quitting *** ]\n")) logger.LogDebug(fmt.Sprintf("[ *** error - keepaliveHelper quitting *** ]\n"))
break break