@@ -229,10 +229,22 @@ type SplitHTTPConfig struct {
229229 Host string `json:"host"`
230230 Path string `json:"path"`
231231 Headers map [string ]string `json:"headers"`
232- ScMaxConcurrentPosts Int32Range `json:"scMaxConcurrentPosts"`
233- ScMaxEachPostBytes Int32Range `json:"scMaxEachPostBytes"`
234- ScMinPostsIntervalMs Int32Range `json:"scMinPostsIntervalMs"`
232+ ScMaxConcurrentPosts * Int32Range `json:"scMaxConcurrentPosts"`
233+ ScMaxEachPostBytes * Int32Range `json:"scMaxEachPostBytes"`
234+ ScMinPostsIntervalMs * Int32Range `json:"scMinPostsIntervalMs"`
235235 NoSSEHeader bool `json:"noSSEHeader"`
236+ ResponseOkPadding * Int32Range `json:"responseOkPadding"`
237+ }
238+
239+ func splithttpNewRandRangeConfig (input * Int32Range ) * splithttp.RandRangeConfig {
240+ if input == nil {
241+ return nil
242+ }
243+
244+ return & splithttp.RandRangeConfig {
245+ From : input .From ,
246+ To : input .To ,
247+ }
236248}
237249
238250// Build implements Buildable.
@@ -246,22 +258,14 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
246258 c .Host = c .Headers ["Host" ]
247259 }
248260 config := & splithttp.Config {
249- Path : c .Path ,
250- Host : c .Host ,
251- Header : c .Headers ,
252- ScMaxConcurrentPosts : & splithttp.RandRangeConfig {
253- From : c .ScMaxConcurrentPosts .From ,
254- To : c .ScMaxConcurrentPosts .To ,
255- },
256- ScMaxEachPostBytes : & splithttp.RandRangeConfig {
257- From : c .ScMaxEachPostBytes .From ,
258- To : c .ScMaxEachPostBytes .To ,
259- },
260- ScMinPostsIntervalMs : & splithttp.RandRangeConfig {
261- From : c .ScMinPostsIntervalMs .From ,
262- To : c .ScMinPostsIntervalMs .To ,
263- },
264- NoSSEHeader : c .NoSSEHeader ,
261+ Path : c .Path ,
262+ Host : c .Host ,
263+ Header : c .Headers ,
264+ ScMaxConcurrentPosts : splithttpNewRandRangeConfig (c .ScMaxConcurrentPosts ),
265+ ScMaxEachPostBytes : splithttpNewRandRangeConfig (c .ScMaxEachPostBytes ),
266+ ScMinPostsIntervalMs : splithttpNewRandRangeConfig (c .ScMinPostsIntervalMs ),
267+ NoSSEHeader : c .NoSSEHeader ,
268+ ResponseOkPadding : splithttpNewRandRangeConfig (c .ResponseOkPadding ),
265269 }
266270 return config , nil
267271}
0 commit comments