summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorzhenwei pi <pizhenwei@bytedance.com>2022-07-27 09:30:38 +0800
committerzhenwei pi <pizhenwei@bytedance.com>2022-08-22 15:01:01 +0800
commitdca5c6ff114b69213ee3c14530e0ed20169d86b0 (patch)
tree2d7b41ddfb40c953f224ae08b763f13130ecf4df /src/socket.c
parent22e74e4720f6f4629389d42fb344c876b73437bf (diff)
downloadredis-dca5c6ff114b69213ee3c14530e0ed20169d86b0.tar.gz
Move several conn functions to connection.h
These functions are really short enough and they are the connection functions, separate them from the socket source. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/socket.c b/src/socket.c
index f61ed2404..5372510d0 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -118,26 +118,6 @@ static int connSocketConnect(connection *conn, const char *addr, int port, const
return C_OK;
}
-/* Returns true if a write handler is registered */
-int connHasWriteHandler(connection *conn) {
- return conn->write_handler != NULL;
-}
-
-/* Returns true if a read handler is registered */
-int connHasReadHandler(connection *conn) {
- return conn->read_handler != NULL;
-}
-
-/* Associate a private data pointer with the connection */
-void connSetPrivateData(connection *conn, void *data) {
- conn->private_data = data;
-}
-
-/* Get the associated private data pointer */
-void *connGetPrivateData(connection *conn) {
- return conn->private_data;
-}
-
/* ------ Pure socket connections ------- */
/* A very incomplete list of implementation-specific calls. Much of the above shall
@@ -437,17 +417,3 @@ int connRecvTimeout(connection *conn, long long ms) {
return anetRecvTimeout(NULL, conn->fd, ms);
}
-int connGetState(connection *conn) {
- return conn->state;
-}
-
-/* Return a text that describes the connection, suitable for inclusion
- * in CLIENT LIST and similar outputs.
- *
- * For sockets, we always return "fd=<fdnum>" to maintain compatibility.
- */
-const char *connGetInfo(connection *conn, char *buf, size_t buf_len) {
- snprintf(buf, buf_len-1, "fd=%i", conn == NULL ? -1 : conn->fd);
- return buf;
-}
-