mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Send AdnlMessageNop instead empty Buffer for reverse pings
This commit modifies send_message_ex to use AdnlMessageNop for empty payloads instead of AdnlMessageCustom. This change prevents exceptions in ADNL node implementations that expect non-empty messages, particularly addressing issues with reverse-ping operations from DHT nodes. Using AdnlMessageNop ensures proper handling of empty messages
This commit is contained in:
parent
7841d751c0
commit
e48bfb7ed3
1 changed files with 4 additions and 0 deletions
|
@ -55,6 +55,10 @@ class AdnlPeerTableImpl : public AdnlPeerTable {
|
|||
VLOG(ADNL_WARNING) << "DUMP: " << td::buffer_to_hex(data.as_slice().truncate(128));
|
||||
return;
|
||||
}
|
||||
if (data.empty()) {
|
||||
send_message_in(src, dst, AdnlMessage{adnlmessage::AdnlMessageNop()}, flags);
|
||||
return;
|
||||
}
|
||||
send_message_in(src, dst, AdnlMessage{adnlmessage::AdnlMessageCustom{std::move(data)}}, flags);
|
||||
}
|
||||
void answer_query(AdnlNodeIdShort src, AdnlNodeIdShort dst, AdnlQueryId query_id, td::BufferSlice data) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue