From 71369541ab4ac1752fca3a6134ea51f5cc0bea9f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 22 Nov 2010 16:12:10 -0800 Subject: [PATCH] msgr: tolerate 0 bytes from tcp_read_nonblocking This can happen, I belive when we get a signal or something. Signed-off-by: Sage Weil --- src/msg/SimpleMessenger.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index d649bd2a42e57..8d160f8e2cad9 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -1910,11 +1910,12 @@ int SimpleMessenger::Pipe::read_message(Message **pm) connection_state->lock.Unlock(); if (got < 0) goto out_dethrottle; - assert(got > 0); // hmm.. right? - blp.advance(got); - data.append(bp, 0, got); - offset += got; - left -= got; + if (got > 0) { + blp.advance(got); + data.append(bp, 0, got); + offset += got; + left -= got; + } // else we got a signal or something; just loop. } } -- 2.39.5