diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2016-07-14 19:40:50 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2016-07-14 19:40:50 +0000 |
commit | 49a5faa1c215044eec860f6ec15a22b57bdb0d5c (patch) | |
tree | 51fe50561b04776c42c1c8977ce7fdb0304860f0 /vio/viosocket.c | |
parent | 90a3eeba76835962fc39f5c4e398d1c921640520 (diff) | |
download | mariadb-git-10.2-wlad-batch-mode.tar.gz |
Dump skip_flush, queries get stuck. Instead, just allow to switch on Nagle's algorithm temporarily10.2-wlad-batch-mode
Diffstat (limited to 'vio/viosocket.c')
-rw-r--r-- | vio/viosocket.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/vio/viosocket.c b/vio/viosocket.c index a33de48c020..07848a66ec7 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -448,6 +448,17 @@ int vio_socket_timeout(Vio *vio, DBUG_RETURN(ret); } +int vio_set_nodelay(Vio * vio, int nodelay) +{ + if (vio->type == VIO_TYPE_NAMEDPIPE || vio->type == VIO_TYPE_SHARED_MEMORY) + { + return; + } + return mysql_socket_setsockopt(vio->mysql_socket, IPPROTO_TCP, TCP_NODELAY, + IF_WIN((const char*), (void*)) &nodelay, + sizeof(nodelay)); +} + int vio_fastsend(Vio * vio __attribute__((unused))) { @@ -468,16 +479,7 @@ int vio_fastsend(Vio * vio __attribute__((unused))) #endif /* IPTOS_THROUGHPUT */ if (!r) { -#ifdef __WIN__ - BOOL nodelay= 1; -#else - int nodelay = 1; -#endif - - r= mysql_socket_setsockopt(vio->mysql_socket, IPPROTO_TCP, TCP_NODELAY, - IF_WIN((const char*), (void*)) &nodelay, - sizeof(nodelay)); - + r= vio_set_nodelay(vio, 1); } if (r) { |