--- loncom/lonnet/perl/lonnet.pm 2020/10/15 19:17:40 1.1429 +++ loncom/lonnet/perl/lonnet.pm 2020/10/20 01:38:12 1.1430 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1429 2020/10/15 19:17:40 raeburn Exp $ +# $Id: lonnet.pm,v 1.1430 2020/10/20 01:38:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1646,7 +1646,7 @@ sub check_loadbalancing { if ($domneedscache) { &do_cache_new('loadbalancing',$domneedscache,$is_balancer,$cachetime); } - if ($is_balancer) { + if (($is_balancer) && ($caller ne 'switchserver')) { my $lowest_load = 30000; if (ref($offloadto) eq 'HASH') { if (ref($offloadto->{'primary'}) eq 'ARRAY') { @@ -1686,9 +1686,9 @@ sub check_loadbalancing { } } } - unless ($homeintdom) { - undef($setcookie); - } + } + if (($is_balancer) && (!$homeintdom)) { + undef($setcookie); } return ($is_balancer,$otherserver,$setcookie,$offloadto,$dom_balancers); }