From 2eb6f35ef5a5e72e3b16649dc52c55df617d3f0e Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Tue, 1 Oct 2019 19:53:18 +0300 Subject: Go: fixing header buffer size calculation. Header names and values are stored 0-terminated for ease of use in different languages, so magic number 2 should be added to each name-value pair size. --- src/go/unit/response.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/go/unit') diff --git a/src/go/unit/response.go b/src/go/unit/response.go index 767d66b7..bb326ea5 100644 --- a/src/go/unit/response.go +++ b/src/go/unit/response.go @@ -63,7 +63,7 @@ func (r *response) WriteHeader(code int) { for k, vv := range r.header { for _, v := range vv { fields++ - fields_size += len(k) + len(v) + fields_size += len(k) + len(v) + 2 } } -- cgit