sobomax 0198596495 Read from the socket using the same max buffer size as we use while
sending. What happens otherwise is that the sender splits all the
traffic into 32k chunks, while the receiver is waiting for the whole
packet. Then for a certain packet sizes, particularly 66607 bytes in
my case, the communication stucks to secondary is expecting to
read one chunk of 66607 bytes, while primary is sending two chunks
of 32768 bytes and third chunk of 1071. Probably due to TCP windowing
and buffering the final chunk gets stuck somewhere, so neither server
not client can make any progress.

This patch also protect from short reads, as according to the manual
page there are some cases when MSG_WAITALL can give less data than
expected.

MFC after:	3 days
2011-06-04 16:01:30 +00:00
..
2011-04-10 15:11:19 +00:00
2010-06-14 21:44:58 +00:00
2011-05-20 11:21:39 +00:00
2011-03-22 10:39:34 +00:00
2010-06-14 21:25:20 +00:00
2010-10-24 15:41:23 +00:00