tproxy: use continue instead of return

This commit is contained in:
nadoo 2017-09-16 23:10:10 +08:00
parent 4b0388a47d
commit 54e3f2ac6b
2 changed files with 4 additions and 4 deletions

View File

@ -167,7 +167,7 @@ Examples:
-listen on :1080 as socks5 server, forward requests via server1 and server2 in roundrbin mode.
```
## Advance Usage
## Advanced Usage
- [ConfigFile](config)
- [glider.conf.example](config/glider.conf.example)
- [office.rule.example](config/rules.d/office.rule.example)

View File

@ -77,16 +77,16 @@ func (s *TProxy) ListenAndServeUDP() {
}
for {
buf := make([]byte, 1024)
_, srcAddr, dstAddr, err := ReadFromUDP(lc, buf)
if err != nil {
if netErr, ok := err.(net.Error); ok && netErr.Temporary() {
logf("proxy-tproxy Temporary error while reading data: %s", netErr)
logf("proxy-tproxy temporary reading data error: %s", netErr)
continue
}
logf("proxy-tproxy Unrecoverable error while reading data: %s", err)
return
continue
}
logf("proxy-tproxy Accepting UDP connection from %s with destination of %s", srcAddr.String(), dstAddr.String())