summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-06-01 16:13:24 -0700
committerjimw@mysql.com <>2005-06-01 16:13:24 -0700
commit5a271e2c12c7970e126c825d5922f987cf0465a6 (patch)
tree07b48233d1829d6cc6c83b78c6070346624e4d2f /vio
parenta60bdadb316dbcbcc6cd24367fd0db201664b9ca (diff)
parentfb51d6eca585af2e940c103f88f035300e399be5 (diff)
downloadmariadb-git-5a271e2c12c7970e126c825d5922f987cf0465a6.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
Diffstat (limited to 'vio')
-rw-r--r--vio/viossl.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/vio/viossl.c b/vio/viossl.c
index 4233b276346..9a5eb1eb8df 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -128,26 +128,32 @@ int vio_ssl_write(Vio * vio, const gptr buf, int size)
int vio_ssl_fastsend(Vio * vio __attribute__((unused)))
{
- int r= 0;
+ int r=0;
DBUG_ENTER("vio_ssl_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;
- }
- }
+ int tos= IPTOS_THROUGHPUT;
+ 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);
}
@@ -427,6 +433,11 @@ void vio_ssl_timeout(Vio *vio __attribute__((unused)),
uint which __attribute__((unused)),
uint timeout __attribute__((unused)))
{
- /* Not yet implemented (non critical) */
+#ifdef __WIN__
+ ulong wait_timeout= (ulong) timeout * 1000;
+ (void) setsockopt(vio->sd, SOL_SOCKET,
+ which ? SO_SNDTIMEO : SO_RCVTIMEO, (char*) &wait_timeout,
+ sizeof(wait_timeout));
+#endif /* __WIN__ */
}
#endif /* HAVE_OPENSSL */