summaryrefslogtreecommitdiffhomepage
path: root/src/go/unit/response.go
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2019-10-01 19:53:18 +0300
committerMax Romanov <max.romanov@nginx.com>2019-10-01 19:53:18 +0300
commit2eb6f35ef5a5e72e3b16649dc52c55df617d3f0e (patch)
tree0ae1c2660f352bd1ed3d1bd90dcf1c61d9bb5cc3 /src/go/unit/response.go
parentf8ff71b917452589bdac38ca6e51293fb05f2e8a (diff)
downloadunit-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/go/unit/response.go')
-rw-r--r--src/go/unit/response.go2
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
}
}