communications: recv_unix: factor out recv() loop from send_command()
Here we make a new function recv_unix() that encapsulates the logic of
receiving a message from a unix domain socket (ie our control socket)
and copying it into a dynamically-sized heap buffer for disposition by
the caller. This will let us use it from other functions, in particular
from receive_command(), which is currently using a single buffer and
reading from the socket one character at a time. Since the logic for
doing this robustly was already implemented in send_command(), we can
just factor it out and use in both places.
authored by
jcs.org
17489f14
1495c616