From 68e0fbbfa2cac9d75f600062c19022a583d4b81d Mon Sep 17 00:00:00 2001 From: showwin Date: Tue, 30 Mar 2021 18:32:19 +0900 Subject: [PATCH] [fix] using dynamic weight --- speedtest/request.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/speedtest/request.go b/speedtest/request.go index d25f3e5..7d6630a 100644 --- a/speedtest/request.go +++ b/speedtest/request.go @@ -119,7 +119,7 @@ func (s *Server) UploadTest(savingMode bool) error { sTime = time.Now() for i := 0; i < workload; i++ { eg.Go(func() error { - return uploadRequest(s.URL) + return uploadRequest(s.URL, weight) }) } if err := eg.Wait(); err != nil { @@ -179,8 +179,8 @@ func downloadRequest(dlURL string, w int) error { return nil } -func uploadRequest(ulURL string) error { - size := ulSizes[9] +func uploadRequest(ulURL string, w int) error { + size := ulSizes[w] v := url.Values{} v.Add("content", strings.Repeat("0123456789", size*100-51))