aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-05 19:00:38 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-05 19:00:38 +0800
commita2a42a7561dcbc7d0ed66e2705692c096102de0e (patch)
tree5037152e6866b1a6888b83cc94bab46b2a5fb804
parentebd57da87d6499506aabf65b76d43904490b9eaa (diff)
bsc_msc_ip: Attempt to disable nagle
Use TCP_NODELAY on the connection to the MSC. We want small messages to be send immediately.
-rw-r--r--openbsc/src/bsc_msc_ip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c
index e4adf03b..3cd41f45 100644
--- a/openbsc/src/bsc_msc_ip.c
+++ b/openbsc/src/bsc_msc_ip.c
@@ -30,6 +30,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
+#include <netinet/tcp.h>
#include <arpa/inet.h>
#define _GNU_SOURCE
@@ -917,6 +918,12 @@ static void msc_ping_timeout_cb(void *data)
static void msc_connection_connected(struct bsc_msc_connection *con)
{
+ int ret, on;
+ on = 1;
+ ret = setsockopt(con->write_queue.bfd.fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ if (ret != 0)
+ LOGP(DMSC, LOGL_ERROR, "Failed to set TCP_NODELAY: %s\n", strerror(errno));
+
msc_ping_timeout_cb(con);
}