From 2877cd0adb01f85b6fd12122af4efe7ceaf234c0 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 23 Apr 2023 17:33:42 +0300 Subject: [PATCH] Allow OP_SEC_READ to return errors (do not hang the connection) --- src/msgr_receive.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/msgr_receive.cpp b/src/msgr_receive.cpp index b150f3c3..f3d9170b 100644 --- a/src/msgr_receive.cpp +++ b/src/msgr_receive.cpp @@ -313,17 +313,18 @@ bool osd_messenger_t::handle_reply_hdr(osd_client_t *cl) stop_client(cl->peer_fd); return false; } - if (op->reply.hdr.retval >= 0 && bmp_len > 0) + if (bmp_len > 0) { assert(op->bitmap); cl->recv_list.push_back(op->bitmap, bmp_len); + cl->read_remaining += bmp_len; } if (op->reply.hdr.retval > 0) { assert(op->iov.count > 0); cl->recv_list.append(op->iov); + cl->read_remaining += op->reply.hdr.retval; } - cl->read_remaining = op->reply.hdr.retval + bmp_len; if (cl->read_remaining == 0) { goto reuse;