mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 19:33:32 +02:00
XHTTP client: scMaxEachPostBytes
should be bigger than buf.Size (8192)
To avoid no size limit.
This commit is contained in:
parent
15318976f6
commit
ff8b66aacb
1 changed files with 4 additions and 0 deletions
|
@ -409,6 +409,10 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
||||||
scMaxEachPostBytes := transportConfiguration.GetNormalizedScMaxEachPostBytes()
|
scMaxEachPostBytes := transportConfiguration.GetNormalizedScMaxEachPostBytes()
|
||||||
scMinPostsIntervalMs := transportConfiguration.GetNormalizedScMinPostsIntervalMs()
|
scMinPostsIntervalMs := transportConfiguration.GetNormalizedScMinPostsIntervalMs()
|
||||||
|
|
||||||
|
if scMaxEachPostBytes.From <= buf.Size {
|
||||||
|
panic("`scMaxEachPostBytes` should be bigger than " + strconv.Itoa(buf.Size))
|
||||||
|
}
|
||||||
|
|
||||||
maxUploadSize := scMaxEachPostBytes.rand()
|
maxUploadSize := scMaxEachPostBytes.rand()
|
||||||
// WithSizeLimit(0) will still allow single bytes to pass, and a lot of
|
// WithSizeLimit(0) will still allow single bytes to pass, and a lot of
|
||||||
// code relies on this behavior. Subtract 1 so that together with
|
// code relies on this behavior. Subtract 1 so that together with
|
||||||
|
|
Loading…
Reference in a new issue