Commit 2161daec authored by alexstocks's avatar alexstocks

add error log of magic in client:utils.go

parent 9af9db2f
...@@ -17,6 +17,10 @@ import ( ...@@ -17,6 +17,10 @@ import (
"unsafe" "unsafe"
) )
import (
log "github.com/AlexStocks/log4go"
)
//////////////////////////////////////////// ////////////////////////////////////////////
// echo command // echo command
//////////////////////////////////////////// ////////////////////////////////////////////
...@@ -122,6 +126,7 @@ func (this *EchoPackage) Unmarshal(buf *bytes.Buffer) (int, error) { ...@@ -122,6 +126,7 @@ func (this *EchoPackage) Unmarshal(buf *bytes.Buffer) (int, error) {
return 0, err return 0, err
} }
if this.H.Magic != echoPkgMagic { if this.H.Magic != echoPkgMagic {
log.Error("@this.H.Magic{%x}, right magic{%x}", this.H.Magic, echoPkgMagic)
return 0, ErrIllegalMagic return 0, ErrIllegalMagic
} }
if buf.Len() < (int)(this.H.Len) { if buf.Len() < (int)(this.H.Len) {
......
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