From 631681619e1b1d1eef2b154ab14db7d803922dca Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 4 Aug 2009 22:35:35 +0000 Subject: [PATCH] * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem size if the length exceeds it. * net.cc (fdsock): Use 65535 as window size, just like the comment says or we run into problems with DuplicateHandle. * path.cc (patch_conv::check): Use set_path to set invalid filename. * path.h (path_conv::path_conv): Ditto. --- winsup/cygwin/ChangeLog | 10 ++++++++++ winsup/cygwin/fhandler_socket.cc | 2 +- winsup/cygwin/net.cc | 4 ++-- winsup/cygwin/path.cc | 2 +- winsup/cygwin/path.h | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 977cf609b..5bc839582 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,13 @@ +2009-08-04 Christopher Faylor + + * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem + size if the length exceeds it. + * net.cc (fdsock): Use 65535 as window size, just like the comment + says or we run into problems with DuplicateHandle. + + * path.cc (patch_conv::check): Use set_path to set invalid filename. + * path.h (path_conv::path_conv): Ditto. + 2009-08-04 Christopher Faylor * fhandler.h (pdrive_buf): Defensively allocate one extra byte. diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index bd6a2fb31..472fe6237 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -1499,7 +1499,7 @@ fhandler_socket::send_internal (struct _WSAMSG *wsamsg, int flags) buf.len = wsamsg->lpBuffers[i].len - off; /* See net.cc:fdsock() and MSDN KB 823764 */ if (buf.len >= (unsigned) wmem ()) - buf.len = (unsigned) wmem () - 1; + buf.len = (unsigned) wmem (); } do diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index b76d64599..85e150738 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -507,8 +507,8 @@ fdsock (cygheap_fdmanip& fd, const device *dev, SOCKET soc) (*) Maximum normal TCP window size. Coincidence? */ - ((fhandler_socket *) fd)->rmem () = 65536; - ((fhandler_socket *) fd)->wmem () = 65536; + ((fhandler_socket *) fd)->rmem () = 65535; + ((fhandler_socket *) fd)->wmem () = 65535; if (::setsockopt (soc, SOL_SOCKET, SO_RCVBUF, (char *) &((fhandler_socket *) fd)->rmem (), sizeof (int))) debug_printf ("setsockopt(SO_RCVBUF) failed, %lu", WSAGetLastError ()); diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index eba56fd83..4d5424c76 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -968,7 +968,7 @@ virtual_component_retry: { too_long: error = ENAMETOOLONG; - this->path = cstrdup ("::ENAMETOOLONG::"); + set_path ("::ENAMETOOLONG::"); return; } diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 3e66c19c7..35a032b51 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -168,7 +168,7 @@ class path_conv : fileattr (INVALID_FILE_ATTRIBUTES), wide_path (NULL), path_flags (0), known_suffix (NULL), normalized_path (NULL), error (0), dev (in_dev) { - path = cstrdup (in_dev.native); + set_path (in_dev.native); } path_conv (int, const char *src, unsigned opt = PC_SYM_FOLLOW,