aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-06-04 18:38:23 +0800
committerGitHub <noreply@github.com>2018-06-04 18:38:23 +0800
commitb659718fd0aa19c6b5977eb22cd58449bbb824a0 (patch)
tree77d90436924b37789fe00f522e5d0927b1a9fd0c
parentbe2aec092d9c24c24b8d22d684ed0d11653c3cfc (diff)
parent17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2 (diff)
downloaddexon-b659718fd0aa19c6b5977eb22cd58449bbb824a0.tar.gz
dexon-b659718fd0aa19c6b5977eb22cd58449bbb824a0.tar.zst
dexon-b659718fd0aa19c6b5977eb22cd58449bbb824a0.zip
Merge pull request #16880 from holiman/http_timeouts
rpc: set timeouts for http server, see #16859
-rw-r--r--rpc/http.go7
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.