Balancer input ignores replies of local addresses to prevent loops, load balancer itself updated to not sent self-answers to servers.

This commit is contained in:
Thulinma 2018-07-09 11:23:21 +02:00
parent eeffba15ad
commit 5b059dcf6f
3 changed files with 13 additions and 1 deletions

View file

@ -60,6 +60,12 @@ namespace Mist {
while ((Util::epoch() - startTime < 10) && (balConn || balConn.Received().size())){
if (balConn.spool() || balConn.Received().size()){
if (http.Read(balConn.Received().get())){
HTTP::URL newUrl(http.body);
if (Socket::isLocalhost(newUrl.host)){
WARN_MSG("Load balancer returned a local address - ignoring");
startTime = 0;
break;//break out of while loop, ignore return value - it's local.
}
source = http.body;
startTime = 0;//note success
break;//break out of while loop