diff --git a/.travis.yml b/.travis.yml index 89d0689a..f07fc39f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,6 @@ install: - go install ./cmd/shadowsocks-server - popd script: - - pushd $GOPATH/src/github.com/shadowsocks/shadowsocks-go - - PATH=$PATH:$GOPATH/bin/ bash -x ./script/test.sh + - pushd $TRAVIS_BUILD_DIR + - PATH=$PATH:$HOME/gopath/bin bash -x ./script/test.sh - popd diff --git a/README.md b/README.md index caa80583..ee24116c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ The protocol is compatible with the origin shadowsocks (if both have been upgrad **Note `server_password` option syntax changed in 0.6.2, the client now connects to servers in the order specified in the config.** +**Please develop on the latest develop branch if you want to send pull request.** + # Install Compiled client binaries can be download [here](http://dl.chenyufei.info/shadowsocks/). (All compiled with cgo disabled, except the mac version.) diff --git a/shadowsocks/config.go b/shadowsocks/config.go index 273c0f42..f96ff504 100644 --- a/shadowsocks/config.go +++ b/shadowsocks/config.go @@ -108,6 +108,10 @@ func UpdateConfig(old, new *Config) { // log.Printf("%d: %s %s = %v\n", i, // typeOfT.Field(i).Name, newField.Type(), newField.Interface()) switch newField.Kind() { + case reflect.Interface: + if fmt.Sprintf("%v", newField.Interface()) != "" { + oldField.Set(newField) + } case reflect.String: s := newField.String() if s != "" { diff --git a/shadowsocks/encrypt.go b/shadowsocks/encrypt.go index 16261074..4294e38a 100644 --- a/shadowsocks/encrypt.go +++ b/shadowsocks/encrypt.go @@ -89,12 +89,6 @@ func newRC4Cipher(key []byte) (enc, dec cipher.Stream, err error) { return rc4Enc, &rc4Dec, nil } -type cipherInfo struct { - keyLen int - ivLen int - newBlock func([]byte) (cipher.Block, error) -} - // Ciphers from go.crypto has NewCipher returning specific type of cipher // instead of cipher.Block, so we need to have the following adapter // functions. @@ -109,7 +103,13 @@ func newCast5Cipher(key []byte) (cipher.Block, error) { return cast5.NewCipher(key) } -var cipherMethod = map[string]cipherInfo{ +type cipherInfo struct { + keyLen int + ivLen int + newBlock func([]byte) (cipher.Block, error) +} + +var cipherMethod = map[string]*cipherInfo{ "aes-128-cfb": {16, 16, aes.NewCipher}, "aes-192-cfb": {24, 16, aes.NewCipher}, "aes-256-cfb": {32, 16, aes.NewCipher}, @@ -149,7 +149,7 @@ func NewCipher(method, password string) (c *Cipher, err error) { key := evpBytesToKey(password, mi.keyLen) - c = &Cipher{key: key, info: &mi} + c = &Cipher{key: key, info: mi} if mi.newBlock == nil { if method == "" {