Skip to content

Commit edbdbef

Browse files
committed
Pass plugin_key by embedders
Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent 7b64da1 commit edbdbef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/proxy-wasm/context.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ class WasmVm;
4545
* @param vm_id is a string used to differentiate VMs with the same code and VM configuration.
4646
* @param plugin_configuration is configuration for this plugin.
4747
* @param fail_open if true the plugin will pass traffic as opposed to close all streams.
48+
* @param key is used for caching PluginHandleBase per thread and determining whether to create a
49+
* new PluginHandleBase.
4850
*/
4951
struct PluginBase {
5052
PluginBase(std::string_view name, std::string_view root_id, std::string_view vm_id,
51-
std::string_view runtime, std::string_view plugin_configuration, bool fail_open)
53+
std::string_view runtime, std::string_view plugin_configuration, bool fail_open,
54+
std::string_view key)
5255
: name_(std::string(name)), root_id_(std::string(root_id)), vm_id_(std::string(vm_id)),
5356
runtime_(std::string(runtime)), plugin_configuration_(plugin_configuration),
54-
fail_open_(fail_open), key_(root_id_ + "||" + plugin_configuration_),
55-
log_prefix_(makeLogPrefix()) {}
57+
fail_open_(fail_open), key_(key), log_prefix_(makeLogPrefix()) {}
5658

5759
const std::string name_;
5860
const std::string root_id_;

0 commit comments

Comments
 (0)