Charles Wilson wrote:
Yeah, I'll code that up for 1.5-4. Should I stick with BUFSIZ == 1024,
or when MMAP use something a little bigger, say 32k?
Also, uploads to the server seem to be sane (e.g. read() from the server
side). So it's just downloads to the client when HAVE_MMAP. The fix was
pretty easy:
#ifdef HAVE_MMAP
#include <sys/mman.h>
+# ifdef __CYGWIN__
+ /* On cygwin, network transfers are limited to an absolute
+ maximum of 64k, or transfer fails with ENOBUFS. Conservative: */
+# define LARGE_TRANSFER_LIMIT 32768
+# endif
#endif
...
do
{
- cnt = write (netfd, bp, len);
+#ifdef __CYGWIN__
+ /* on cygwin, socket write is limited to 64k max */
+ cnt = write (netfd, bp, (len < LARGE_TRANSFER_LIMIT ? len :
LARGE_TRANSFER_LIMIT));
+#else
+ cnt = write (netfd, bp, len);
+#endif
len -= cnt;
bp += cnt;
if (cnt > 0) byte_count += cnt;
} while (cnt > 0 && len > 0);
antony, please test the following:
http://cygwin.cwilson.fastmail.fm/ITP/ftpd.exe.bz2
--
Chuck
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/