From 9d8c2107d11495da404c379cdba04bdfceb07937 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Wed, 16 Mar 2016 19:55:35 +0100 Subject: [PATCH] Fix missing response size --- engine/fasthttp/response.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/fasthttp/response.go b/engine/fasthttp/response.go index 6c4f39be..e56d0487 100644 --- a/engine/fasthttp/response.go +++ b/engine/fasthttp/response.go @@ -41,8 +41,10 @@ func (r *Response) WriteHeader(code int) { } // Write implements `engine.Response#Write` method. -func (r *Response) Write(b []byte) (int, error) { - return r.writer.Write(b) +func (r *Response) Write(b []byte) (n int, err error) { + n, err = r.writer.Write(b) + r.size += int64(n) + return } // Status implements `engine.Response#Status` method.