Commit 6f7a7e86 authored by alexstocks's avatar alexstocks

do not consider empty package as a error

parent bfb1ea63
...@@ -8,11 +8,15 @@ ...@@ -8,11 +8,15 @@
LICENCE : Apache License 2.0 LICENCE : Apache License 2.0
AUTHOR : https://github.com/sanbit AUTHOR : https://github.com/sanbit
MAINTAINER : Alex Stocks MAINTAINER : Alex Stocks
EMAIL : alexstocks@foxmail.com EMAIL : alexstocks@foxmail.com
## develop history ## ## develop history ##
--- ---
- 2016/08/23
> do not consider empty package as a error in (Session)handlePackage
> version: 0.2.04
- 2016/08/22 - 2016/08/22
> rename (Session)OnIdle to (Session)OnCron > rename (Session)OnIdle to (Session)OnCron
> rewrite server.go: add Server{done, wg} > rewrite server.go: add Server{done, wg}
...@@ -21,7 +25,7 @@ ...@@ -21,7 +25,7 @@
- 2016/08/21 - 2016/08/21
> add name for Session > add name for Session
> add OnError for Codec > add OnError for Codec
- 2016/08/18 - 2016/08/18
> delete last clause of handleRead > delete last clause of handleRead
......
...@@ -456,13 +456,15 @@ func (this *Session) handlePackage() { ...@@ -456,13 +456,15 @@ func (this *Session) handlePackage() {
break break
} }
pkg, err = this.pkgHandler.Read(this, pktBuf) pkg, err = this.pkgHandler.Read(this, pktBuf)
if err != nil || pkg == nil { if err != nil {
log.Info("%s:%d:%s [session.pkgHandler.Read] = pkg{%#v}, error{%+v}", log.Info("%s:%d:%s [session.pkgHandler.Read] = error{%+v}",
this.name, this.Id, this.conn.RemoteAddr().String(), pkg, err) this.name, this.Id, this.conn.RemoteAddr().String(), err)
exit = true exit = true
break break
} }
this.reqQ <- pkg if pkg != nil {
this.reqQ <- pkg
}
} }
if exit { if exit {
break 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