Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,20 @@ public void setState(final JsonNode state) {
}

for (final InetRecord record : ipAddresses) {
if (record.getAddress() == ip4 && !ipv4Available) {
if (record.getAddress().equals(ip4) && !ipv4Available) {
newlyUnavailable.add(record);
LOGGER.debug("disabling IPv4 address " + record.getAddress());
}
if (record.getAddress() == ip6 && !ipv6Available) {
if (record.getAddress().equals(ip6) && !ipv6Available) {
newlyUnavailable.add(record);
LOGGER.debug("disabling IPv6 address " + record.getAddress());
}
}

for (final InetRecord record : unavailableIpAddresses) {
if (record.getAddress() == ip4 && ipv4Available) {
if (record.getAddress().equals(ip4) && ipv4Available) {
newlyAvailable.add(record);
LOGGER.debug("enabling IPv4 address " + record.getAddress());
}
if (record.getAddress() == ip6 && ipv6Available) {
if (record.getAddress().equals(ip6) && ipv6Available) {
newlyAvailable.add(record);
LOGGER.debug("enabling IPv6 address " + record.getAddress());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import java.io.IOException;
import java.net.InetAddress;
import java.net.Inet4Address;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
Expand Down Expand Up @@ -812,10 +811,8 @@ public HTTPRouteResult multiRoute(final HTTPRequest request, final Track track)
final DeliveryService ds = steeringResult.getDeliveryService();
List<Cache> caches = selectCaches(request, ds, track);

try {
caches = editCacheListForIpVersion(InetAddress.getByName(request.getClientIP()) instanceof Inet4Address, caches);
} catch (UnknownHostException e) {
LOGGER.debug("Could not parse IP, accepting cache list as is.");
if (caches != null) {
caches = editCacheListForIpVersion(!request.getClientIP().contains(":"), caches);
}
// child Delivery Services can use their query parameters
final String pathToHash = steeringHash + ds.extractSignificantQueryParams(request);
Expand Down Expand Up @@ -862,7 +859,7 @@ public HTTPRouteResult multiRoute(final HTTPRequest request, final Track track)
* Creates a string to be used in consistent hashing.
*<p>
* This uses simply the request path by default, but will consider any and all Query Parameters
* that are in deliveryService's {@link DeliveryService.consistentHashQueryParams} set as well.
* that are in deliveryService's {@link DeliveryService} consistentHashQueryParam set as well.
* It will also fall back on the request path if the query parameters are not UTF-8-encoded.
*</p>
* @param deliveryService The {@link DeliveryService} being requested
Expand Down Expand Up @@ -949,10 +946,8 @@ public HTTPRouteResult singleRoute(final HTTPRequest request, final Track track)
routeResult.setDeliveryService(deliveryService);

List<Cache> caches = selectCaches(request, deliveryService, track);
try {
caches = editCacheListForIpVersion(InetAddress.getByName(request.getClientIP()) instanceof Inet4Address, caches);
} catch (UnknownHostException e) {
LOGGER.debug("Could not parse IP, accepting cache list as is.");
if (caches != null) {
caches = editCacheListForIpVersion(!request.getClientIP().contains(":"), caches);
}

if (caches == null || caches.isEmpty()) {
Expand Down Expand Up @@ -1491,8 +1486,6 @@ private CacheLocation getClosestCacheLocation(final List<CacheLocation> cacheLoc
* the caches that will considered
* @param ds
* the delivery service for the request
* @param request
* the request to consider for cache selection
* @return the selected cache or null if none can be found
*/
private List<Cache> selectCaches(final CacheLocation location, final DeliveryService ds) {
Expand Down