Skip to content

Commit

Permalink
Define Conn Read/Write as method on pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed Oct 7, 2013
1 parent 808754a commit 6d5b35b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shadowsocks/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func Dial(addr, server string, cipher *Cipher) (c *Conn, err error) {
return DialWithRawAddr(ra, server, cipher)
}

func (c Conn) Read(b []byte) (n int, err error) {
func (c *Conn) Read(b []byte) (n int, err error) {
if c.dec == nil {
iv := make([]byte, c.info.ivLen)
if _, err = io.ReadFull(c.Conn, iv); err != nil {
Expand All @@ -83,7 +83,7 @@ func (c Conn) Read(b []byte) (n int, err error) {
return
}

func (c Conn) Write(b []byte) (n int, err error) {
func (c *Conn) Write(b []byte) (n int, err error) {
var cipherData []byte
dataStart := 0
if c.enc == nil {
Expand Down

0 comments on commit 6d5b35b

Please sign in to comment.