Nordix / hiredis-cluster

C client library for Valkey/Redis Cluster. This project is used and sponsored by Ericsson. It is a fork of the now unmaintained hiredis-vip.
BSD 3-Clause "New" or "Revised" License
87 stars 42 forks source link

Correct parsing of an IPv6 address in an ASK redirect #161

Closed bjosv closed 1 year ago

bjosv commented 1 year ago

When parsing the endpoint in an ASK redirect response the last occurance of the port separator : needs to be looked for since IPv6 addresses can contain this character. Previously the first was used which gives parse errors.

This PR includes a test to trigger the fault and to verify the correction. This includes an added option --ipv6 to simulated-redis.pl to be able to start a IPv6 server.

bjosv commented 1 year ago

Added a OOM testcase to make sure there are no problems with missed cleanups.

bjosv commented 1 year ago

Was the MOVED parsing already correct?

Currently MOVED only triggers a slotmap update, then the message is resent using the new nodetable.. We should change so that we use the given address as well, but I guess we can do that in a separated PR.

bjosv commented 1 year ago

Updated the testcase comments, both general comments on top of file and within the redirection part added in this PR.