fix negative result in auth
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
parent
88b99c68a5
commit
5ad25a5873
@ -212,10 +212,14 @@ func (*DefaultServerSecurityHandler) Handle(c Conn) error {
|
|||||||
if err := binary.Write(c, binary.BigEndian, authCode); err != nil {
|
if err := binary.Write(c, binary.BigEndian, authCode); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if authErr == nil {
|
||||||
if err := c.Flush(); err != nil {
|
if err := c.Flush(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if authErr != nil {
|
c.SetSecurityHandler(sType)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if err := binary.Write(c, binary.BigEndian, uint32(len(authErr.Error()))); err != nil {
|
if err := binary.Write(c, binary.BigEndian, uint32(len(authErr.Error()))); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -227,9 +231,6 @@ func (*DefaultServerSecurityHandler) Handle(c Conn) error {
|
|||||||
}
|
}
|
||||||
return authErr
|
return authErr
|
||||||
}
|
}
|
||||||
c.SetSecurityHandler(sType)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DefaultClientServerInitHandler default client server init handler
|
// DefaultClientServerInitHandler default client server init handler
|
||||||
type DefaultClientServerInitHandler struct{}
|
type DefaultClientServerInitHandler struct{}
|
||||||
|
Loading…
Reference in New Issue
Block a user