diff options
author | Max Romanov <max.romanov@nginx.com> | 2019-10-01 19:53:18 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2019-10-01 19:53:18 +0300 |
commit | 2eb6f35ef5a5e72e3b16649dc52c55df617d3f0e (patch) | |
tree | 0ae1c2660f352bd1ed3d1bd90dcf1c61d9bb5cc3 /src | |
parent | f8ff71b917452589bdac38ca6e51293fb05f2e8a (diff) | |
download | unit-2eb6f35ef5a5e72e3b16649dc52c55df617d3f0e.tar.gz unit-2eb6f35ef5a5e72e3b16649dc52c55df617d3f0e.tar.bz2 |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/go/unit/response.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 } } |