Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/proxy-wasm/wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ std::shared_ptr<WasmHandleBase> getThreadLocalWasm(std::string_view vm_id);
class PluginHandleBase : public std::enable_shared_from_this<PluginHandleBase> {
public:
explicit PluginHandleBase(std::shared_ptr<WasmHandleBase> wasm_handle,
std::string_view plugin_key)
: wasm_handle_(wasm_handle), plugin_key_(plugin_key) {}
std::shared_ptr<PluginBase> plugin)
: wasm_handle_(wasm_handle), plugin_key_(plugin->key()) {}
~PluginHandleBase() { wasm_handle_->wasm()->startShutdown(plugin_key_); }

std::shared_ptr<WasmBase> &wasm() { return wasm_handle_->wasm(); }
Expand All @@ -295,7 +295,7 @@ class PluginHandleBase : public std::enable_shared_from_this<PluginHandleBase> {
};

using PluginHandleFactory = std::function<std::shared_ptr<PluginHandleBase>(
std::shared_ptr<WasmHandleBase> base_wasm, std::string_view plugin_key)>;
std::shared_ptr<WasmHandleBase> base_wasm, std::shared_ptr<PluginBase> plugin)>;

// Get an existing ThreadLocal VM matching 'vm_id' or create one using 'base_wavm' by cloning or by
// using it it as a template.
Expand Down
2 changes: 1 addition & 1 deletion src/wasm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ std::shared_ptr<PluginHandleBase> getOrCreateThreadLocalPlugin(
"Failed to configure thread-local Wasm plugin");
return nullptr;
}
auto plugin_handle = plugin_factory(wasm_handle, plugin->key());
auto plugin_handle = plugin_factory(wasm_handle, plugin);
local_plugins[key] = plugin_handle;
return plugin_handle;
}
Expand Down