Disable Nagle in iprop master and slave

This commit is contained in:
Viktor Dukhovni
2019-09-21 18:29:12 -04:00
committed by Nico Williams
parent 0334472ab5
commit 96fd393d29
5 changed files with 33 additions and 0 deletions

View File

@@ -99,6 +99,15 @@ connect_to_master (krb5_context context, const char *master,
if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof(one)) < 0)
krb5_warn(context, errno, "setsockopt(SO_KEEPALIVE) failed");
/*
* We write message lengths separately from the payload, avoid Nagle
* delays.
*/
#if defined(IPPROTO_TCP) && defined(TCP_NODELAY)
(void) setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
(void *)&one, sizeof(one));
#endif
return s;
}