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

Method encode_payload

src/messages/MForward.h:72–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71public:
72 void encode_payload(uint64_t features) override {
73 using ceph::encode;
74 if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
75 header.version = 3;
76 header.compat_version = 3;
77 encode(tid, payload);
78 entity_inst_t client;
79 client.name = entity_name_t(client_type, -1);
80 client.addr = client_addrs.legacy_addr();
81 encode(client, payload, features);
82 encode(client_caps, payload, features);
83 // Encode client message with intersection of target and source
84 // features. This could matter if the semantics of the encoded
85 // message are changed when reencoding with more features than the
86 // client had originally. That should never happen, but we may as
87 // well be defensive here.
88 if (con_features != features) {
89 msg->clear_payload();
90 }
91 encode_message(msg, features & con_features, payload);
92 encode(con_features, payload);
93 encode(entity_name, payload);
94 return;
95 }
96 header.version = HEAD_VERSION;
97 header.compat_version = COMPAT_VERSION;
98 encode(tid, payload);
99 encode(client_type, payload, features);
100 encode(client_addrs, payload, features);
101 encode(client_socket_addr, payload, features);
102 encode(client_caps, payload, features);
103 // Encode client message with intersection of target and source
104 // features. This could matter if the semantics of the encoded
105 // message are changed when reencoding with more features than the
106 // client had originally. That should never happen, but we may as
107 // well be defensive here.
108 if (con_features != features) {
109 msg->clear_payload();
110 }
111 encode_message(msg, features & con_features, payload);
112 encode(con_features, payload);
113 encode(entity_name, payload);
114 }
115
116 void decode_payload() override {
117 using ceph::decode;

Callers

nothing calls this directly

Calls 5

encode_messageFunction · 0.85
legacy_addrMethod · 0.80
clear_payloadMethod · 0.80
encodeFunction · 0.50
entity_name_tClass · 0.50

Tested by

no test coverage detected