Allow OP_SEC_READ to return errors (do not hang the connection)

epoch-deletions
Vitaliy Filippov 2023-04-23 17:33:42 +03:00
parent 480509f5b9
commit 2877cd0adb
1 changed files with 3 additions and 2 deletions

View File

@ -313,17 +313,18 @@ bool osd_messenger_t::handle_reply_hdr(osd_client_t *cl)
stop_client(cl->peer_fd); stop_client(cl->peer_fd);
return false; return false;
} }
if (op->reply.hdr.retval >= 0 && bmp_len > 0) if (bmp_len > 0)
{ {
assert(op->bitmap); assert(op->bitmap);
cl->recv_list.push_back(op->bitmap, bmp_len); cl->recv_list.push_back(op->bitmap, bmp_len);
cl->read_remaining += bmp_len;
} }
if (op->reply.hdr.retval > 0) if (op->reply.hdr.retval > 0)
{ {
assert(op->iov.count > 0); assert(op->iov.count > 0);
cl->recv_list.append(op->iov); 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) if (cl->read_remaining == 0)
{ {
goto reuse; goto reuse;