From: Adam Dickmeiss Date: Fri, 27 May 2005 18:07:49 +0000 (+0000) Subject: Fixed bug #355: YAZ proxy does not seem to load balance. Error X-Git-Tag: YAZPROXY.ERE2~16 X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=commitdiff_plain;h=1f684a907c390444135b682f0be2f79dc68352db;hp=07079e571781da9c3ace36c24ac592e30d9a2c13 Fixed bug #355: YAZ proxy does not seem to load balance. Error was caused by seemingly clever logic that choosed backend with most spares.. But sometimes the one with most spares is much more used. Now the backend with minimum use is always used. --- diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 594435e..e59613e 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy.cpp,v 1.26 2005-05-18 20:15:23 adam Exp $ +/* $Id: yaz-proxy.cpp,v 1.27 2005-05-27 18:07:49 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -390,12 +390,6 @@ const char *Yaz_Proxy::load_balance(const char **url) max_spare = zurl_in_spare[i]; } } - // use the one with minimum connections if spare is > 3 - if (spare_for_min > 3) - return ret_min; - // use one with most spares (if any) - if (max_spare > 0) - return ret_spare; return ret_min; }