mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-02 22:31:07 +08:00
优化代码
This commit is contained in:
@@ -89,6 +89,8 @@ func (this *ClientConn) Read(b []byte) (n int, err error) {
|
|||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.lastErr = errors.New("read error: " + err.Error())
|
this.lastErr = errors.New("read error: " + err.Error())
|
||||||
|
} else {
|
||||||
|
this.lastErr = nil
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
@@ -149,6 +151,8 @@ func (this *ClientConn) Write(b []byte) (n int, err error) {
|
|||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.lastErr = errors.New("write error: " + err.Error())
|
this.lastErr = errors.New("write error: " + err.Error())
|
||||||
|
} else {
|
||||||
|
this.lastErr = nil
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user