1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-28 14:56:33 -04:00

handle error properly

This commit is contained in:
Darien Raymond 2017-04-16 13:24:02 +02:00
parent d6988f1a63
commit e064ce65c8
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 7 additions and 3 deletions

View File

@ -4,6 +4,7 @@ package mux
import (
"context"
"io"
"sync"
"time"
@ -12,6 +13,7 @@ import (
"v2ray.com/core/app/log"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/net"
"v2ray.com/core/common/signal"
"v2ray.com/core/proxy"
@ -239,7 +241,9 @@ func (m *Client) fetchOutput() {
for {
meta, err := reader.ReadMetadata()
if err != nil {
log.Trace(newError("failed to read metadata").Base(err))
if errors.Cause(err) != io.EOF {
log.Trace(newError("failed to read metadata").Base(err))
}
break
}

View File

@ -97,8 +97,8 @@ func (m *SessionManager) Close() {
m.closed = true
for _, s := range m.sessions {
s.input.CloseError()
s.output.CloseError()
s.input.Close()
s.output.Close()
}
m.sessions = make(map[uint16]*Session)