1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 04:25:44 -05:00

support aggressive mode in auth reader

This commit is contained in:
Darien Raymond
2016-12-12 21:44:16 +01:00
parent 417284ed99
commit 201d6e6471
2 changed files with 62 additions and 3 deletions

View File

@@ -158,8 +158,14 @@ func (v *AuthenticationReader) Read(b []byte) (int, error) {
return 0, err
}
nBytes := v.CopyChunk(b)
return nBytes, nil
totalBytes := v.CopyChunk(b)
for v.aggressive {
if err := v.NextChunk(); err != nil {
break
}
totalBytes += v.CopyChunk(b[totalBytes:])
}
return totalBytes, nil
}
type AuthenticationWriter struct {