Skip to content

Commit

Permalink
remove unrelated codes and files
Browse files Browse the repository at this point in the history
  • Loading branch information
hwware committed Dec 5, 2024
1 parent b1063ab commit 08aebb5
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 60 deletions.
4 changes: 0 additions & 4 deletions src/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ struct connection {
ConnectionCallbackFunc conn_handler;
ConnectionCallbackFunc write_handler;
ConnectionCallbackFunc read_handler;
int connected_port;
};

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

if (!remote) {
conn->connected_port = port;
}
return formatAddr(buf, buf_len, ip, port);
}

Expand Down
6 changes: 0 additions & 6 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,11 +1055,6 @@ void VM_KeyAtPos(ValkeyModuleCtx *ctx, int pos) {
VM_KeyAtPosWithFlags(ctx, pos, flags);
}

/* Return the connected server port of current client */
int VM_GetClientConnectedPort(ValkeyModuleCtx *ctx) {
return getClientConnectedPort(ctx->client);
}

/* Return non-zero if a module command, that was declared with the
* flag "getchannels-api", is called in a special way to get the channel positions
* and not to get executed. Otherwise zero is returned. */
Expand Down Expand Up @@ -13579,7 +13574,6 @@ void moduleRegisterCoreAPI(void) {
REGISTER_API(Strdup);
REGISTER_API(CreateCommand);
REGISTER_API(GetCommand);
REGISTER_API(GetClientConnectedPort);
REGISTER_API(CreateSubcommand);
REGISTER_API(SetCommandInfo);
REGISTER_API(SetCommandACLCategories);
Expand Down
11 changes: 0 additions & 11 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -3314,16 +3314,6 @@ char *getClientSockname(client *c) {
return c->sockname;
}

int getClientConnectedPort(client *c) {
char sockname[NET_ADDR_STR_LEN] = {0};

if (c->sockname == NULL) {
genClientAddrString(c, sockname, sizeof(sockname), 0);
c->sockname = sdsnew(sockname);
}
return c->conn->connected_port;
}

int isClientConnIpV6(client *c) {
/* The cached client peer id is on the form "[IPv6]:port" for IPv6
* addresses, so we just check for '[' here. */
Expand Down Expand Up @@ -3384,7 +3374,6 @@ sds catClientInfoString(sds s, client *client, int hide_user_data) {
replBufBlock *cur = listNodeValue(client->ref_repl_buf_node);
used_blocks_of_repl_buf = last->id - cur->id + 1;
}

sds ret = sdscatfmt(
s,
FMTARGS(
Expand Down
3 changes: 2 additions & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -2877,6 +2877,7 @@ void initListeners(void) {
listener->port = server.rdma_ctx_config.port;
listener->ct = connectionByType(CONN_TYPE_RDMA);
listener->priv = &server.rdma_ctx_config;
}

if (server.admin_port != 0) {
conn_index = connectionIndexByType(CONN_TYPE_SOCKET);
Expand All @@ -2885,7 +2886,7 @@ void initListeners(void) {
while (server.listeners[conn_index].ct != NULL) {
conn_index++;
if (conn_index >= CONN_TYPE_MAX) {
serverPanic("No available index for additional TCP listener.");
serverPanic("Failed finding connection listener of %s", CONN_TYPE_SOCKET);
}
}
listener = &server.listeners[conn_index];
Expand Down
1 change: 0 additions & 1 deletion src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,6 @@ void freeClientReplyValue(void *o);
void *dupClientReplyValue(void *o);
char *getClientPeerId(client *client);
char *getClientSockName(client *client);
int getClientConnectedPort(client *client);
int isClientConnIpV6(client *c);
sds catClientInfoString(sds s, client *client, int hide_user_data);
sds catClientInfoShortString(sds s, client *client, int hide_user_data);
Expand Down
2 changes: 0 additions & 2 deletions src/valkeymodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,6 @@ VALKEYMODULE_API int (*ValkeyModule_CreateCommand)(ValkeyModuleCtx *ctx,
int keystep) VALKEYMODULE_ATTR;
VALKEYMODULE_API ValkeyModuleCommand *(*ValkeyModule_GetCommand)(ValkeyModuleCtx *ctx,
const char *name)VALKEYMODULE_ATTR;
VALKEYMODULE_API int (*ValkeyModule_GetClientConnectedPort)(ValkeyModuleCtx *ctx) VALKEYMODULE_ATTR;
VALKEYMODULE_API int (*ValkeyModule_CreateSubcommand)(ValkeyModuleCommand *parent,
const char *name,
ValkeyModuleCmdFunc cmdfunc,
Expand Down Expand Up @@ -1668,7 +1667,6 @@ static int ValkeyModule_Init(ValkeyModuleCtx *ctx, const char *name, int ver, in
VALKEYMODULE_GET_API(Strdup);
VALKEYMODULE_GET_API(CreateCommand);
VALKEYMODULE_GET_API(GetCommand);
VALKEYMODULE_GET_API(GetClientConnectedPort);
VALKEYMODULE_GET_API(CreateSubcommand);
VALKEYMODULE_GET_API(SetCommandInfo);
VALKEYMODULE_GET_API(SetCommandACLCategories);
Expand Down
1 change: 0 additions & 1 deletion tests/modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ TEST_MODULES = \
mallocsize.so \
aclcheck.so \
list.so \
adminport.so \
subcommands.so \
reply.so \
cmdintrospection.so \
Expand Down
34 changes: 0 additions & 34 deletions tests/modules/adminport.c

This file was deleted.

0 comments on commit 08aebb5

Please sign in to comment.