summaryrefslogtreecommitdiff
path: root/lib/libsndio/aucat.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libsndio/aucat.c')
-rw-r--r--lib/libsndio/aucat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c
index 76e71153e24..ba8016b43a1 100644
--- a/lib/libsndio/aucat.c
+++ b/lib/libsndio/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.46 2011/04/28 06:19:57 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.47 2011/05/02 22:24:23 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -21,6 +21,7 @@
#include <sys/un.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <netdb.h>
#include <errno.h>
@@ -281,7 +282,7 @@ bad_gen:
int
aucat_connect_tcp(struct aucat *hdl, char *host, char *unit, int isaudio)
{
- int s, error;
+ int s, error, opt;
struct addrinfo *ailist, *ai, aihints;
unsigned port;
char serv[NI_MAXSERV];
@@ -321,6 +322,12 @@ aucat_connect_tcp(struct aucat *hdl, char *host, char *unit, int isaudio)
freeaddrinfo(ailist);
if (s < 0)
return 0;
+ opt = 1;
+ if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(int)) < 0) {
+ DPERROR("setsockopt");
+ close(s);
+ return 0;
+ }
hdl->fd = s;
return 1;
}