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