Commit e1becc33 authored by alexstocks's avatar alexstocks

add 'errFlag = true' when got err in pkgHandler.Read loop clause in...

add 'errFlag = true' when got err in pkgHandler.Read loop clause in session.go:(Session)handlePackage
parent 10a4efd0
......@@ -21,6 +21,7 @@ type SessionCallback func(*Session) error
// Reader is used to unmarshal a complete pkg from buffer
type Reader interface {
// Parse pkg from buffer and if possible return a complete pkg
// If length of buf is not long enough, u should return {nil, nil}
Read(*Session, *bytes.Buffer) (interface{}, error)
}
......
......@@ -494,6 +494,7 @@ func (this *Session) handlePackage() {
pkg, err = this.pkgHandler.Read(this, pktBuf)
if err != nil {
log.Info("%s, [session.pkgHandler.Read] = error{%+v}", this.sessionToken(), err)
errFlag = true
exit = true
break
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment