forked from External/grumble
Grumble gofmt run.
This commit is contained in:
parent
f8d511a8c3
commit
2e0a825bc0
4 changed files with 18 additions and 18 deletions
|
|
@ -176,7 +176,7 @@ func (client *Client) RejectAuth(kind, reason string) {
|
||||||
func (client *Client) readProtoMessage() (msg *Message, err os.Error) {
|
func (client *Client) readProtoMessage() (msg *Message, err os.Error) {
|
||||||
var (
|
var (
|
||||||
length uint32
|
length uint32
|
||||||
kind uint16
|
kind uint16
|
||||||
)
|
)
|
||||||
|
|
||||||
// Read the message type (16-bit big-endian unsigned integer)
|
// Read the message type (16-bit big-endian unsigned integer)
|
||||||
|
|
@ -522,8 +522,8 @@ func (client *Client) sendChannelList() {
|
||||||
|
|
||||||
func (client *Client) sendChannelTree(channel *Channel) {
|
func (client *Client) sendChannelTree(channel *Channel) {
|
||||||
chanstate := &mumbleproto.ChannelState{
|
chanstate := &mumbleproto.ChannelState{
|
||||||
ChannelId: proto.Uint32(uint32(channel.Id)),
|
ChannelId: proto.Uint32(uint32(channel.Id)),
|
||||||
Name: proto.String(channel.Name),
|
Name: proto.String(channel.Name),
|
||||||
}
|
}
|
||||||
if channel.parent != nil {
|
if channel.parent != nil {
|
||||||
chanstate.Parent = proto.Uint32(uint32(channel.parent.Id))
|
chanstate.Parent = proto.Uint32(uint32(channel.parent.Id))
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type frozenServer struct {
|
type frozenServer struct {
|
||||||
Id int "id"
|
Id int "id"
|
||||||
MaxUsers int "max_user"
|
MaxUsers int "max_user"
|
||||||
Channels []frozenChannel "channels"
|
Channels []frozenChannel "channels"
|
||||||
Users []frozenUser "users"
|
Users []frozenUser "users"
|
||||||
}
|
}
|
||||||
|
|
||||||
type frozenUser struct {
|
type frozenUser struct {
|
||||||
|
|
|
||||||
|
|
@ -953,7 +953,7 @@ func (server *Server) handleAclMessage(client *Client, msg *Message) {
|
||||||
reply.Groups = []*mumbleproto.ACL_ChanGroup{}
|
reply.Groups = []*mumbleproto.ACL_ChanGroup{}
|
||||||
for name, _ := range allnames {
|
for name, _ := range allnames {
|
||||||
var (
|
var (
|
||||||
group *Group
|
group *Group
|
||||||
pgroup *Group
|
pgroup *Group
|
||||||
)
|
)
|
||||||
group = channel.Groups[name]
|
group = channel.Groups[name]
|
||||||
|
|
@ -1242,7 +1242,7 @@ func (server *Server) handleUserList(client *Client, msg *Message) {
|
||||||
client.Panic(err.String())
|
client.Panic(err.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Rename, registration removal
|
// Rename, registration removal
|
||||||
} else {
|
} else {
|
||||||
for _, listUser := range userlist.Users {
|
for _, listUser := range userlist.Users {
|
||||||
uid := *listUser.UserId
|
uid := *listUser.UserId
|
||||||
|
|
@ -1252,7 +1252,7 @@ func (server *Server) handleUserList(client *Client, msg *Message) {
|
||||||
// De-register a user
|
// De-register a user
|
||||||
if listUser.Name == nil {
|
if listUser.Name == nil {
|
||||||
server.RemoveRegistration(uid)
|
server.RemoveRegistration(uid)
|
||||||
// Rename user
|
// Rename user
|
||||||
} else {
|
} else {
|
||||||
// todo(mkrautz): Validate name.
|
// todo(mkrautz): Validate name.
|
||||||
user, ok := server.Users[uid]
|
user, ok := server.Users[uid]
|
||||||
|
|
|
||||||
16
server.go
16
server.go
|
|
@ -83,18 +83,18 @@ type Server struct {
|
||||||
Channels map[int]*Channel
|
Channels map[int]*Channel
|
||||||
|
|
||||||
// Users
|
// Users
|
||||||
Users map[uint32]*User
|
Users map[uint32]*User
|
||||||
UserCertMap map[string]*User
|
UserCertMap map[string]*User
|
||||||
UserNameMap map[string]*User
|
UserNameMap map[string]*User
|
||||||
nextUserId uint32
|
nextUserId uint32
|
||||||
|
|
||||||
// ACL cache
|
// ACL cache
|
||||||
aclcache ACLCache
|
aclcache ACLCache
|
||||||
}
|
}
|
||||||
|
|
||||||
type freezeRequest struct {
|
type freezeRequest struct {
|
||||||
done chan bool
|
done chan bool
|
||||||
readCloser io.ReadCloser
|
readCloser io.ReadCloser
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate a new Murmur instance
|
// Allocate a new Murmur instance
|
||||||
|
|
@ -992,13 +992,13 @@ func (s *Server) FreezeServer() io.ReadCloser {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("Unable to freeze the server")
|
log.Panicf("Unable to freeze the server")
|
||||||
}
|
}
|
||||||
fr := &freezeRequest{done:make(chan bool)}
|
fr := &freezeRequest{done: make(chan bool)}
|
||||||
go s.handleFreezeRequest(fr, &fs)
|
go s.handleFreezeRequest(fr, &fs)
|
||||||
<-fr.done
|
<-fr.done
|
||||||
return fr.readCloser
|
return fr.readCloser
|
||||||
}
|
}
|
||||||
|
|
||||||
fr := &freezeRequest{done:make(chan bool)}
|
fr := &freezeRequest{done: make(chan bool)}
|
||||||
s.freezeRequest <- fr
|
s.freezeRequest <- fr
|
||||||
<-fr.done
|
<-fr.done
|
||||||
return fr.readCloser
|
return fr.readCloser
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue