INN commit: trunk/nnrpd (nnrpd.c)
INN Commit
Russ_Allbery at isc.org
Mon Mar 23 06:58:49 UTC 2009
Date: Sunday, March 22, 2009 @ 23:58:48
Author: iulius
Revision: 8391
Add TCP_NODELAY to nnrpd in order to fix an issue of slow downloading
of overviews and slow answers on some architectures (like BSD/OS).
Patch suggested by David Canzi.
Modified:
trunk/nnrpd/nnrpd.c
---------+
nnrpd.c | 6 ++++++
1 file changed, 6 insertions(+)
Modified: nnrpd.c
===================================================================
--- nnrpd.c 2009-03-23 06:50:17 UTC (rev 8390)
+++ nnrpd.c 2009-03-23 06:58:48 UTC (rev 8391)
@@ -14,6 +14,7 @@
#include "portable/wait.h"
#include <netdb.h>
#include <signal.h>
+#include <netinet/tcp.h>
#if HAVE_GETSPNAM
# include <shadow.h>
@@ -535,6 +536,7 @@
struct sockaddr *sas = (struct sockaddr *) &sss;
socklen_t length;
size_t size;
+ int nodelay = 1;
memset(&Client, 0, sizeof(Client));
strlcpy(Client.host, "?", sizeof(Client.host));
@@ -603,6 +605,10 @@
Client.serverport = network_sockaddr_port(sas);
}
+ /* Setting TCP_NODELAY to nnrpd fixes a problem of slow downloading
+ * of overviews and slow answers on some architectures (like BSD/OS). */
+ setsockopt(STDIN_FILENO, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay));
+
notice("%s (%s) connect", Client.host, Client.ip);
PERMgetaccess(NNRPACCESS);
More information about the inn-committers
mailing list