summaryrefslogtreecommitdiff
path: root/kike.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-11-22 02:12:52 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-11-22 02:12:52 +0100
commit36c59ff375ea2399961df54403676e8e8457f4b6 (patch)
tree61d1a56dcd12107036d45fb3ca90d2968fa14558 /kike.c
parent71f3532e04e5c76327363a3fd36b506f54e5043d (diff)
downloadxK-36c59ff375ea2399961df54403676e8e8457f4b6.tar.gz
xK-36c59ff375ea2399961df54403676e8e8457f4b6.tar.xz
xK-36c59ff375ea2399961df54403676e8e8457f4b6.zip
Enable TCP_NODELAY
Diffstat (limited to 'kike.c')
-rw-r--r--kike.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kike.c b/kike.c
index 4fabced..6cc3bcb 100644
--- a/kike.c
+++ b/kike.c
@@ -3421,6 +3421,13 @@ irc_try_fetch_client (struct server_context *ctx, int listen_fd)
c->ping_timer.dispatcher = on_client_ping_timer;
c->ping_timer.user_data = c;
+ // A little bit questionable once the traffic gets high enough (IMO),
+ // but it reduces silly latencies that we don't need because we already
+ // do buffer our output
+ int yes = 1;
+ soft_assert (setsockopt (fd, IPPROTO_TCP, TCP_NODELAY,
+ &yes, sizeof yes) != -1);
+
set_blocking (fd, false);
client_update_poller (c, NULL);
client_set_kill_timer (c);