|
The hooks handler in the main daemon didn't wait for the hook client to
write fully, and sometimes prematurely closes the connection, causing
the hook client's splice to return EPIPE (or SIGPIPE if the signal
handler wasn't installed).
To remedy this, we call shutdown(sock, SHUT_WR) in the client, so that
attempts to read on the server side return EOF. Then we can simply use
io.Copy(&buf, conn) on the server side to fetch all of the data into a
buffer.
|