diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-06-04 18:38:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-04 18:38:23 +0800 |
commit | b659718fd0aa19c6b5977eb22cd58449bbb824a0 (patch) | |
tree | 77d90436924b37789fe00f522e5d0927b1a9fd0c | |
parent | be2aec092d9c24c24b8d22d684ed0d11653c3cfc (diff) | |
parent | 17f80cc2e2d22e3ab78d6e60c5b90d61a04ea3b2 (diff) | |
download | dexon-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.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. |