From de08b42f7dd90588b107347186c4525ba0648e14 Mon Sep 17 00:00:00 2001 From: dborth Date: Sun, 27 Jun 2010 00:43:20 +0000 Subject: [PATCH] turn off Nagle --- source/utils/http.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/utils/http.cpp b/source/utils/http.cpp index 4185c62..f4a6526 100644 --- a/source/utils/http.cpp +++ b/source/utils/http.cpp @@ -38,10 +38,14 @@ static s32 tcp_socket(void) { s32 s, res; - s = net_socket(PF_INET, SOCK_STREAM, 0); + s = net_socket(PF_INET, SOCK_STREAM, IPPROTO_IP); if (s < 0) return s; + // Switch off Nagle with TCP_NODELAY + u32 nodelay = 1; + net_setsockopt(s,IPPROTO_TCP,TCP_NODELAY,&nodelay,sizeof(nodelay)); + res = net_fcntl(s, F_GETFL, 0); if (res < 0) {