Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

Commit 78809dd

Browse files
committed
Merge branch 'develop'
2 parents 189db43 + 2c1c359 commit 78809dd

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ install:
88
- go install ./cmd/shadowsocks-server
99
- popd
1010
script:
11-
- pushd $GOPATH/src/github.com/shadowsocks/shadowsocks-go
12-
- PATH=$PATH:$GOPATH/bin/ bash -x ./script/test.sh
11+
- pushd $TRAVIS_BUILD_DIR
12+
- PATH=$PATH:$HOME/gopath/bin bash -x ./script/test.sh
1313
- popd

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The protocol is compatible with the origin shadowsocks (if both have been upgrad
88

99
**Note `server_password` option syntax changed in 0.6.2, the client now connects to servers in the order specified in the config.**
1010

11+
**Please develop on the latest develop branch if you want to send pull request.**
12+
1113
# Install
1214

1315
Compiled client binaries can be download [here](http://dl.chenyufei.info/shadowsocks/). (All compiled with cgo disabled, except the mac version.)

shadowsocks/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ func UpdateConfig(old, new *Config) {
108108
// log.Printf("%d: %s %s = %v\n", i,
109109
// typeOfT.Field(i).Name, newField.Type(), newField.Interface())
110110
switch newField.Kind() {
111+
case reflect.Interface:
112+
if fmt.Sprintf("%v", newField.Interface()) != "" {
113+
oldField.Set(newField)
114+
}
111115
case reflect.String:
112116
s := newField.String()
113117
if s != "" {

shadowsocks/encrypt.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ func newRC4Cipher(key []byte) (enc, dec cipher.Stream, err error) {
8989
return rc4Enc, &rc4Dec, nil
9090
}
9191

92-
type cipherInfo struct {
93-
keyLen int
94-
ivLen int
95-
newBlock func([]byte) (cipher.Block, error)
96-
}
97-
9892
// Ciphers from go.crypto has NewCipher returning specific type of cipher
9993
// instead of cipher.Block, so we need to have the following adapter
10094
// functions.
@@ -109,7 +103,13 @@ func newCast5Cipher(key []byte) (cipher.Block, error) {
109103
return cast5.NewCipher(key)
110104
}
111105

112-
var cipherMethod = map[string]cipherInfo{
106+
type cipherInfo struct {
107+
keyLen int
108+
ivLen int
109+
newBlock func([]byte) (cipher.Block, error)
110+
}
111+
112+
var cipherMethod = map[string]*cipherInfo{
113113
"aes-128-cfb": {16, 16, aes.NewCipher},
114114
"aes-192-cfb": {24, 16, aes.NewCipher},
115115
"aes-256-cfb": {32, 16, aes.NewCipher},
@@ -149,7 +149,7 @@ func NewCipher(method, password string) (c *Cipher, err error) {
149149

150150
key := evpBytesToKey(password, mi.keyLen)
151151

152-
c = &Cipher{key: key, info: &mi}
152+
c = &Cipher{key: key, info: mi}
153153

154154
if mi.newBlock == nil {
155155
if method == "" {

0 commit comments

Comments
 (0)