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:23:27 +0000 (17:23 +1100)
commit1cbdb44d604461509676b903a9e9515e7cab2598
tree19b4abef7ddbdc51a98c09a7910eb0cac1b3482c
parent537bed11c339a10faf45a6ede778f7c8e26e4f91
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>
Cherry-pick-from: d788bc8f7212b7dc1587ae592242dc8c876f4053

Conflicts:
common/ctdb_io.c
common/ctdb_io.c