@@ -78,7 +78,6 @@ td::Status OverlayFecBroadcastPart::check_signature() {
78
78
}
79
79
80
80
td::Status OverlayFecBroadcastPart::run_checks () {
81
-
82
81
TRY_STATUS (check_time ());
83
82
TRY_STATUS (check_duplicate ());
84
83
TRY_STATUS (check_source ());
@@ -94,14 +93,17 @@ void BroadcastFec::broadcast_checked(td::Result<td::Unit> R) {
94
93
overlay_->deliver_broadcast (get_source ().compute_short_id (), data_.clone ());
95
94
auto manager = overlay_->overlay_manager ();
96
95
while (!parts_.empty ()) {
97
- distribute_part (parts_.begin ()->first );
96
+ distribute_part (parts_.begin ()->first );
98
97
}
98
+
99
+ is_checked_ = true ;
99
100
}
100
101
101
102
// Do we need status here??
102
- td::Status BroadcastFec::distribute_part (td::uint32 seqno) {
103
+ td::Status BroadcastFec::distribute_part (td::uint32 seqno) {
103
104
auto i = parts_.find (seqno);
104
105
if (i == parts_.end ()) {
106
+ VLOG (OVERLAY_WARNING) << " not distibuting empty part " << seqno;
105
107
// should not get here
106
108
return td::Status::OK ();
107
109
}
@@ -132,7 +134,6 @@ td::Status BroadcastFec::distribute_part(td::uint32 seqno) {
132
134
}
133
135
134
136
td::Status OverlayFecBroadcastPart::apply () {
135
-
136
137
if (!bcast_) {
137
138
bcast_ = overlay_->get_fec_broadcast (broadcast_hash_);
138
139
}
@@ -165,16 +166,20 @@ td::Status OverlayFecBroadcastPart::apply() {
165
166
return S;
166
167
}
167
168
} else {
168
- if (untrusted_) {
169
+ if (untrusted_) {
169
170
auto P = td::PromiseCreator::lambda (
170
- [id = broadcast_hash_, overlay_id = actor_id (overlay_)](td::Result<td::Unit> RR) mutable {
171
- td::actor::send_closure (std::move (overlay_id), &OverlayImpl::broadcast_checked, id, std::move (RR));
172
- });
171
+ [id = broadcast_hash_, overlay_id = actor_id (overlay_)](td::Result<td::Unit> RR) mutable {
172
+ td::actor::send_closure (std::move (overlay_id), &OverlayImpl::broadcast_checked, id, std::move (RR));
173
+ });
173
174
overlay_->check_broadcast (bcast_->get_source ().compute_short_id (), R.move_as_ok (), std::move (P));
174
175
} else {
175
176
overlay_->deliver_broadcast (bcast_->get_source ().compute_short_id (), R.move_as_ok ());
176
177
}
177
178
}
179
+ } else {
180
+ bcast_->set_overlay (overlay_);
181
+ bcast_->set_src_peer_id (src_peer_id_);
182
+ TRY_STATUS (bcast_->add_part (seqno_, data_.clone (), export_serialized_short (), export_serialized ()));
178
183
}
179
184
return td::Status::OK ();
180
185
}
@@ -304,7 +309,8 @@ td::Status OverlayFecBroadcastPart::create_new(OverlayImpl *overlay, td::actor::
304
309
305
310
auto B = std::make_unique<OverlayFecBroadcastPart>(
306
311
broadcast_hash, part_hash, PublicKey{}, overlay->get_certificate (local_id), data_hash, size, flags,
307
- part_data_hash, std::move (part), seqno, std::move (fec_type), date, td::BufferSlice{}, false , nullptr , overlay, adnl::AdnlNodeIdShort::zero ());
312
+ part_data_hash, std::move (part), seqno, std::move (fec_type), date, td::BufferSlice{}, false , nullptr , overlay,
313
+ adnl::AdnlNodeIdShort::zero ());
308
314
auto to_sign = B->to_sign ();
309
315
310
316
auto P = td::PromiseCreator::lambda (
0 commit comments