renamed ErrObjectReleased

pull/215/head
v2ray 9 years ago
parent 3729ad2330
commit 6847139ae3
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -7,7 +7,7 @@ import (
) )
var ( var (
ErrorAlreadyReleased = errors.New("Object already released.") ErrObjectReleased = errors.New("Object already released.")
ErrBadConfiguration = errors.New("Bad configuration.") ErrBadConfiguration = errors.New("Bad configuration.")
) )

@ -21,7 +21,7 @@ func NewCryptionReader(stream cipher.Stream, reader io.Reader) *CryptionReader {
func (this *CryptionReader) Read(data []byte) (int, error) { func (this *CryptionReader) Read(data []byte) (int, error) {
if this.reader == nil { if this.reader == nil {
return 0, common.ErrorAlreadyReleased return 0, common.ErrObjectReleased
} }
nBytes, err := this.reader.Read(data) nBytes, err := this.reader.Read(data)
if nBytes > 0 { if nBytes > 0 {
@ -49,7 +49,7 @@ func NewCryptionWriter(stream cipher.Stream, writer io.Writer) *CryptionWriter {
func (this *CryptionWriter) Write(data []byte) (int, error) { func (this *CryptionWriter) Write(data []byte) (int, error) {
if this.writer == nil { if this.writer == nil {
return 0, common.ErrorAlreadyReleased return 0, common.ErrObjectReleased
} }
this.stream.XORKeyStream(data, data) this.stream.XORKeyStream(data, data)
return this.writer.Write(data) return this.writer.Write(data)

Loading…
Cancel
Save