Add debug.

GitOrigin-RevId: e6efea5f211c8926b986fc40eed6ae1401322c38
This commit is contained in:
levlam 2018-04-13 21:20:20 +03:00
parent ce7c410a5a
commit 82820bf842
5 changed files with 15 additions and 13 deletions

View File

@ -188,8 +188,7 @@ class SecretChatActor : public NetQueryCallback {
storer.store_int(ttl); storer.store_int(ttl);
storer.store_int(my_layer); storer.store_int(my_layer);
//for future usage //for future usage
BEGIN_STORE_FLAGS(); storer.store_int(0);
END_STORE_FLAGS();
} }
template <class ParserT> template <class ParserT>
@ -201,8 +200,8 @@ class SecretChatActor : public NetQueryCallback {
his_layer &= ~HAS_FLAGS; his_layer &= ~HAS_FLAGS;
my_layer = parser.fetch_int(); my_layer = parser.fetch_int();
// for future usage // for future usage
BEGIN_PARSE_FLAGS(); int32 flags = parser.fetch_int();
END_PARSE_FLAGS(); CHECK(flags == 0);
} }
} }

View File

@ -59,7 +59,8 @@ FileId StickersManager::parse_sticker(bool in_sticker_set, T &parser) {
PARSE_FLAG(has_sticker_set_access_hash); PARSE_FLAG(has_sticker_set_access_hash);
PARSE_FLAG(in_sticker_set_stored); PARSE_FLAG(in_sticker_set_stored);
END_PARSE_FLAGS(); END_PARSE_FLAGS();
CHECK(in_sticker_set_stored == in_sticker_set) << in_sticker_set << " " << in_sticker_set_stored; CHECK(in_sticker_set_stored == in_sticker_set)
<< in_sticker_set << " " << in_sticker_set_stored << " " << parser.version();
if (!in_sticker_set) { if (!in_sticker_set) {
parse(sticker->set_id, parser); parse(sticker->set_id, parser);
if (has_sticker_set_access_hash) { if (has_sticker_set_access_hash) {

View File

@ -1222,7 +1222,7 @@ class FileData {
PARSE_FLAG(has_owner_dialog_id); PARSE_FLAG(has_owner_dialog_id);
PARSE_FLAG(has_expected_size); PARSE_FLAG(has_expected_size);
PARSE_FLAG(encryption_key_is_secure); PARSE_FLAG(encryption_key_is_secure);
END_PARSE_FLAGS(); // END_PARSE_FLAGS();
if (has_owner_dialog_id) { if (has_owner_dialog_id) {
parse(owner_dialog_id_, parser); parse(owner_dialog_id_, parser);

View File

@ -72,8 +72,8 @@ struct AesCtrEncryptionEvent {
template <class StorerT> template <class StorerT>
void store(StorerT &storer) const { void store(StorerT &storer) const {
using td::store; using td::store;
BEGIN_STORE_FLAGS(); int32 flags = 0;
END_STORE_FLAGS(); store(flags, storer);
store(key_salt_, storer); store(key_salt_, storer);
store(iv_, storer); store(iv_, storer);
store(key_hash_, storer); store(key_hash_, storer);
@ -81,8 +81,9 @@ struct AesCtrEncryptionEvent {
template <class ParserT> template <class ParserT>
void parse(ParserT &&parser) { void parse(ParserT &&parser) {
using td::parse; using td::parse;
BEGIN_PARSE_FLAGS(); int32 flags;
END_PARSE_FLAGS(); parse(flags, parser);
CHECK(flags == 0);
parse(key_salt_, parser); parse(key_salt_, parser);
parse(iv_, parser); parse(iv_, parser);
parse(key_hash_, parser); parse(key_hash_, parser);

View File

@ -41,7 +41,8 @@
#define END_PARSE_FLAGS() \ #define END_PARSE_FLAGS() \
CHECK(bit_offset_parse < 31); \ CHECK(bit_offset_parse < 31); \
CHECK((flags_parse & ~((1 << bit_offset_parse) - 1)) == 0) << flags_parse << " " << bit_offset_parse; CHECK((flags_parse & ~((1 << bit_offset_parse) - 1)) == 0) \
<< flags_parse << " " << bit_offset_parse << " " << parser.version();
namespace td { namespace td {
template <class StorerT> template <class StorerT>