fix negative result in auth

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
Василий Толстов 2017-07-10 23:16:47 +03:00
parent 88b99c68a5
commit 5ad25a5873

View File

@ -212,10 +212,14 @@ func (*DefaultServerSecurityHandler) Handle(c Conn) error {
if err := binary.Write(c, binary.BigEndian, authCode); err != nil {
return err
}
if authErr == nil {
if err := c.Flush(); err != nil {
return err
}
if authErr != nil {
c.SetSecurityHandler(sType)
return nil
}
if err := binary.Write(c, binary.BigEndian, uint32(len(authErr.Error()))); err != nil {
return err
}
@ -227,9 +231,6 @@ func (*DefaultServerSecurityHandler) Handle(c Conn) error {
}
return authErr
}
c.SetSecurityHandler(sType)
return nil
}
// DefaultClientServerInitHandler default client server init handler
type DefaultClientServerInitHandler struct{}