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,8 +7,8 @@ import (
)
var (
ErrorAlreadyReleased = errors.New("Object already released.")
ErrBadConfiguration = errors.New("Bad configuration.")
ErrObjectReleased = errors.New("Object already released.")
ErrBadConfiguration = errors.New("Bad configuration.")
)
// Releasable interface is for those types that can release its members.

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

Loading…
Cancel
Save