Skip to content

Commit ff8b66a

Browse files
authored
XHTTP client: scMaxEachPostBytes should be bigger than buf.Size (8192)
To avoid no size limit.
1 parent 1531897 commit ff8b66a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

transport/internet/splithttp/dialer.go

+4
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
409409
scMaxEachPostBytes := transportConfiguration.GetNormalizedScMaxEachPostBytes()
410410
scMinPostsIntervalMs := transportConfiguration.GetNormalizedScMinPostsIntervalMs()
411411

412+
if scMaxEachPostBytes.From <= buf.Size {
413+
panic("`scMaxEachPostBytes` should be bigger than " + strconv.Itoa(buf.Size))
414+
}
415+
412416
maxUploadSize := scMaxEachPostBytes.rand()
413417
// WithSizeLimit(0) will still allow single bytes to pass, and a lot of
414418
// code relies on this behavior. Subtract 1 so that together with

0 commit comments

Comments
 (0)