: entry(std::move(_entry)) {}
void encode(ceph::buffer::list& bl) const {
- ENCODE_START(1, 1, bl);
+ ENCODE_START(2, 2, bl);
encode(entry, bl);
ENCODE_FINISH(bl);
}
void decode(ceph::buffer::list::const_iterator& bl) {
- DECODE_START(1, bl);
- decode(entry, bl);
+ DECODE_START(2, bl);
+ if (struct_v < 2) {
+ /* there was an unmarked change in the encoding during v1, so
+ * if the sender version is v1, try decoding both ways (sorry) */
+ ceph::buffer::list::const_iterator save_bl = bl;
+ try {
+ decode(entry, bl);
+ } catch (ceph::buffer::error& e) {
+ std::pair<std::string, int> oe;
+ bl = save_bl;
+ decode(oe, bl);
+ entry.bucket = oe.first;
+ entry.start_time = 0;
+ entry.status = oe.second;
+ }
+ } else {
+ decode(entry, bl);
+ }
DECODE_FINISH(bl);
}
-
};
WRITE_CLASS_ENCODER(cls_rgw_lc_get_entry_ret)