[#59] Use max msg size in transport server and splitter

For GRPC it is about 4 MiB.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-02 11:01:54 +03:00
parent d2009c8731
commit 861bac3892
3 changed files with 14 additions and 9 deletions

View file

@ -13,7 +13,9 @@ func initGRPC(c *cfg) {
c.cfgGRPC.listener, err = net.Listen("tcp", c.viper.GetString(cfgListenAddress))
fatalOnErr(err)
c.cfgGRPC.server = grpc.NewServer()
c.cfgGRPC.server = grpc.NewServer(
grpc.MaxSendMsgSize(c.viper.GetInt(cfgMaxMsgSize)),
)
}
func serveGRPC(c *cfg) {