mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-20 06:10:00 -08:00
Remove unneded else statements to follow Golang coding standards
This commit is contained in:
parent
6bf58a9f58
commit
c2b5fd9e9d
2 changed files with 14 additions and 16 deletions
|
|
@ -492,18 +492,17 @@ func (server *Server) handleAuthenticate(client *Client, msg *Message) {
|
||||||
if auth.Password == nil {
|
if auth.Password == nil {
|
||||||
client.RejectAuth(mumbleproto.Reject_WrongUserPW, "")
|
client.RejectAuth(mumbleproto.Reject_WrongUserPW, "")
|
||||||
return
|
return
|
||||||
} else {
|
}
|
||||||
if server.CheckSuperUserPassword(*auth.Password) {
|
if server.CheckSuperUserPassword(*auth.Password) {
|
||||||
ok := false
|
ok := false
|
||||||
client.user, ok = server.UserNameMap[client.Username]
|
client.user, ok = server.UserNameMap[client.Username]
|
||||||
if !ok {
|
if !ok {
|
||||||
client.RejectAuth(mumbleproto.Reject_InvalidUsername, "")
|
client.RejectAuth(mumbleproto.Reject_InvalidUsername, "")
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
client.RejectAuth(mumbleproto.Reject_WrongUserPW, "")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
client.RejectAuth(mumbleproto.Reject_WrongUserPW, "")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// First look up registration by name.
|
// First look up registration by name.
|
||||||
|
|
@ -1037,9 +1036,8 @@ func (server *Server) handleUDPPacket(udpaddr *net.UDPAddr, buf []byte) {
|
||||||
client.Debugf("unable to decrypt incoming packet, requesting resync: %v", err)
|
client.Debugf("unable to decrypt incoming packet, requesting resync: %v", err)
|
||||||
client.cryptResync()
|
client.cryptResync()
|
||||||
return
|
return
|
||||||
} else {
|
|
||||||
match = client
|
|
||||||
}
|
}
|
||||||
|
match = client
|
||||||
}
|
}
|
||||||
if match != nil {
|
if match != nil {
|
||||||
match.udpaddr = udpaddr
|
match.udpaddr = udpaddr
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,9 @@ func (pds *PacketData) next() (ret uint64) {
|
||||||
ret = uint64(pds.Buf[pds.offset])
|
ret = uint64(pds.Buf[pds.offset])
|
||||||
pds.offset++
|
pds.offset++
|
||||||
return
|
return
|
||||||
} else {
|
|
||||||
pds.ok = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pds.ok = false
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,9 +71,9 @@ func (pds *PacketData) Next8() (ret uint8) {
|
||||||
ret = uint8(pds.Buf[pds.offset])
|
ret = uint8(pds.Buf[pds.offset])
|
||||||
pds.offset++
|
pds.offset++
|
||||||
return
|
return
|
||||||
} else {
|
|
||||||
pds.ok = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pds.ok = false
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue