From 46eea7c36057b34c235be40c5d4df9256a7668fd Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Thu, 6 May 2010 11:16:41 +0200 Subject: [PATCH] Max (target) connections is ulimited as default To maintain backwards compatibility the max connection is by default ulimited. Only by specifying a configuration larger than 0, will it be enforced. --- src/connection.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/connection.c b/src/connection.c index 08d1501..bfa764e 100644 --- a/src/connection.c +++ b/src/connection.c @@ -470,7 +470,7 @@ int client_prep_connection(struct client *cl, if (!co) { - int max_connections = 30; + int max_connections = 0; const char *v = session_setting_oneval(client_get_database(cl), PZ_MAX_CONNECTIONS); if (v && *v) @@ -504,14 +504,16 @@ int client_prep_connection(struct client *cl, num_connections); break; } - if (num_connections < max_connections) - { - yaz_log(YLOG_LOG, "num_connections = %d (new); max = %d", + if (max_connections > 0) { + if (num_connections < max_connections) + { + yaz_log(YLOG_LOG, "num_connections = %d (new); max = %d", + num_connections, max_connections); + break; + } + yaz_log(YLOG_LOG, "num_connections = %d (waiting) max = %d", num_connections, max_connections); - break; } - yaz_log(YLOG_LOG, "num_connections = %d (waiting) max = %d", - num_connections, max_connections); if (yaz_cond_wait(host->cond_ready, host->mutex, abstime)) { yaz_log(YLOG_LOG, "out of connections %s", client_get_url(cl)); -- 1.7.10.4