Skip to content

Commit

Permalink
Merge pull request #16880 from holiman/http_timeouts
Browse files Browse the repository at this point in the history
rpc: set timeouts for http server, see #16859
  • Loading branch information
karalabe authored Jun 4, 2018
2 parents be2aec0 + 17f80cc commit b659718
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 b659718

Please sign in to comment.