* net.cc (fdsock): Disable raising buffer sizes. Add comment to
explain why.
This commit is contained in:
parent
d73228210d
commit
8f56da762a
@ -1,3 +1,8 @@
|
|||||||
|
2006-06-12 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* net.cc (fdsock): Disable raising buffer sizes. Add comment to
|
||||||
|
explain why.
|
||||||
|
|
||||||
2006-06-04 Christopher Faylor <cgf@timesys.com>
|
2006-06-04 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
* ioctl.cc (ioctl): Accommodate change in reported pty master device
|
* ioctl.cc (ioctl): Accommodate change in reported pty master device
|
||||||
|
@ -557,15 +557,26 @@ fdsock (cygheap_fdmanip& fd, const device *dev, SOCKET soc)
|
|||||||
fd->uninterruptible_io (true);
|
fd->uninterruptible_io (true);
|
||||||
cygheap->fdtab.inc_need_fixup_before ();
|
cygheap->fdtab.inc_need_fixup_before ();
|
||||||
debug_printf ("fd %d, name '%s', soc %p", (int) fd, dev->name, soc);
|
debug_printf ("fd %d, name '%s', soc %p", (int) fd, dev->name, soc);
|
||||||
|
#if 0
|
||||||
|
/* Same default buffer sizes as on Linux (instead of WinSock default 8K).
|
||||||
|
|
||||||
|
NOT. If the SO_RCVBUF size exceeds 65535(*), and if the socket is
|
||||||
|
connected to a remote machine, then duplicating the socket on
|
||||||
|
fork/exec fails with WinSock error 10022, WSAEINVAL. Given that,
|
||||||
|
there's not any good reason to set the buffer sizes at all. So we
|
||||||
|
stick with the defaults. However, an explanation for this weird
|
||||||
|
behaviour would be nice. I keep this stuff in the code for later
|
||||||
|
generations. Archeological programmers might find it useful.
|
||||||
|
|
||||||
|
(*) Maximum normal TCP window size. Coincidence? */
|
||||||
|
|
||||||
/* Same default buffer sizes as on Linux (instead of WinSock default 8K). */
|
|
||||||
int rmem = dev == tcp_dev ? 87380 : 120832;
|
int rmem = dev == tcp_dev ? 87380 : 120832;
|
||||||
int wmem = dev == tcp_dev ? 16384 : 120832;
|
int wmem = dev == tcp_dev ? 16384 : 120832;
|
||||||
if (::setsockopt (soc, SOL_SOCKET, SO_RCVBUF, (char *) &rmem, sizeof (int)))
|
if (::setsockopt (soc, SOL_SOCKET, SO_RCVBUF, (char *) &rmem, sizeof (int)))
|
||||||
debug_printf ("setsockopt(SO_RCVBUF) failed, %lu", WSAGetLastError ());
|
debug_printf ("setsockopt(SO_RCVBUF) failed, %lu", WSAGetLastError ());
|
||||||
if (::setsockopt (soc, SOL_SOCKET, SO_SNDBUF, (char *) &wmem, sizeof (int)))
|
if (::setsockopt (soc, SOL_SOCKET, SO_SNDBUF, (char *) &wmem, sizeof (int)))
|
||||||
debug_printf ("setsockopt(SO_SNDBUF) failed, %lu", WSAGetLastError ());
|
debug_printf ("setsockopt(SO_SNDBUF) failed, %lu", WSAGetLastError ());
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user