The code to detect premature EOF in the sideband demultiplexer has
been cleaned up.
* jk/sideband-more-error-checking:
sideband: diagnose more sideband anomalies
@ -461,9 +461,11 @@ int recv_sideband(const char *me, int in_stream, int out)
@@ -461,9 +461,11 @@ int recv_sideband(const char *me, int in_stream, int out)
enum sideband_type sideband_type;
while (1) {
len = packet_read(in_stream, NULL, NULL, buf, LARGE_PACKET_MAX,
0);
if (!demultiplex_sideband(me, buf, len, 0, &scratch,
int status = packet_read_with_status(in_stream, NULL, NULL,
buf, LARGE_PACKET_MAX,
&len,
PACKET_READ_GENTLE_ON_EOF);
if (!demultiplex_sideband(me, status, buf, len, 0, &scratch,