common/io: Rewrite socket handling code to read all available data
authorAmitay Isaacs <amitay@gmail.com>
Thu, 17 Jan 2013 23:42:14 +0000 (10:42 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 19 Feb 2013 06:18:21 +0000 (17:18 +1100)
commitd788bc8f7212b7dc1587ae592242dc8c876f4053
treef1e298c59f096a5fce1b9ece4fc372fd91d464ae
parent855ab348901edb3ec1327499a43f509d279b8182
common/io: Rewrite socket handling code to read all available data

This improves the processing of packets considerably.  It has been
observed that there can be as many as 10 packets in the socket buffer and
the current code of reading a single packet from a socket at a time is
not very optimal.  This change reads all the bytes from socket buffer and
then parses to extract multiple packets.  If there are multiple packets,
set up a timed event to process next packet.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
common/ctdb_io.c