loolwsd: prevent configuring max_connections less than max_documents

It would be nonsensical to allow less connections than documents
since each document must, by definition, have at least a
single connection.

This prevents blocking new documents because of connection
limit. If that were the intention, max_documents should be
lowered to match max_connections.

Change-Id: Ide07e977f548ed917c6e51a2ba88f3cc07947efe
Reviewed-on: https://gerrit.libreoffice.org/30209
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
libreoffice-5-3
Ashod Nakashian 2016-10-23 13:30:54 -04:00 committed by Ashod Nakashian
parent f0c3365f9f
commit 195936ffa1
1 changed files with 5 additions and 0 deletions

View File

@ -141,6 +141,11 @@ AS_IF([test -n "$with_max_connections"],
AC_DEFINE_UNQUOTED([MAX_CONNECTIONS],[$MAX_CONNECTIONS],[Limit the maximum number of open connections])
AC_SUBST(MAX_CONNECTIONS)
if test $MAX_CONNECTIONS -lt $MAX_DOCUMENTS; then
AC_MSG_ERROR([Each document must have at least one connection, therefore, max_connections cannot be less than
max_documents.])
fi
# Test for build environment
CXXFLAGS="$CXXFLAGS -std=c++11"