On Wed, Jul 09, 2008 at 08:26:47PM +0100, Richard W.M. Jones wrote:
(2) There is some really odd problem with our use of recv(2) which
causes messages > 64 KB to fail. I have no idea what is really
happening, but the sequence of events seems to be this:
server client
write(sock,buf,len) = len-k
recv(sock,buf,len) = len-k
write(sock,buf+len-k,len-k) = k
recv(sock,buf,k) = 0 [NOT k]
At this point the client assumes that the server has unexpectedly
closed the connection and fails. I have stared at this for a while,
but I've got no idea at all what's going on.
I don't think you can expect the second recv() to return exactly k
as this can get fragmented (nor expect that the first recv would get
len -k either), but if you got 0 that would mean a packet has been
received and there is no more data, that would be a bug IMHO.
That's strange ...
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/