This commit is contained in:
Tim Cooper 2016-03-25 22:05:23 -03:00
parent 083163daf9
commit 20eba760e5
15 changed files with 163 additions and 163 deletions

View file

@ -330,7 +330,7 @@ func (client *Client) udpRecvLoop() {
case mumbleproto.UDPMessageVoiceCELTAlpha:
fallthrough
case mumbleproto.UDPMessageVoiceCELTBeta:
if (client.server.Opus) {
if client.server.Opus {
return
}
fallthrough

View file

@ -6,8 +6,8 @@ package main
import (
"github.com/golang/protobuf/proto"
"mumble.info/grumble/pkg/replacefile"
"io/ioutil"
"mumble.info/grumble/pkg/replacefile"
"path/filepath"
"strconv"
)

View file

@ -676,12 +676,12 @@ func (server *Server) finishAuthenticate(client *Client) {
func (server *Server) updateCodecVersions(connecting *Client) {
codecusers := map[int32]int{}
var (
winner int32
count int
users int
opus int
winner int32
count int
users int
opus int
enableOpus bool
txtMsg *mumbleproto.TextMessage = &mumbleproto.TextMessage{
txtMsg *mumbleproto.TextMessage = &mumbleproto.TextMessage{
Message: proto.String("<strong>WARNING:</strong> Your client doesn't support the Opus codec the server is switching to, you won't be able to talk or hear anyone. Please upgrade to a client with Opus support."),
}
)

View file

@ -46,7 +46,7 @@ func (perm Permission) IsCached() bool {
// Clean returns a Permission that has its cache bit cleared.
func (perm Permission) Clean() Permission {
return perm ^Permission(CachedPermission)
return perm ^ Permission(CachedPermission)
}
// An ACL as defined in an ACL context.
@ -88,7 +88,7 @@ func (acl *ACL) IsChannelACL() bool {
// The permission perm must be a single permission and not a combination of permissions.
func HasPermission(ctx *Context, user User, perm Permission) bool {
// We can't check permissions on a nil ctx.
if (ctx == nil) {
if ctx == nil {
panic("acl: HasPermission got nil context")
}

View file

@ -10,18 +10,18 @@ package acl
type Context struct {
// Parent points to the context's parent.
// May be nil if the Context does not have a parent.
Parent *Context
Parent *Context
// ACLs is the Context's list of ACL entries.
ACLs []ACL
ACLs []ACL
// Groups is the Context's representation of groups.
// It is indexed by the Group's name.
Groups map[string]Group
Groups map[string]Group
// InheritACL determines whether this context should
// inherit ACLs from its parent.
InheritACL bool
InheritACL bool
}
// indexOf finds the index of the context ctx in the context chain contexts.

View file

@ -61,10 +61,10 @@ func newBlobReader(rc io.ReadCloser, key string) (*blobReader, error) {
// mismatch.
func (r *blobReader) Read(b []byte) (int, error) {
n, err := r.rc.Read(b)
_, werr := r.hash.Write(b[:n])
if werr != nil {
return 0, werr
}
_, werr := r.hash.Write(b[:n])
if werr != nil {
return 0, werr
}
if err != io.EOF {
return n, err
}

View file

@ -12,16 +12,16 @@ import (
)
type blobReaderTest struct {
Key string
ExpectedSum string
Data string
Key string
ExpectedSum string
Data string
}
var blobReaderTests = []blobReaderTest{
{
Key: "a3da7877f94ad4cf58636a395fff77537cb8b919",
ExpectedSum: "a3da7877f94ad4cf58636a395fff77537cb8b919",
Data: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
Key: "a3da7877f94ad4cf58636a395fff77537cb8b919",
ExpectedSum: "a3da7877f94ad4cf58636a395fff77537cb8b919",
Data: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
},
}

View file

@ -20,7 +20,7 @@ var (
ErrNoSuchKey = errors.New("blobstore: no such key")
// ErrBadKey signals that the given key is not well formed.
ErrBadKey = errors.New("blobstore: bad key")
ErrBadKey = errors.New("blobstore: bad key")
)
// BlobStore represents a simple disk-persisted content addressible

View file

@ -7,8 +7,8 @@ package cryptstate
import (
"bytes"
"crypto/aes"
"testing"
"encoding/hex"
"testing"
)
func TestOCB2AES128Encrypt(t *testing.T) {
@ -88,9 +88,9 @@ func TestOCB2AES128Decrypt(t *testing.T) {
func TestXSalsa20Poly1305Encrypt(t *testing.T) {
cs := CryptState{}
var key[32]byte
var eiv[24]byte
var div[24]byte
var key [32]byte
var eiv [24]byte
var div [24]byte
var message [64]byte
for i := range key[:] {
@ -125,9 +125,9 @@ func TestXSalsa20Poly1305Encrypt(t *testing.T) {
func TestXSalsa20Poly1305Decrypt(t *testing.T) {
cs := CryptState{}
var key[32]byte
var eiv[24]byte
var div[24]byte
var key [32]byte
var eiv [24]byte
var div [24]byte
var expected [64]byte
for i := range key[:] {

View file

@ -5,7 +5,7 @@
package cryptstate
// nullMode implements the NULL CryptoMode
type nullMode struct {}
type nullMode struct{}
// NonceSize returns the nonce size to be used with NULL.
func (n *nullMode) NonceSize() int {

View file

@ -5,8 +5,8 @@
package cryptstate
import (
"unsafe"
"golang.org/x/crypto/nacl/secretbox"
"unsafe"
)
// secretBoxMode implements the XSalsa20-Poly1305 CryptoMode

View file

@ -5,27 +5,27 @@
package replacefile
import (
"unsafe"
"syscall"
"unsafe"
)
var (
modkernel32 = syscall.NewLazyDLL("kernel32.dll")
procReplaceFileW = modkernel32.NewProc("ReplaceFileW")
modkernel32 = syscall.NewLazyDLL("kernel32.dll")
procReplaceFileW = modkernel32.NewProc("ReplaceFileW")
)
// Define the syscall.Errno backed-errors here in order to get a cleaner
// godoc output.
var (
win32_ERROR_UNABLE_TO_MOVE_REPLACEMENT = syscall.Errno(0x498)
win32_ERROR_UNABLE_TO_MOVE_REPLACEMENT = syscall.Errno(0x498)
win32_ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 = syscall.Errno(0x499)
win32_ERROR_UNABLE_TO_REMOVE_REPLACED = syscall.Errno(0x497)
win32_ERROR_UNABLE_TO_REMOVE_REPLACED = syscall.Errno(0x497)
)
var (
ErrUnableToMoveReplacement error = win32_ERROR_UNABLE_TO_MOVE_REPLACEMENT
ErrUnableToMoveReplacement error = win32_ERROR_UNABLE_TO_MOVE_REPLACEMENT
ErrUnableToMoveReplacement2 error = win32_ERROR_UNABLE_TO_MOVE_REPLACEMENT_2
ErrUnableToRemoveReplaced error = win32_ERROR_UNABLE_TO_REMOVE_REPLACED
ErrUnableToRemoveReplaced error = win32_ERROR_UNABLE_TO_REMOVE_REPLACED
)
func replaceFileW(replaced *uint16, replacement *uint16, backup *uint16, flags uint32) (err error) {