稍微优化一下

This commit is contained in:
dmy@lab
2015-11-19 21:50:06 +08:00
parent 54cd925ab2
commit 6f8bda54e4
2 changed files with 5 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ func (this *Tunnel) run() { //单向的从src发送到dest
cipherDirection := this.cipherDirection
id := this.id
defer func() {
log.Info("tunnel id %s ends", id)
if r := recover(); r != nil {
if src != nil {
src.Close()
@@ -56,7 +57,6 @@ func (this *Tunnel) run() { //单向的从src发送到dest
if dest != nil {
dest.Close()
}
}
}()
cache := make([]byte, 1024*4) //4kB