From 144ebc9c638d31e784214bebc3760da3c055cf03 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Sun, 9 Jul 2023 17:18:45 +0200 Subject: [PATCH] Depth: enable comparison with lengths >255 [hack?] The "infinity and beyond" authentication test performs a comparison against a length > 255. Transforming that length into a "Depth" object for comparison failed without this patch. --- .../src/main/kotlin/org/pgpainless/wot/network/Depth.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Depth.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Depth.kt index 6864c760..30552067 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Depth.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Depth.kt @@ -34,7 +34,7 @@ class Depth private constructor(val limit: Int?) : Comparable { */ @JvmStatic fun auto(limit: Int): Depth { - return if (limit == 255) { + return if (limit >= 255) { unconstrained() } else { limited(limit)