From 2cf9ce96410e7430b86ed8cabd1d20caca1b44c3 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 20 Mar 2008 00:11:39 +0100 Subject: [PATCH] The pre-init stage honors max-sockets as well. --- src/proxyp.h | 1 + src/yaz-proxy-config.cpp | 3 ++- src/yaz-proxy.cpp | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/proxyp.h b/src/proxyp.h index cc19d99..311062c 100644 --- a/src/proxyp.h +++ b/src/proxyp.h @@ -93,6 +93,7 @@ public: int *limit_search, int *target_idletime, int *client_idletime, + int *max_sockets, int *max_clients, int *keepalive_limit_bw, int *keepalive_limit_pdu, diff --git a/src/yaz-proxy-config.cpp b/src/yaz-proxy-config.cpp index edd5d85..7fe6204 100644 --- a/src/yaz-proxy-config.cpp +++ b/src/yaz-proxy-config.cpp @@ -993,6 +993,7 @@ int Yaz_ProxyConfig::get_target_no(int no, int *limit_search, int *target_idletime, int *client_idletime, + int *max_sockets, int *max_clients, int *keepalive_limit_bw, int *keepalive_limit_pdu, @@ -1029,7 +1030,7 @@ int Yaz_ProxyConfig::get_target_no(int no, limit_bw, limit_pdu, limit_req, limit_search, target_idletime, client_idletime, - 0, + max_sockets, keepalive_limit_bw, keepalive_limit_pdu, pre_init, cql2rpn, negotiation_charset, negotiation_lang, target_charset, diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 147d066..eb7ce68 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -3539,6 +3539,7 @@ void Yaz_Proxy::pre_init() const char *zurl_in_use[MAX_ZURL_PLEX]; int limit_bw, limit_pdu, limit_req, limit_search; int target_idletime, client_idletime; + int max_sockets; int max_clients; int keepalive_limit_bw, keepalive_limit_pdu; int pre_init; @@ -3560,6 +3561,7 @@ void Yaz_Proxy::pre_init() &limit_bw, &limit_pdu, &limit_req, &limit_search, &target_idletime, &client_idletime, + &max_sockets, &max_clients, &keepalive_limit_bw, &keepalive_limit_pdu, @@ -3603,7 +3605,8 @@ void Yaz_Proxy::pre_init() "sparew=%d preinit=%d",m_session_str, name, zurl_in_use[j], in_use, other, spare, spare_waiting, pre_init); - if (spare + spare_waiting < pre_init) + if (spare + spare_waiting < pre_init + && in_use + spare + spare_waiting + other < max_sockets) { c = new Yaz_ProxyClient(m_PDU_Observable->clone(), this); c->m_next = m_clientPool; -- 1.7.10.4