mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-09 01:26:36 +00:00
Merge pull request #16880 from holiman/http_timeouts
rpc: set timeouts for http server, see #16859
This commit is contained in:
commit
b659718fd0
1 changed files with 6 additions and 1 deletions
|
|
@ -165,7 +165,12 @@ func NewHTTPServer(cors []string, vhosts []string, srv *Server) *http.Server {
|
||||||
// Wrap the CORS-handler within a host-handler
|
// Wrap the CORS-handler within a host-handler
|
||||||
handler := newCorsHandler(srv, cors)
|
handler := newCorsHandler(srv, cors)
|
||||||
handler = newVHostHandler(vhosts, handler)
|
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.
|
// ServeHTTP serves JSON-RPC requests over HTTP.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue