Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2019-09-26 20:21:57 +0300
committerJohn Cai <jcai@gitlab.com>2019-09-26 20:21:57 +0300
commita08de481c4a29e37564502076cd0989a1c9cbd7e (patch)
tree15d591ec8e13155d812646699c366065125bb0e3
parenteaf03c02d1bec230896239f9ab0ac96449fcef1b (diff)
FIx analyze-http-clone: support gzip in info refs
-rw-r--r--cmd/gitaly-debug/analyzehttp.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/gitaly-debug/analyzehttp.go b/cmd/gitaly-debug/analyzehttp.go
index 5f2fff6ff..9a2749fc7 100644
--- a/cmd/gitaly-debug/analyzehttp.go
+++ b/cmd/gitaly-debug/analyzehttp.go
@@ -42,6 +42,12 @@ func doBenchGet(cloneURL string) []string {
msg("HTTP status code %d", resp.StatusCode)
defer resp.Body.Close()
+ body := resp.Body
+ if resp.Header.Get("Content-Encoding") == "gzip" {
+ body, err = gzip.NewReader(body)
+ noError(err)
+ }
+
// Expected response:
// - "# service=git-upload-pack\n"
// - FLUSH
@@ -53,7 +59,7 @@ func doBenchGet(cloneURL string) []string {
var wants []string
var size int64
seenFlush := false
- scanner := pktline.NewScanner(resp.Body)
+ scanner := pktline.NewScanner(body)
packets := 0
refs := 0
for ; scanner.Scan(); packets++ {