diff options
author | Ryan Schneider <ryanleeschneider@gmail.com> | 2018-07-31 17:16:14 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-07-31 17:16:14 +0800 |
commit | 5d7e18539e32cb4f1aafab8e977e28a7cd34da9c (patch) | |
tree | e79ed9d9659c68f7961cca6c8fa84492c49e5084 /node/node.go | |
parent | c4a1d4fecf5efcf5095c667b7b311061173799b4 (diff) | |
download | dexon-5d7e18539e32cb4f1aafab8e977e28a7cd34da9c.tar.gz dexon-5d7e18539e32cb4f1aafab8e977e28a7cd34da9c.tar.zst dexon-5d7e18539e32cb4f1aafab8e977e28a7cd34da9c.zip |
rpc: make HTTP RPC timeouts configurable, raise defaults (#17240)
* rpc: Make HTTP server timeout values configurable
* rpc: Remove flags for setting HTTP Timeouts, configuring via .toml is sufficient.
* rpc: Replace separate constants with a single default struct.
* rpc: Update HTTP Server Read and Write Timeouts to 30s.
* rpc: Remove redundant NewDefaultHTTPTimeouts function.
* rpc: document HTTPTimeouts.
* rpc: sanitize timeout values for library use
Diffstat (limited to 'node/node.go')
-rw-r--r-- | node/node.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/node/node.go b/node/node.go index 7cc11b781..ada383721 100644 --- a/node/node.go +++ b/node/node.go @@ -263,7 +263,7 @@ func (n *Node) startRPC(services map[reflect.Type]Service) error { n.stopInProc() return err } - if err := n.startHTTP(n.httpEndpoint, apis, n.config.HTTPModules, n.config.HTTPCors, n.config.HTTPVirtualHosts); err != nil { + if err := n.startHTTP(n.httpEndpoint, apis, n.config.HTTPModules, n.config.HTTPCors, n.config.HTTPVirtualHosts, n.config.HTTPTimeouts); err != nil { n.stopIPC() n.stopInProc() return err @@ -331,12 +331,12 @@ func (n *Node) stopIPC() { } // startHTTP initializes and starts the HTTP RPC endpoint. -func (n *Node) startHTTP(endpoint string, apis []rpc.API, modules []string, cors []string, vhosts []string) error { +func (n *Node) startHTTP(endpoint string, apis []rpc.API, modules []string, cors []string, vhosts []string, timeouts rpc.HTTPTimeouts) error { // Short circuit if the HTTP endpoint isn't being exposed if endpoint == "" { return nil } - listener, handler, err := rpc.StartHTTPEndpoint(endpoint, apis, modules, cors, vhosts) + listener, handler, err := rpc.StartHTTPEndpoint(endpoint, apis, modules, cors, vhosts, timeouts) if err != nil { return err } |