Detect TCP connection issues immediately rather than waiting for tokens

This commit is contained in:
Qian Wang 2019-06-18 22:21:13 +10:00
parent ba7f29d9e6
commit 8317f447d1
1 changed files with 1 additions and 1 deletions

View File

@ -134,13 +134,13 @@ func (sb *switchboard) deplex(ce *connEnclave) {
buf := make([]byte, 20480)
for {
n, err := sb.session.obfsedRead(ce.remoteConn, buf)
sb.rxWait(n)
if err != nil {
//log.Println(err)
go ce.remoteConn.Close()
sb.removeConn(ce)
return
}
sb.rxWait(n)
if sb.AddRxCredit(-int64(n)) < 0 {
log.Println(ErrNoRxCredit)
sb.session.Close()