From: Dennis Schafroth Date: Thu, 6 May 2010 09:16:41 +0000 (+0200) Subject: Max (target) connections is ulimited as default X-Git-Tag: v1.4.1~33 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=46eea7c36057b34c235be40c5d4df9256a7668fd;p=pazpar2-moved-to-github.git 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. --- 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));