From 1ca76e5e883c794c6680896c65f050438deec0d4 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Wed, 15 Jun 2016 18:05:48 -0700 Subject: [PATCH] Using read/write timeout in server config Signed-off-by: Vishal Rana --- engine/fasthttp/server.go | 2 ++ engine/standard/server.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/engine/fasthttp/server.go b/engine/fasthttp/server.go index 1263fdda..572c8334 100644 --- a/engine/fasthttp/server.go +++ b/engine/fasthttp/server.go @@ -84,6 +84,8 @@ func WithConfig(c engine.Config) (s *Server) { }), logger: glog.New("echo"), } + s.ReadTimeout = c.ReadTimeout + s.WriteTimeout = c.WriteTimeout s.Handler = s.ServeHTTP return } diff --git a/engine/standard/server.go b/engine/standard/server.go index efe2096e..60f419bc 100644 --- a/engine/standard/server.go +++ b/engine/standard/server.go @@ -82,6 +82,8 @@ func WithConfig(c engine.Config) (s *Server) { }), logger: glog.New("echo"), } + s.ReadTimeout = c.ReadTimeout + s.WriteTimeout = c.WriteTimeout s.Addr = c.Address s.Handler = s return