mholt / caddy-l4

Layer 4 (TCP/UDP) app for Caddy
Apache License 2.0
922 stars 69 forks source link

fix: skip already seen routes after a match #196

Closed ydylla closed 3 months ago

ydylla commented 3 months ago

This is done to be backwards compatible with the old matching behavior see https://github.com/mholt/caddy-l4/pull/192#issuecomment-2143681952

ydylla commented 3 months ago

Sorry for the force pushs. I added

// Only skip once after a match, so it behaves like we continued after the match.
lastMatchedRouteIdx = -1

and moved the lastMatchedRouteIdx = i line to a better place.
It gets increasingly difficult to keep all situations in mind for this function.