(snake) add an option to disable answering pongs as response to pings, to test cobra client behavior with hanged connections
This commit is contained in:
@ -99,6 +99,7 @@ int main(int argc, char** argv)
|
||||
bool redirect = false;
|
||||
bool version = false;
|
||||
bool verifyNone = false;
|
||||
bool disablePong = false;
|
||||
int port = 8008;
|
||||
int redisPort = 6379;
|
||||
int statsdPort = 8125;
|
||||
@ -309,6 +310,7 @@ int main(int argc, char** argv)
|
||||
snakeApp->add_option("--apps_config_path", appsConfigPath, "Path to auth data")
|
||||
->check(CLI::ExistingPath);
|
||||
snakeApp->add_flag("-v", verbose, "Verbose");
|
||||
snakeApp->add_flag("-d", disablePong, "Disable Pongs");
|
||||
addTLSOptions(snakeApp);
|
||||
|
||||
CLI::App* httpServerApp = app.add_subcommand("httpd", "HTTP server");
|
||||
@ -492,7 +494,8 @@ int main(int argc, char** argv)
|
||||
redisPassword,
|
||||
verbose,
|
||||
appsConfigPath,
|
||||
tlsOptions);
|
||||
tlsOptions,
|
||||
disablePong);
|
||||
}
|
||||
else if (app.got_subcommand("httpd"))
|
||||
{
|
||||
|
3
ws/ws.h
3
ws/ws.h
@ -142,7 +142,8 @@ namespace ix
|
||||
const std::string& redisPassword,
|
||||
bool verbose,
|
||||
const std::string& appsConfigPath,
|
||||
const ix::SocketTLSOptions& tlsOptions);
|
||||
const ix::SocketTLSOptions& tlsOptions,
|
||||
bool disablePong);
|
||||
|
||||
int ws_httpd_main(int port,
|
||||
const std::string& hostname,
|
||||
|
@ -44,7 +44,8 @@ namespace ix
|
||||
const std::string& redisPassword,
|
||||
bool verbose,
|
||||
const std::string& appsConfigPath,
|
||||
const SocketTLSOptions& socketTLSOptions)
|
||||
const SocketTLSOptions& socketTLSOptions,
|
||||
bool disablePong)
|
||||
{
|
||||
snake::AppConfig appConfig;
|
||||
appConfig.port = port;
|
||||
@ -53,6 +54,7 @@ namespace ix
|
||||
appConfig.redisPort = redisPort;
|
||||
appConfig.redisPassword = redisPassword;
|
||||
appConfig.socketTLSOptions = socketTLSOptions;
|
||||
appConfig.disablePong = disablePong;
|
||||
|
||||
// Parse config file
|
||||
auto str = readAsString(appsConfigPath);
|
||||
|
Reference in New Issue
Block a user