protocol: Really read 4 bytes while checking for cancellation.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 1 Dec 2010 13:24:23 +0000 (13:24 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 1 Dec 2010 13:35:32 +0000 (13:35 +0000)
commit8bfca99b9ab5774ce8aa1086184479ebb98236b2
tree295b226c25b53dac545d926ebe834ec9df432e80
parent7e523077d650cfb71044d5e74aa8fe1f91c019ae
protocol: Really read 4 bytes while checking for cancellation.

We've not actually hit this bug in practice, but at least in
theory while checking for cancellation we could read > 0 but
fewer than 4 bytes, which would effectively be discarded and
we would lose synchronization.

Note the socket is non-blocking.

Change the code so that we temporarily set the socket back to
blocking and force the read of all 4 bytes.
src/proto.c