mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
SplitHTTP: Rename three options & Reduce server defaults (#3611)
* maxUploadSize -> scMaxEachPostBytes, default is 1MB on both sides (was 2MB on the server) * minUploadIntervalMs -> scMinPostsIntervalMs, default is 30ms on the client (no server support for now) * maxConcurrentUploads -> scMaxConcurrentPosts, default is 100 on both sides (was 200 on the server)
This commit is contained in:
parent
33daa0c94b
commit
30af792777
6 changed files with 85 additions and 99 deletions
|
@ -36,51 +36,37 @@ func (c *Config) GetRequestHeader() http.Header {
|
|||
return header
|
||||
}
|
||||
|
||||
func (c *Config) GetNormalizedMaxConcurrentUploads(isServer bool) RandRangeConfig {
|
||||
if c.MaxConcurrentUploads == nil || c.MaxConcurrentUploads.To == 0 {
|
||||
if isServer {
|
||||
return RandRangeConfig{
|
||||
From: 200,
|
||||
To: 200,
|
||||
}
|
||||
} else {
|
||||
return RandRangeConfig{
|
||||
From: 100,
|
||||
To: 100,
|
||||
}
|
||||
func (c *Config) GetNormalizedScMaxConcurrentPosts() RandRangeConfig {
|
||||
if c.ScMaxConcurrentPosts == nil || c.ScMaxConcurrentPosts.To == 0 {
|
||||
return RandRangeConfig{
|
||||
From: 100,
|
||||
To: 100,
|
||||
}
|
||||
}
|
||||
|
||||
return *c.MaxConcurrentUploads
|
||||
return *c.ScMaxConcurrentPosts
|
||||
}
|
||||
|
||||
func (c *Config) GetNormalizedMaxUploadSize(isServer bool) RandRangeConfig {
|
||||
if c.MaxUploadSize == nil || c.MaxUploadSize.To == 0 {
|
||||
if isServer {
|
||||
return RandRangeConfig{
|
||||
From: 2000000,
|
||||
To: 2000000,
|
||||
}
|
||||
} else {
|
||||
return RandRangeConfig{
|
||||
From: 1000000,
|
||||
To: 1000000,
|
||||
}
|
||||
func (c *Config) GetNormalizedScMaxEachPostBytes() RandRangeConfig {
|
||||
if c.ScMaxEachPostBytes == nil || c.ScMaxEachPostBytes.To == 0 {
|
||||
return RandRangeConfig{
|
||||
From: 1000000,
|
||||
To: 1000000,
|
||||
}
|
||||
}
|
||||
|
||||
return *c.MaxUploadSize
|
||||
return *c.ScMaxEachPostBytes
|
||||
}
|
||||
|
||||
func (c *Config) GetNormalizedMinUploadInterval() RandRangeConfig {
|
||||
if c.MinUploadIntervalMs == nil || c.MinUploadIntervalMs.To == 0 {
|
||||
func (c *Config) GetNormalizedScMinPostsIntervalMs() RandRangeConfig {
|
||||
if c.ScMinPostsIntervalMs == nil || c.ScMinPostsIntervalMs.To == 0 {
|
||||
return RandRangeConfig{
|
||||
From: 30,
|
||||
To: 30,
|
||||
}
|
||||
}
|
||||
|
||||
return *c.MinUploadIntervalMs
|
||||
return *c.ScMinPostsIntervalMs
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue