mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 22:05:18 +00:00
lite2: allow bigger requests to LC proxy (#4930)
Closes #4838 Previously, we're only setting MaxOpenConnections, whereas we should set all config variables based on user's config.toml.
This commit is contained in:
@@ -137,9 +137,21 @@ func runProxy(cmd *cobra.Command, args []string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("http client for %s: %w", primaryAddr, err)
|
||||
}
|
||||
|
||||
cfg := rpcserver.DefaultConfig()
|
||||
cfg.MaxBodyBytes = config.RPC.MaxBodyBytes
|
||||
cfg.MaxHeaderBytes = config.RPC.MaxHeaderBytes
|
||||
cfg.MaxOpenConnections = maxOpenConnections
|
||||
// If necessary adjust global WriteTimeout to ensure it's greater than
|
||||
// TimeoutBroadcastTxCommit.
|
||||
// See https://github.com/tendermint/tendermint/issues/3435
|
||||
if cfg.WriteTimeout <= config.RPC.TimeoutBroadcastTxCommit {
|
||||
cfg.WriteTimeout = config.RPC.TimeoutBroadcastTxCommit + 1*time.Second
|
||||
}
|
||||
|
||||
p := lproxy.Proxy{
|
||||
Addr: listenAddr,
|
||||
Config: &rpcserver.Config{MaxOpenConnections: maxOpenConnections},
|
||||
Config: cfg,
|
||||
Codec: amino.NewCodec(),
|
||||
Client: lrpc.NewClient(rpcClient, c),
|
||||
Logger: logger,
|
||||
|
||||
Reference in New Issue
Block a user