Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-04-04 13:54:25 +0400
committerCorinna Vinschen <corinna@vinschen.de>2006-04-04 13:54:25 +0400
commit8ca521afe95550d903b4fe2cfbb170d6791b47d6 (patch)
tree4b350ef8128564c8ee28a4ad6fc4b34d8af5b765 /winsup/cygwin/net.cc
parent9dbb0bc355bca76a616b76abcd1682a3e0314653 (diff)
* net.cc (fdsock): Raise default SO_RCVBUF/SO_SNDBUF buffer sizes to
the same values as on Linux.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 91d18fd65..baf0c0c95 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -557,6 +557,15 @@ fdsock (cygheap_fdmanip& fd, const device *dev, SOCKET soc)
fd->uninterruptible_io (true);
cygheap->fdtab.inc_need_fixup_before ();
debug_printf ("fd %d, name '%s', soc %p", (int) fd, dev->name, soc);
+
+ /* Same default buffer sizes as on Linux (instead of WinSock default 8K). */
+ int rmem = dev == tcp_dev ? 87380 : 120832;
+ int wmem = dev == tcp_dev ? 16384 : 120832;
+ if (::setsockopt (soc, SOL_SOCKET, SO_RCVBUF, (char *) &rmem, sizeof (int)))
+ debug_printf ("setsockopt(SO_RCVBUF) failed, %lu", WSAGetLastError ());
+ if (::setsockopt (soc, SOL_SOCKET, SO_SNDBUF, (char *) &wmem, sizeof (int)))
+ debug_printf ("setsockopt(SO_SNDBUF) failed, %lu", WSAGetLastError ());
+
return true;
}