Skip to content

Commit

Permalink
rpc: set timeouts for http server, see ethereum#16859
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Jun 4, 2018
1 parent 143c434 commit 17f80cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rpc/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 17f80cc

Please sign in to comment.