Skip to content

Commit

Permalink
Clear stop_iteration_ flag non-status-returning callbacks.
Browse files Browse the repository at this point in the history
Signed-off-by: mathetake <takeshi@tetrate.io>
  • Loading branch information
mathetake committed Nov 10, 2020
1 parent 376ffaf commit b416250
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions include/proxy-wasm/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ class ContextBase : public RootInterface,

protected:
friend class WasmBase;
friend class DeferAfterCallActions;

void initializeRootBase(WasmBase *wasm, std::shared_ptr<PluginBase> plugin);
std::string makeRootLogPrefix(std::string_view vm_id) const;
Expand All @@ -402,11 +403,12 @@ class ContextBase : public RootInterface,

class DeferAfterCallActions {
public:
DeferAfterCallActions(ContextBase *context) : wasm_(context->wasm()) {}
DeferAfterCallActions(ContextBase *context) : context_(context) {}
~DeferAfterCallActions();

protected:
private:
WasmBase *const wasm_;
ContextBase *const context_;
};

uint32_t resolveQueueForTest(std::string_view vm_id, std::string_view queue_name);
Expand Down
5 changes: 4 additions & 1 deletion src/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ SharedData global_shared_data;

} // namespace

DeferAfterCallActions::~DeferAfterCallActions() { wasm_->doAfterVmCallActions(); }
DeferAfterCallActions::~DeferAfterCallActions() {
context_->stop_iteration_ = false;
context_->wasm()->doAfterVmCallActions();
}

WasmResult BufferBase::copyTo(WasmBase *wasm, size_t start, size_t length, uint64_t ptr_ptr,
uint64_t size_ptr) const {
Expand Down

0 comments on commit b416250

Please sign in to comment.