diff options
author | Martin Holst Swende <martin@swende.se> | 2018-06-04 17:41:55 +0800 |
---|---|---|
committer | Martin Holst Swende <martin@swende.se> | 2018-06-04 17:41:55 +0800 |
commit | 17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2 (patch) | |
tree | c7fe88f418f7059ebceb37f063a1e327fdf3d465 /rpc/http.go | |
parent | 143c4341d8a2231deade6d7341c668d609bd3486 (diff) | |
download | go-tangerine-17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2.tar go-tangerine-17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2.tar.gz go-tangerine-17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2.tar.bz2 go-tangerine-17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2.tar.lz go-tangerine-17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2.tar.xz go-tangerine-17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2.tar.zst go-tangerine-17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2.zip |
rpc: set timeouts for http server, see #16859
Diffstat (limited to 'rpc/http.go')
-rw-r--r-- | rpc/http.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rpc/http.go b/rpc/http.go index fe5e4b309..6388d6896 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -165,7 +165,12 @@ func NewHTTPServer(cors []string, vhosts []string, srv *Server) *http.Server { // Wrap the CORS-handler within a host-handler handler := newCorsHandler(srv, cors) handler = newVHostHandler(vhosts, handler) - return &http.Server{Handler: handler} + return &http.Server{ + Handler: handler, + ReadTimeout: 5 * time.Second, + WriteTimeout: 10 * time.Second, + IdleTimeout: 120 * time.Second, + } } // ServeHTTP serves JSON-RPC requests over HTTP. |