mirror of https://github.com/cbeuw/Cloak
Detect TCP connection issues immediately rather than waiting for tokens
This commit is contained in:
parent
ba7f29d9e6
commit
8317f447d1
|
|
@ -134,13 +134,13 @@ func (sb *switchboard) deplex(ce *connEnclave) {
|
||||||
buf := make([]byte, 20480)
|
buf := make([]byte, 20480)
|
||||||
for {
|
for {
|
||||||
n, err := sb.session.obfsedRead(ce.remoteConn, buf)
|
n, err := sb.session.obfsedRead(ce.remoteConn, buf)
|
||||||
sb.rxWait(n)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
//log.Println(err)
|
//log.Println(err)
|
||||||
go ce.remoteConn.Close()
|
go ce.remoteConn.Close()
|
||||||
sb.removeConn(ce)
|
sb.removeConn(ce)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
sb.rxWait(n)
|
||||||
if sb.AddRxCredit(-int64(n)) < 0 {
|
if sb.AddRxCredit(-int64(n)) < 0 {
|
||||||
log.Println(ErrNoRxCredit)
|
log.Println(ErrNoRxCredit)
|
||||||
sb.session.Close()
|
sb.session.Close()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue