Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplitHTTP: Rename maxUploadSize to maxUploadBytes, reduce server defaults #3611

Merged
merged 5 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unused function arg
  • Loading branch information
mmmray committed Jul 29, 2024
commit 6367321dce4e0cf1ea6b4675017be6a94340c345
4 changes: 2 additions & 2 deletions transport/internet/splithttp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (c *Config) GetRequestHeader() http.Header {
return header
}

func (c *Config) GetNormalizedMaxConcurrentUploads(isServer bool) RandRangeConfig {
func (c *Config) GetNormalizedMaxConcurrentUploads() RandRangeConfig {
if c.MaxConcurrentUploads == nil || c.MaxConcurrentUploads.To == 0 {
return RandRangeConfig{
From: 100,
Expand All @@ -47,7 +47,7 @@ func (c *Config) GetNormalizedMaxConcurrentUploads(isServer bool) RandRangeConfi
return *c.MaxConcurrentUploads
}

func (c *Config) GetNormalizedMaxEachUploadBytes(isServer bool) RandRangeConfig {
func (c *Config) GetNormalizedMaxEachUploadBytes() RandRangeConfig {
if c.MaxEachUploadBytes == nil || c.MaxEachUploadBytes.To == 0 {
return RandRangeConfig{
From: 1000000,
Expand Down
4 changes: 2 additions & 2 deletions transport/internet/splithttp/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
transportConfiguration := streamSettings.ProtocolSettings.(*Config)
tlsConfig := tls.ConfigFromStreamSettings(streamSettings)

maxConcurrentUploads := transportConfiguration.GetNormalizedMaxConcurrentUploads(false)
maxEachUploadBytes := transportConfiguration.GetNormalizedMaxEachUploadBytes(false)
maxConcurrentUploads := transportConfiguration.GetNormalizedMaxConcurrentUploads()
maxEachUploadBytes := transportConfiguration.GetNormalizedMaxEachUploadBytes()
minUploadInterval := transportConfiguration.GetNormalizedMinUploadInterval()

if tlsConfig != nil {
Expand Down
4 changes: 2 additions & 2 deletions transport/internet/splithttp/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (h *requestHandler) upsertSession(sessionId string) *httpSession {
}

s := &httpSession{
uploadQueue: NewUploadQueue(int(h.ln.config.GetNormalizedMaxConcurrentUploads(true).To)),
uploadQueue: NewUploadQueue(int(h.ln.config.GetNormalizedMaxConcurrentUploads().To)),
isFullyConnected: done.New(),
}

Expand Down Expand Up @@ -123,7 +123,7 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req
}

currentSession := h.upsertSession(sessionId)
maxEachUploadBytes := int(h.ln.config.GetNormalizedMaxEachUploadBytes(true).To)
maxEachUploadBytes := int(h.ln.config.GetNormalizedMaxEachUploadBytes().To)

if request.Method == "POST" {
seq := ""
Expand Down