This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inetutils 1.5 / ftpd problem: 426 Data connection: No buffer space available.


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]