summaryrefslogtreecommitdiff
path: root/libraries/libvmime-zarafa/zarafa-patches/vmime-socket-tcp-nodelay.diff
blob: 1a1f5906795835e7a1018d47b55a1ca79ee54bf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- libvmime-0.7.1.orig/src/platforms/posix/posixSocket.cpp	2005-03-18 22:26:49.000000000 +0100
+++ libvmime-0.7.1.patched/src/platforms/posix/posixSocket.cpp	2009-03-27 10:51:06.405594549 +0100
@@ -24,6 +24,7 @@
 #include <arpa/inet.h>
 #include <sys/types.h>
 #include <netinet/in.h>
+#include <netinet/tcp.h>
 #include <netdb.h>
 #include <fcntl.h>
 
@@ -57,6 +58,8 @@
 
 void posixSocket::connect(const vmime::string& address, const vmime::port_t port)
 {
+	int flag = 1;
+
 	// Close current connection, if any
 	if (m_desc != -1)
 	{
@@ -92,6 +95,8 @@
 	if (m_desc == -1)
 		throw vmime::exceptions::connection_error("Error while creating socket.");
 
+	::setsockopt(m_desc, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag));
+
 	// Start connection
 	if (::connect(m_desc, reinterpret_cast <sockaddr*>(&addr), sizeof(addr)) == -1)
 	{