1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 15:36:41 -05:00
This commit is contained in:
v2ray 2016-04-28 22:31:33 +02:00
parent 58530e6920
commit 8b71647b9d
3 changed files with 5 additions and 1 deletions

View File

@ -33,6 +33,7 @@ type AdaptiveReader struct {
}
// NewAdaptiveReader creates a new AdaptiveReader.
// The AdaptiveReader instance doesn't take the ownership of reader.
func NewAdaptiveReader(reader io.Reader) *AdaptiveReader {
return &AdaptiveReader{
reader: reader,

View File

@ -26,7 +26,7 @@ func NewAdaptiveWriter(writer io.Writer) *AdaptiveWriter {
}
}
// Write implements Writer.Write().
// Write implements Writer.Write(). Write() takes ownership of the given buffer.
func (this *AdaptiveWriter) Write(buffer *alloc.Buffer) error {
nBytes, err := this.writer.Write(buffer.Value)
if nBytes < buffer.Len() {

View File

@ -24,12 +24,15 @@ type ServerSession struct {
responseWriter io.Writer
}
// NewServerSession creates a new ServerSession, using the given UserValidator.
// The ServerSession instance doesn't take ownership of the validator.
func NewServerSession(validator protocol.UserValidator) *ServerSession {
return &ServerSession{
userValidator: validator,
}
}
// Release implements common.Releaseable.
func (this *ServerSession) Release() {
this.userValidator = nil
this.requestBodyIV = nil