From a8fc6864fecdd403d70f06bb982f83de514b4082 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 12 Jun 2011 01:20:15 +0000 Subject: [PATCH] Fixed build on systems where TCP_NODELAY is not available --- src/appclient.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/appclient.c b/src/appclient.c index 712b897..0c737c9 100644 --- a/src/appclient.c +++ b/src/appclient.c @@ -345,9 +345,11 @@ static int _new_connect(AppClient * appclient, char const * app) sa.sin_port = htons(appinterface_get_port(appclient->interface)); if(_connect_addr(init, &sa.sin_addr.s_addr) != 0) return 1; +#ifdef TCP_NODELAY if(setsockopt(appclient->fd, SOL_SOCKET, TCP_NODELAY, &optval, sizeof(optval)) != 0) return error_set_code(1, "%s%s%s", init, ": ", strerror(errno)); +#endif if(connect(appclient->fd, (struct sockaddr *)&sa, sizeof(sa)) != 0) return error_set_code(1, "%s%s%s", init, ": ", strerror(errno)); #ifdef DEBUG