MCPcopy Create free account
hub / github.com/ceph/ceph / encode_message

Function encode_message

src/msg/Message.cc:1079–1097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1077// allow for message authentication. Eventually we should fix that. PLR
1078
1079void 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.

Callers 4

encodeMethod · 0.85
encode_payloadMethod · 0.85
encode_payloadMethod · 0.85

Calls 6

get_footerMethod · 0.80
get_payloadMethod · 0.80
encodeFunction · 0.70
encodeMethod · 0.45
get_headerMethod · 0.45
get_dataMethod · 0.45

Tested by

no test coverage detected