change default connect timeout from 10 to 2
parent
65876c51d7
commit
837e35ccc8
|
|
@ -20,6 +20,9 @@
|
||||||
|
|
||||||
#include "fastcommon/sockopt.h"
|
#include "fastcommon/sockopt.h"
|
||||||
|
|
||||||
|
#define SF_DEFAULT_CONNECT_TIMEOUT 2
|
||||||
|
#define SF_DEFAULT_NETWORK_TIMEOUT 30
|
||||||
|
|
||||||
#define SF_DEF_THREAD_STACK_SIZE (256 * 1024)
|
#define SF_DEF_THREAD_STACK_SIZE (256 * 1024)
|
||||||
#define SF_MIN_THREAD_STACK_SIZE (64 * 1024)
|
#define SF_MIN_THREAD_STACK_SIZE (64 * 1024)
|
||||||
#define SF_MAX_THREAD_STACK_SIZE (2 * 1024 * 1024 * 1024LL)
|
#define SF_MAX_THREAD_STACK_SIZE (2 * 1024 * 1024 * 1024LL)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
#include "sf_global.h"
|
#include "sf_global.h"
|
||||||
|
|
||||||
SFGlobalVariables g_sf_global_vars = {
|
SFGlobalVariables g_sf_global_vars = {
|
||||||
DEFAULT_CONNECT_TIMEOUT, DEFAULT_NETWORK_TIMEOUT,
|
SF_DEFAULT_CONNECT_TIMEOUT, SF_DEFAULT_NETWORK_TIMEOUT,
|
||||||
{{'/', 't', 'm', 'p', '\0'}, false},
|
{{'/', 't', 'm', 'p', '\0'}, false},
|
||||||
true, true, DEFAULT_MAX_CONNECTONS,
|
true, true, DEFAULT_MAX_CONNECTONS,
|
||||||
SF_DEF_MAX_PACKAGE_SIZE, SF_DEF_MIN_BUFF_SIZE,
|
SF_DEF_MAX_PACKAGE_SIZE, SF_DEF_MIN_BUFF_SIZE,
|
||||||
|
|
@ -65,16 +65,18 @@ static int load_network_parameters(IniFullContext *ini_ctx,
|
||||||
char *pMinBuffSize;
|
char *pMinBuffSize;
|
||||||
char *pMaxBuffSize;
|
char *pMaxBuffSize;
|
||||||
|
|
||||||
g_sf_global_vars.connect_timeout = iniGetIntValueEx(ini_ctx->section_name,
|
g_sf_global_vars.connect_timeout = iniGetIntValueEx(ini_ctx->
|
||||||
"connect_timeout", ini_ctx->context, DEFAULT_CONNECT_TIMEOUT, true);
|
section_name, "connect_timeout", ini_ctx->context,
|
||||||
|
SF_DEFAULT_CONNECT_TIMEOUT, true);
|
||||||
if (g_sf_global_vars.connect_timeout <= 0) {
|
if (g_sf_global_vars.connect_timeout <= 0) {
|
||||||
g_sf_global_vars.connect_timeout = DEFAULT_CONNECT_TIMEOUT;
|
g_sf_global_vars.connect_timeout = SF_DEFAULT_CONNECT_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_sf_global_vars.network_timeout = iniGetIntValueEx(ini_ctx->section_name,
|
g_sf_global_vars.network_timeout = iniGetIntValueEx(ini_ctx->
|
||||||
"network_timeout", ini_ctx->context, DEFAULT_NETWORK_TIMEOUT, true);
|
section_name, "network_timeout", ini_ctx->context,
|
||||||
|
SF_DEFAULT_NETWORK_TIMEOUT, true);
|
||||||
if (g_sf_global_vars.network_timeout <= 0) {
|
if (g_sf_global_vars.network_timeout <= 0) {
|
||||||
g_sf_global_vars.network_timeout = DEFAULT_NETWORK_TIMEOUT;
|
g_sf_global_vars.network_timeout = SF_DEFAULT_NETWORK_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_sf_global_vars.max_connections = iniGetIntValueEx(ini_ctx->section_name,
|
g_sf_global_vars.max_connections = iniGetIntValueEx(ini_ctx->section_name,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue