Merge pull request #16880 from holiman/http_timeouts

rpc: set timeouts for http server, see #16859
pull/16800/head
Péter Szilágyi 6 years ago committed by GitHub
commit b659718fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      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.

Loading…
Cancel
Save