Add argument --connect-timeout. Defaults to 3 min

This default value should not affect users not currently using the
timeout (Linux's default seems to be currently around 2 min).
This commit is contained in:
Gonçalo Ribeiro 2019-10-10 04:10:57 +01:00
parent f32d49ccf9
commit 83b212f581

View File

@ -393,6 +393,7 @@ SERVER_COUNTER=0 # Counter for multiple servers
TLS_LOW_BYTE="" # For "secret" development stuff, see -q below
HEX_CIPHER="" # "
CONNECT_TIMEOUT=180
########### Global variables for parallel mass testing
@ -10172,7 +10173,7 @@ fd_socket() {
break
fi
done
elif ! timeout 2 bash -c "exec 3<>/dev/tcp/$nodeip/$PORT" || \
elif ! timeout $CONNECT_TIMEOUT bash -c "exec 3<>/dev/tcp/$nodeip/$PORT" || \
! exec 5<>/dev/tcp/$nodeip/$PORT; then # 2>/dev/null would remove an error message, but disables debugging
((NR_SOCKET_FAIL++))
connectivity_problem $NR_SOCKET_FAIL $MAX_SOCKET_FAIL "TCP connect problem" "repeated TCP connect problems, giving up"
@ -19461,6 +19462,10 @@ parse_cmd_line() {
OPENSSL_TIMEOUT="$(parse_opt_equal_sign "$1" "$2")"
[[ $? -eq 0 ]] && shift
;;
--connect-timeout|--connect-timeout=*)
CONNECT_TIMEOUT="$(parse_opt_equal_sign "$1" "$2")"
[[ $? -eq 0 ]] && shift
;;
--mapping|--mapping=*)
cipher_mapping="$(parse_opt_equal_sign "$1" "$2")"
[[ $? -eq 0 ]] && shift