From 64205345bcaf20d322b96a464a03912e33faff78 Mon Sep 17 00:00:00 2001 From: WuYunlong Date: Thu, 23 Jun 2022 23:41:32 +0800 Subject: [PATCH] migrateGetSocket() cleanup.. (#5546) I think parameter c is only useful to get client reply. Besides, other commands' host and port parameters may not be the at index 1 and 2. --- src/cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index a5d614815..e194ce27d 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -6097,7 +6097,7 @@ migrateCachedSocket* migrateGetSocket(client *c, robj *host, robj *port, long ti /* Create the socket */ conn = server.tls_cluster ? connCreateTLS() : connCreateSocket(); - if (connBlockingConnect(conn, c->argv[1]->ptr, atoi(c->argv[2]->ptr), timeout) + if (connBlockingConnect(conn, host->ptr, atoi(port->ptr), timeout) != C_OK) { addReplyError(c,"-IOERR error or timeout connecting to the client"); connClose(conn);