summaryrefslogtreecommitdiff
path: root/src/common/socket.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-02-18 22:32:25 +0300
committerAndrei Karas <akaras@inbox.ru>2019-03-11 03:04:57 +0300
commitdd742ed655c1d6344c8ca88f86f246200da32b04 (patch)
treeea0618ff45f0e45af32f8d57f5d11cc0a84a4cfd /src/common/socket.c
parentca315dcb6f8ba435beedc9c1a5bff12194bccc72 (diff)
downloadhercules-dd742ed655c1d6344c8ca88f86f246200da32b04.tar.gz
hercules-dd742ed655c1d6344c8ca88f86f246200da32b04.tar.bz2
hercules-dd742ed655c1d6344c8ca88f86f246200da32b04.tar.xz
hercules-dd742ed655c1d6344c8ca88f86f246200da32b04.zip
Add function connect_client into socket interface
Diffstat (limited to 'src/common/socket.c')
-rw-r--r--src/common/socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index 95d8bf578..2dda7d008 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -462,7 +462,7 @@ static int recv_to_fifo(int fd)
socket_data_ci += len;
}
#endif // SHOW_SERVER_STATS
- return 0;
+ return (int)len;
}
static int send_from_fifo(int fd)
@@ -648,7 +648,7 @@ static int make_listen_bind(uint32 ip, uint16 port)
if(sockt->fd_max <= fd) sockt->fd_max = fd + 1;
- create_session(fd, connect_client, null_send, null_parse);
+ create_session(fd, sockt->connect_client, null_send, null_parse);
sockt->session[fd]->client_addr = 0; // just listens
sockt->session[fd]->rdata_tick = 0; // disable timeouts on this socket
return fd;
@@ -2177,6 +2177,7 @@ void socket_defaults(void)
/* */
sockt->flush = flush_fifo;
sockt->flush_fifos = flush_fifos;
+ sockt->connect_client = connect_client;
sockt->set_nonblocking = set_nonblocking;
sockt->set_defaultparse = set_defaultparse;
sockt->host2ip = host2ip;