| 1077 | // allow for message authentication. Eventually we should fix that. PLR |
| 1078 | |
| 1079 | void encode_message(Message *msg, uint64_t features, ceph::bufferlist& payload) |
| 1080 | { |
| 1081 | ceph_msg_footer_old old_footer; |
| 1082 | msg->encode(features, MSG_CRC_ALL); |
| 1083 | encode(msg->get_header(), payload); |
| 1084 | |
| 1085 | // Here's where we switch to the old footer format. PLR |
| 1086 | ceph_msg_footer footer = msg->get_footer(); |
| 1087 | old_footer.front_crc = footer.front_crc; |
| 1088 | old_footer.middle_crc = footer.middle_crc; |
| 1089 | old_footer.data_crc = footer.data_crc; |
| 1090 | old_footer.flags = footer.flags; |
| 1091 | encode(old_footer, payload); |
| 1092 | |
| 1093 | using ceph::encode; |
| 1094 | encode(msg->get_payload(), payload); |
| 1095 | encode(msg->get_middle(), payload); |
| 1096 | encode(msg->get_data(), payload); |
| 1097 | } |
| 1098 | |
| 1099 | // See above for somewhat bogus use of the old message footer. We switch to the current footer |
| 1100 | // after decoding the old one so the other form of decode_message() doesn't have to change. |
no test coverage detected