Problems with sending large puts on windows.

I'm using libwww in a large project uploading and downloading large
files from a repository server.

I have detected a fatal bug in the buffering used from a PUT call.
Win32 platform.

What happens is: PUT starts sending the buffer to the socket, but gets
a WOULD_BLOCK. The rest of the buffer is kept in an internal buffer
and a timer ensures resending later. But at the flush time the whole
remaining data is tried sent to the socket in one single send() and
the socket reports back WSAENOBUFS 10555 (windows) and the socket dies
(or at least stops working). And libww does not report anything to its
caller.

I have not tried to fix this reporting issue, but I have modified the
flush to avoid sending the socket a too large buffer, and at the same
time avoid copying the buffer too many times.

Attached is both the diff and the modified
    libwww/Library/src/HTBufWrt.c

The cvs numbers are not correct with respect to libwww, but is my own
as set when importing libwww into my own cvs-repository.

Hopefully somebody can look through my changes, and integrate them
with the package?

Regards,

--Trond Kristiansen, tk@computas.com

Received on Friday, 22 February 2002 08:27:48 UTC