Skip to content

Commit 20900e8

Browse files
committed
remove unrelated codes and files
Signed-off-by: hwware <[email protected]>
1 parent 733c08b commit 20900e8

File tree

8 files changed

+2
-60
lines changed

8 files changed

+2
-60
lines changed

src/connection.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ struct connection {
134134
ConnectionCallbackFunc conn_handler;
135135
ConnectionCallbackFunc write_handler;
136136
ConnectionCallbackFunc read_handler;
137-
int connected_port;
138137
};
139138

140139
#define CONFIG_BINDADDR_MAX 16
@@ -319,9 +318,6 @@ static inline int connFormatAddr(connection *conn, char *buf, size_t buf_len, in
319318
return -1;
320319
}
321320

322-
if (!remote) {
323-
conn->connected_port = port;
324-
}
325321
return formatAddr(buf, buf_len, ip, port);
326322
}
327323

src/module.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,11 +1055,6 @@ void VM_KeyAtPos(ValkeyModuleCtx *ctx, int pos) {
10551055
VM_KeyAtPosWithFlags(ctx, pos, flags);
10561056
}
10571057

1058-
/* Return the connected server port of current client */
1059-
int VM_GetClientConnectedPort(ValkeyModuleCtx *ctx) {
1060-
return getClientConnectedPort(ctx->client);
1061-
}
1062-
10631058
/* Return non-zero if a module command, that was declared with the
10641059
* flag "getchannels-api", is called in a special way to get the channel positions
10651060
* and not to get executed. Otherwise zero is returned. */
@@ -13581,7 +13576,6 @@ void moduleRegisterCoreAPI(void) {
1358113576
REGISTER_API(Strdup);
1358213577
REGISTER_API(CreateCommand);
1358313578
REGISTER_API(GetCommand);
13584-
REGISTER_API(GetClientConnectedPort);
1358513579
REGISTER_API(CreateSubcommand);
1358613580
REGISTER_API(SetCommandInfo);
1358713581
REGISTER_API(SetCommandACLCategories);

src/networking.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,16 +3314,6 @@ char *getClientSockname(client *c) {
33143314
return c->sockname;
33153315
}
33163316

3317-
int getClientConnectedPort(client *c) {
3318-
char sockname[NET_ADDR_STR_LEN] = {0};
3319-
3320-
if (c->sockname == NULL) {
3321-
genClientAddrString(c, sockname, sizeof(sockname), 0);
3322-
c->sockname = sdsnew(sockname);
3323-
}
3324-
return c->conn->connected_port;
3325-
}
3326-
33273317
int isClientConnIpV6(client *c) {
33283318
/* The cached client peer id is on the form "[IPv6]:port" for IPv6
33293319
* addresses, so we just check for '[' here. */
@@ -3385,7 +3375,6 @@ sds catClientInfoString(sds s, client *client, int hide_user_data) {
33853375
replBufBlock *cur = listNodeValue(client->ref_repl_buf_node);
33863376
used_blocks_of_repl_buf = last->id - cur->id + 1;
33873377
}
3388-
33893378
sds ret = sdscatfmt(
33903379
s,
33913380
FMTARGS(

src/server.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,7 @@ void initListeners(void) {
29382938
listener->port = server.rdma_ctx_config.port;
29392939
listener->ct = connectionByType(CONN_TYPE_RDMA);
29402940
listener->priv = &server.rdma_ctx_config;
2941+
}
29412942

29422943
if (server.admin_port != 0) {
29432944
conn_index = connectionIndexByType(CONN_TYPE_SOCKET);
@@ -2946,7 +2947,7 @@ void initListeners(void) {
29462947
while (server.listeners[conn_index].ct != NULL) {
29472948
conn_index++;
29482949
if (conn_index >= CONN_TYPE_MAX) {
2949-
serverPanic("No available index for additional TCP listener.");
2950+
serverPanic("Failed finding connection listener of %s", CONN_TYPE_SOCKET);
29502951
}
29512952
}
29522953
listener = &server.listeners[conn_index];

src/server.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,6 @@ void freeClientReplyValue(void *o);
28722872
void *dupClientReplyValue(void *o);
28732873
char *getClientPeerId(client *client);
28742874
char *getClientSockName(client *client);
2875-
int getClientConnectedPort(client *client);
28762875
int isClientConnIpV6(client *c);
28772876
sds catClientInfoString(sds s, client *client, int hide_user_data);
28782877
sds catClientInfoShortString(sds s, client *client, int hide_user_data);

src/valkeymodule.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ VALKEYMODULE_API int (*ValkeyModule_CreateCommand)(ValkeyModuleCtx *ctx,
951951
int keystep) VALKEYMODULE_ATTR;
952952
VALKEYMODULE_API ValkeyModuleCommand *(*ValkeyModule_GetCommand)(ValkeyModuleCtx *ctx,
953953
const char *name)VALKEYMODULE_ATTR;
954-
VALKEYMODULE_API int (*ValkeyModule_GetClientConnectedPort)(ValkeyModuleCtx *ctx) VALKEYMODULE_ATTR;
955954
VALKEYMODULE_API int (*ValkeyModule_CreateSubcommand)(ValkeyModuleCommand *parent,
956955
const char *name,
957956
ValkeyModuleCmdFunc cmdfunc,
@@ -1668,7 +1667,6 @@ static int ValkeyModule_Init(ValkeyModuleCtx *ctx, const char *name, int ver, in
16681667
VALKEYMODULE_GET_API(Strdup);
16691668
VALKEYMODULE_GET_API(CreateCommand);
16701669
VALKEYMODULE_GET_API(GetCommand);
1671-
VALKEYMODULE_GET_API(GetClientConnectedPort);
16721670
VALKEYMODULE_GET_API(CreateSubcommand);
16731671
VALKEYMODULE_GET_API(SetCommandInfo);
16741672
VALKEYMODULE_GET_API(SetCommandACLCategories);

tests/modules/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ TEST_MODULES = \
5252
mallocsize.so \
5353
aclcheck.so \
5454
list.so \
55-
adminport.so \
5655
subcommands.so \
5756
reply.so \
5857
cmdintrospection.so \

tests/modules/adminport.c

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)