@@ -1008,14 +1008,14 @@ struct traceID final {
10081008};
10091009
10101010class traceContext final {
1011- static constexpr uint32_t RETURN_RESERVED_STATUS_0_FLAG = vk::tl::common::tracing::traceContext::return_reserved_status_0 ;
1012- static constexpr uint32_t RETURN_RESERVED_STATUS_1_FLAG = vk::tl::common::tracing::traceContext::return_reserved_status_1 ;
1013- static constexpr uint32_t PARENT_ID_FLAG = vk::tl::common::tracing::traceContext ::parent_id;
1014- static constexpr uint32_t SOURCE_ID_FLAG = vk::tl::common::tracing::traceContext ::source_id;
1015- static constexpr uint32_t RETURN_RESERVED_LEVEL_0_FLAG = vk::tl::common::tracing::traceContext::return_reserved_level_0 ;
1016- static constexpr uint32_t RETURN_RESERVED_LEVEL_1_FLAG = vk::tl::common::tracing::traceContext::return_reserved_level_1 ;
1017- static constexpr uint32_t RETURN_RESERVED_LEVEL_2_FLAG = vk::tl::common::tracing::traceContext::return_reserved_level_2 ;
1018- static constexpr uint32_t RETURN_DEBUG_FLAG = vk::tl::common::tracing::traceContext::return_debug ;
1011+ static constexpr uint32_t RESERVED_STATUS_0_FLAG = vk::tl::common::tracing::trace_context_flags::reserved_status_0 ;
1012+ static constexpr uint32_t RESERVED_STATUS_1_FLAG = vk::tl::common::tracing::trace_context_flags::reserved_status_1 ;
1013+ static constexpr uint32_t PARENT_ID_FLAG = vk::tl::common::tracing::trace_context_flags ::parent_id;
1014+ static constexpr uint32_t SOURCE_ID_FLAG = vk::tl::common::tracing::trace_context_flags ::source_id;
1015+ static constexpr uint32_t RESERVED_LEVEL_0_FLAG = vk::tl::common::tracing::trace_context_flags::reserved_level_0 ;
1016+ static constexpr uint32_t RESERVED_LEVEL_1_FLAG = vk::tl::common::tracing::trace_context_flags::reserved_level_1 ;
1017+ static constexpr uint32_t RESERVED_LEVEL_2_FLAG = vk::tl::common::tracing::trace_context_flags::reserved_level_2 ;
1018+ static constexpr uint32_t DEBUG_FLAG = vk::tl::common::tracing::trace_context_flags::debug ;
10191019
10201020public:
10211021 tl::tracing::traceID trace_id{};
@@ -1036,23 +1036,23 @@ class traceContext final {
10361036 bool debug_flag{};
10371037
10381038 bool fetch (tl::fetcher& tlf) noexcept {
1039- tl::u32 fields_mask{};
1039+ tl::mask fields_mask{};
10401040 bool ok{fields_mask.fetch (tlf)};
10411041
10421042 ok = ok && trace_id.fetch (tlf);
10431043 if (ok && static_cast <bool >(fields_mask.value & PARENT_ID_FLAG)) {
1044- ok = ok && opt_parent_id.emplace ().fetch (tlf);
1044+ ok &= opt_parent_id.emplace ().fetch (tlf);
10451045 }
10461046 if (ok && static_cast <bool >(fields_mask.value & SOURCE_ID_FLAG)) {
1047- ok = ok && opt_source_id.emplace ().fetch (tlf);
1047+ ok &= opt_source_id.emplace ().fetch (tlf);
10481048 }
10491049
1050- reserved_status_0 = static_cast <bool >(fields_mask.value & RETURN_RESERVED_STATUS_0_FLAG );
1051- reserved_status_1 = static_cast <bool >(fields_mask.value & RETURN_RESERVED_STATUS_1_FLAG );
1052- reserved_level_0 = static_cast <bool >(fields_mask.value & RETURN_RESERVED_LEVEL_0_FLAG );
1053- reserved_level_1 = static_cast <bool >(fields_mask.value & RETURN_RESERVED_LEVEL_1_FLAG );
1054- reserved_level_2 = static_cast <bool >(fields_mask.value & RETURN_RESERVED_LEVEL_2_FLAG );
1055- debug_flag = static_cast <bool >(fields_mask.value & RETURN_DEBUG_FLAG );
1050+ reserved_status_0 = static_cast <bool >(fields_mask.value & RESERVED_STATUS_0_FLAG );
1051+ reserved_status_1 = static_cast <bool >(fields_mask.value & RESERVED_STATUS_1_FLAG );
1052+ reserved_level_0 = static_cast <bool >(fields_mask.value & RESERVED_LEVEL_0_FLAG );
1053+ reserved_level_1 = static_cast <bool >(fields_mask.value & RESERVED_LEVEL_1_FLAG );
1054+ reserved_level_2 = static_cast <bool >(fields_mask.value & RESERVED_LEVEL_2_FLAG );
1055+ debug_flag = static_cast <bool >(fields_mask.value & DEBUG_FLAG );
10561056
10571057 return ok;
10581058 }
@@ -1070,6 +1070,7 @@ class traceContext final {
10701070 return flags;
10711071 }
10721072};
1073+
10731074} // namespace tracing
10741075
10751076class rpcInvokeReqExtra final {
@@ -1114,17 +1115,17 @@ class rpcInvokeReqExtra final {
11141115 std::optional<tl::string> opt_execution_context;
11151116 bool return_view_number{};
11161117
1117- bool fetch (tl::fetcher& tlf) noexcept ;
1118+ bool fetch (tl::fetcher& tlf, const tl::mask& flags ) noexcept ;
11181119
11191120 tl::mask get_flags () const noexcept ;
11201121};
11211122
11221123struct RpcInvokeReqExtra final {
11231124 tl::rpcInvokeReqExtra inner{};
11241125
1125- bool fetch (tl::fetcher& tlf) noexcept {
1126+ bool fetch (tl::fetcher& tlf, const tl::mask& flags ) noexcept {
11261127 tl::magic magic{};
1127- return magic.fetch (tlf) && magic.expect (TL_RPC_INVOKE_REQ_EXTRA) && inner.fetch (tlf);
1128+ return magic.fetch (tlf) && magic.expect (TL_RPC_INVOKE_REQ_EXTRA) && inner.fetch (tlf, flags );
11281129 }
11291130};
11301131
@@ -1141,7 +1142,6 @@ class rpcReqResultExtra final {
11411142 static constexpr uint32_t VIEW_NUMBER_FLAG = vk::tl::common::rpc_req_result_extra_flags::view_number;
11421143
11431144public:
1144- tl::mask flags{};
11451145 tl::i64 binlog_pos{};
11461146 tl::i64 binlog_time{};
11471147 tl::netPid engine_pid{};
@@ -1153,16 +1153,16 @@ class rpcReqResultExtra final {
11531153 tl::i64 epoch_number{};
11541154 tl::i64 view_number{};
11551155
1156- void store (tl::storer& tls) const noexcept ;
1156+ void store (tl::storer& tls, const tl::mask& flags ) const noexcept ;
11571157
1158- size_t footprint () const noexcept ;
1158+ size_t footprint (const tl::mask& flags ) const noexcept ;
11591159};
11601160
11611161struct RpcReqResultExtra final {
11621162 tl::rpcReqResultExtra inner{};
11631163
1164- void store (tl::storer& tls) const noexcept {
1165- tl::magic{.value = TL_RPC_REQ_RESULT_EXTRA}.store (tls), inner.store (tls);
1164+ void store (tl::storer& tls, const tl::mask& flags ) const noexcept {
1165+ tl::magic{.value = TL_RPC_REQ_RESULT_EXTRA}.store (tls), inner.store (tls, flags );
11661166 }
11671167};
11681168
@@ -1181,15 +1181,16 @@ struct k2RpcResponseError final {
11811181
11821182struct k2RpcResponseHeader final {
11831183 tl::mask flags{};
1184+ tl::mask extra_flags{};
11841185 tl::rpcReqResultExtra extra{};
11851186 std::span<const std::byte> result;
11861187
11871188 void store (tl::storer& tls) const noexcept {
1188- flags.store (tls), extra.store (tls), tls.store_bytes (result);
1189+ flags.store (tls), extra_flags. store (tls), extra.store (tls, extra_flags ), tls.store_bytes (result);
11891190 }
11901191
11911192 constexpr size_t footprint () const noexcept {
1192- return flags.footprint () + extra.footprint () + result.size ();
1193+ return flags.footprint () + extra_flags. footprint () + extra.footprint (extra_flags ) + result.size ();
11931194 }
11941195};
11951196
0 commit comments