diff options
author | Adam Langley <agl@golang.org> | 2013-01-21 11:22:08 -0500 |
---|---|---|
committer | Adam Langley <agl@golang.org> | 2013-01-21 11:22:08 -0500 |
commit | 0e8485f3c04c3becaa168a0652711a4b1f2f7aa4 (patch) | |
tree | c1ee2dcc790f4d22f1880f5fd1f38e8a98ca8962 /src | |
parent | e619b64749ef1e4d3622b34b71a5ae56452a2539 (diff) | |
download | go-0e8485f3c04c3becaa168a0652711a4b1f2f7aa4.tar.gz |
crypto/cipher: don't persist errors in StreamWriter.
I messed this up from the beginning. The receiver isn't a pointer so
setting Err is useless. In order to maintain the API, just remove the
superfluous code.
Fixes issue 4657.
R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/7161043
Diffstat (limited to 'src')
-rw-r--r-- | src/pkg/crypto/cipher/io.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/pkg/crypto/cipher/io.go b/src/pkg/crypto/cipher/io.go index 76048fbf3..807e8daea 100644 --- a/src/pkg/crypto/cipher/io.go +++ b/src/pkg/crypto/cipher/io.go @@ -28,13 +28,10 @@ func (r StreamReader) Read(dst []byte) (n int, err error) { type StreamWriter struct { S Stream W io.Writer - Err error + Err error // unused } func (w StreamWriter) Write(src []byte) (n int, err error) { - if w.Err != nil { - return 0, w.Err - } c := make([]byte, len(src)) w.S.XORKeyStream(c, src) n, err = w.W.Write(c) @@ -42,7 +39,6 @@ func (w StreamWriter) Write(src []byte) (n int, err error) { if err == nil { // should never happen err = io.ErrShortWrite } - w.Err = err } return } |