mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Reverse redirect address parse
Fix issue in case the redirect address is in ipv6 format. Parse from behind to extract last part of the response which represents actual port.
This commit is contained in:
parent
aa953b6ec3
commit
c30ffaab05
@ -665,7 +665,7 @@ static int cliReadReply(int output_raw_strings) {
|
|||||||
p = strchr(s+1,' '); /* MOVED[S]3999[P]127.0.0.1:6381 */
|
p = strchr(s+1,' '); /* MOVED[S]3999[P]127.0.0.1:6381 */
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
slot = atoi(s+1);
|
slot = atoi(s+1);
|
||||||
s = strchr(p+1,':'); /* MOVED 3999[P]127.0.0.1[S]6381 */
|
s = strrchr(p+1,':'); /* MOVED 3999[P]127.0.0.1[S]6381 */
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
sdsfree(config.hostip);
|
sdsfree(config.hostip);
|
||||||
config.hostip = sdsnew(p+1);
|
config.hostip = sdsnew(p+1);
|
||||||
|
Loading…
Reference in New Issue
Block a user