Improved connection failure conditions

As a kind of a pre-warning this commit allows the n-1 connection problem to
give feedback on the screen (that wasn't working before).

Also the message on the screen is now more clear and the manpage
gives better advice.

Related to #1172
This commit is contained in:
Dirk
2018-12-05 16:09:36 +01:00
parent 11cf06d6e9
commit 6fe5adbbc3
4 changed files with 18 additions and 15 deletions

View File

@ -1930,12 +1930,15 @@ service_detection() {
# 4: string for repeated occurrence of problem
#
connectivity_problem() {
if [[ $1 -lt $2 ]]; then
prln_warning "Oops: $3"
return 0
fi
if [[ $1 -ge $2 ]]; then
if [[ $2 -eq 1 ]]; then
fatal "$3" $ERR_CONNECT
fi
if [[ "$4" =~ openssl\ s_client\ connect ]] ; then
fatal "$4" $ERR_CONNECT "consider increasing MAX_OSSL_FAIL (currently: $2)"
fatal "$4" $ERR_CONNECT "Consider increasing MAX_OSSL_FAIL (currently: $2)"
elif [[ "$4" =~ repeated\ TCP\ connect ]]; then
fatal "$4" $ERR_CONNECT "Consider increasing MAX_SOCKET_FAIL (currently: $2)"
fi
fatal "$4" $ERR_CONNECT
fi