@@ -458,13 +458,15 @@ FilterStatus ContextBase::onUpstreamData(uint32_t data_length, bool end_of_strea
458
458
459
459
void ContextBase::onDownstreamConnectionClose (CloseType close_type) {
460
460
if (!isFailed () && wasm_->on_downstream_connection_close_ ) {
461
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
461
462
DeferAfterCallActions actions (this );
462
463
wasm_->on_downstream_connection_close_ (this , id_, static_cast <uint32_t >(close_type));
463
464
}
464
465
}
465
466
466
467
void ContextBase::onUpstreamConnectionClose (CloseType close_type) {
467
468
if (!isFailed () && wasm_->on_upstream_connection_close_ ) {
469
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
468
470
DeferAfterCallActions actions (this );
469
471
wasm_->on_upstream_connection_close_ (this , id_, static_cast <uint32_t >(close_type));
470
472
}
@@ -549,12 +551,14 @@ void ContextBase::onHttpCallResponse(uint32_t token, uint32_t headers, uint32_t
549
551
if (isFailed () || !wasm_->on_http_call_response_ ) {
550
552
return ;
551
553
}
554
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
552
555
DeferAfterCallActions actions (this );
553
556
wasm_->on_http_call_response_ (this , id_, token, headers, body_size, trailers);
554
557
}
555
558
556
559
void ContextBase::onQueueReady (uint32_t token) {
557
560
if (!isFailed () && wasm_->on_queue_ready_ ) {
561
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
558
562
DeferAfterCallActions actions (this );
559
563
wasm_->on_queue_ready_ (this , id_, token);
560
564
}
@@ -564,6 +568,7 @@ void ContextBase::onGrpcReceiveInitialMetadata(uint32_t token, uint32_t elements
564
568
if (isFailed () || !wasm_->on_grpc_receive_initial_metadata_ ) {
565
569
return ;
566
570
}
571
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
567
572
DeferAfterCallActions actions (this );
568
573
wasm_->on_grpc_receive_initial_metadata_ (this , id_, token, elements);
569
574
}
@@ -572,6 +577,7 @@ void ContextBase::onGrpcReceiveTrailingMetadata(uint32_t token, uint32_t trailer
572
577
if (isFailed () || !wasm_->on_grpc_receive_trailing_metadata_ ) {
573
578
return ;
574
579
}
580
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
575
581
DeferAfterCallActions actions (this );
576
582
wasm_->on_grpc_receive_trailing_metadata_ (this , id_, token, trailers);
577
583
}
@@ -580,6 +586,7 @@ void ContextBase::onGrpcReceive(uint32_t token, uint32_t response_size) {
580
586
if (isFailed () || !wasm_->on_grpc_receive_ ) {
581
587
return ;
582
588
}
589
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
583
590
DeferAfterCallActions actions (this );
584
591
wasm_->on_grpc_receive_ (this , id_, token, response_size);
585
592
}
@@ -588,12 +595,14 @@ void ContextBase::onGrpcClose(uint32_t token, uint32_t status_code) {
588
595
if (isFailed () || !wasm_->on_grpc_close_ ) {
589
596
return ;
590
597
}
598
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
591
599
DeferAfterCallActions actions (this );
592
600
wasm_->on_grpc_close_ (this , id_, token, status_code);
593
601
}
594
602
595
603
bool ContextBase::onDone () {
596
604
if (!isFailed () && wasm_->on_done_ ) {
605
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
597
606
DeferAfterCallActions actions (this );
598
607
return wasm_->on_done_ (this , id_).u64_ != 0 ;
599
608
}
@@ -602,13 +611,15 @@ bool ContextBase::onDone() {
602
611
603
612
void ContextBase::onLog () {
604
613
if (!isFailed () && wasm_->on_log_ ) {
614
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
605
615
DeferAfterCallActions actions (this );
606
616
wasm_->on_log_ (this , id_);
607
617
}
608
618
}
609
619
610
620
void ContextBase::onDelete () {
611
621
if (in_vm_context_created_ && !isFailed () && wasm_->on_delete_ ) {
622
+ wasm_->addAfterVmCallAction ([this ]() { this ->stop_iteration_ = false ; });
612
623
DeferAfterCallActions actions (this );
613
624
wasm_->on_delete_ (this , id_);
614
625
}
0 commit comments