diff options
author | Determinant <[email protected]> | 2020-03-30 18:48:48 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-03-30 18:48:48 -0400 |
commit | a7dcb6db441baf5b7928a44afd5da9bb81cf0023 (patch) | |
tree | b2f53d8e8ae971c46c5d0cdabaefe25aeafe86e8 | |
parent | b2ff24cf19b8c3497a35b8ea05e3a2809efc913f (diff) |
add option to control client message size limit
-rw-r--r-- | examples/hotstuff_app.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/hotstuff_app.cpp b/examples/hotstuff_app.cpp index 7a5a72e..63c29f3 100644 --- a/examples/hotstuff_app.cpp +++ b/examples/hotstuff_app.cpp @@ -171,7 +171,8 @@ int main(int argc, char **argv) { auto opt_clinworker = Config::OptValInt::create(8); auto opt_cliburst = Config::OptValInt::create(1000); auto opt_notls = Config::OptValFlag::create(false); - auto opt_max_msg_size = Config::OptValInt::create(4 << 20); + auto opt_max_rep_msg = Config::OptValInt::create(4 << 20); // 4M by default + auto opt_max_cli_msg = Config::OptValInt::create(65536); // 64K by default config.add_opt("block-size", opt_blk_size, Config::SET_VAL); config.add_opt("parent-limit", opt_parent_limit, Config::SET_VAL); @@ -193,7 +194,8 @@ int main(int argc, char **argv) { config.add_opt("clinworker", opt_clinworker, Config::SET_VAL, 'M', "the number of threads for client network"); config.add_opt("cliburst", opt_cliburst, Config::SET_VAL, 'B', ""); config.add_opt("notls", opt_notls, Config::SWITCH_ON, 's', "disable TLS"); - config.add_opt("max-msg-size", opt_max_msg_size, Config::SET_VAL, 'S', "the maximum message size"); + config.add_opt("max-rep-msg", opt_max_rep_msg, Config::SET_VAL, 'S', "the maximum replica message size"); + config.add_opt("max-cli-msg", opt_max_cli_msg, Config::SET_VAL, 'S', "the maximum client message size"); config.add_opt("help", opt_help, Config::SWITCH_ON, 'h', "show this help info"); EventContext ec; @@ -239,7 +241,8 @@ int main(int argc, char **argv) { HotStuffApp::Net::Config repnet_config; ClientNetwork<opcode_t>::Config clinet_config; - repnet_config.max_msg_size(opt_max_msg_size->get()); + repnet_config.max_msg_size(opt_max_rep_msg->get()); + clinet_config.max_msg_size(opt_max_cli_msg->get()); if (!opt_tls_privkey->get().empty() && !opt_notls->get()) { auto tls_priv_key = new salticidae::PKey( |