1
0
Fork 0

issue #1159: allow --server.request-timeout and --server.connect-timeout of 0

This commit is contained in:
Jan Steemann 2014-12-09 16:51:08 +01:00
parent 1fdf74e09e
commit f1f0269eb9
2 changed files with 17 additions and 3 deletions

View File

@ -47,6 +47,8 @@ double const ArangoClient::DEFAULT_CONNECTION_TIMEOUT = 3.0;
double const ArangoClient::DEFAULT_REQUEST_TIMEOUT = 300.0;
size_t const ArangoClient::DEFAULT_RETRIES = 2;
double const ArangoClient::LONG_TIMEOUT = 86400.0;
namespace {
#ifdef _WIN32
bool _newLine () {
@ -459,13 +461,19 @@ void ArangoClient::parse (ProgramOptions& options,
if (_serverOptions) {
// check connection args
if (_connectTimeout <= 0) {
LOG_FATAL_AND_EXIT("invalid value for --server.connect-timeout, must be positive");
if (_connectTimeout < 0.0) {
LOG_FATAL_AND_EXIT("invalid value for --server.connect-timeout, must be >= 0");
}
else if (_connectTimeout == 0.0) {
_connectTimeout = LONG_TIMEOUT;
}
if (_requestTimeout <= 0) {
if (_requestTimeout < 0.0) {
LOG_FATAL_AND_EXIT("invalid value for --server.request-timeout, must be positive");
}
else if (_requestTimeout == 0.0) {
_requestTimeout = LONG_TIMEOUT;
}
// must specify a user name
if (_username.size() == 0) {

View File

@ -87,6 +87,12 @@ namespace triagens {
static double const DEFAULT_CONNECTION_TIMEOUT;
////////////////////////////////////////////////////////////////////////////////
/// @brief default "long" timeout
////////////////////////////////////////////////////////////////////////////////
static double const LONG_TIMEOUT;
////////////////////////////////////////////////////////////////////////////////
/// @brief ignore sequence used for prompt length calculation (starting point)
///