summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-01-25 02:54:17 +0300
committerunknown <konstantin@mysql.com>2005-01-25 02:54:17 +0300
commit9531db91277fb88de0ee07b3e5aa062ca146ebfd (patch)
tree9a0ff023f407b52faca39a6844ea3283d9700c05 /vio
parentc312cf2762cfc68abaebd87294331f599a522436 (diff)
parentdc43c6ea4b2bd3c466049674b4c760cad9ad2979 (diff)
downloadmariadb-git-9531db91277fb88de0ee07b3e5aa062ca146ebfd.tar.gz
Merge mysql.com:/home/kostja/work/mysql-4.1-5787
into mysql.com:/home/kostja/work/mysql-5.0-root vio/viosocket.c: Auto merged
Diffstat (limited to 'vio')
-rw-r--r--vio/viosocket.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/vio/viosocket.c b/vio/viosocket.c
index de50dabba5f..858faac4f1e 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -142,23 +142,29 @@ int vio_fastsend(Vio * vio __attribute__((unused)))
int r=0;
DBUG_ENTER("vio_fastsend");
-#ifdef IPTOS_THROUGHPUT
+#if defined(IPTOS_THROUGHPUT) && !defined(__EMX__)
{
-#ifndef __EMX__
int tos = IPTOS_THROUGHPUT;
- if (!setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos)))
-#endif /* !__EMX__ */
- {
- int nodelay = 1;
- if (setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void *) &nodelay,
- sizeof(nodelay))) {
- DBUG_PRINT("warning",
- ("Couldn't set socket option for fast send"));
- r= -1;
- }
- }
+ r= setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos));
+ }
+#endif /* IPTOS_THROUGHPUT && !__EMX__ */
+ if (!r)
+ {
+#ifdef __WIN__
+ BOOL nodelay= 1;
+ r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (const char*) &nodelay,
+ sizeof(nodelay));
+#else
+ int nodelay = 1;
+ r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void*) &nodelay,
+ sizeof(nodelay));
+#endif /* __WIN__ */
+ }
+ if (r)
+ {
+ DBUG_PRINT("warning", ("Couldn't set socket option for fast send"));
+ r= -1;
}
-#endif /* IPTOS_THROUGHPUT */
DBUG_PRINT("exit", ("%d", r));
DBUG_RETURN(r);
}