Skip to content

Commit d1e7040

Browse files
authored
Move get_log_level to ABI version 0.2.1 (#50)
Signed-off-by: Gregory Brail <[email protected]>
1 parent e73c498 commit d1e7040

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

include/proxy-wasm/wasm_vm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ enum class Cloneable {
101101
InstantiatedModule // VMs can be cloned from an instantiated module.
102102
};
103103

104-
enum class AbiVersion { ProxyWasm_0_1_0, ProxyWasm_0_2_0, Unknown };
104+
enum class AbiVersion { ProxyWasm_0_1_0, ProxyWasm_0_2_0, ProxyWasm_0_2_1, Unknown };
105105

106106
class NullPlugin;
107107

src/null/null_vm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ bool NullVm::load(const std::string &name, bool /* allow_precompiled */) {
5757
return true;
5858
}
5959

60-
AbiVersion NullVm::getAbiVersion() { return AbiVersion::ProxyWasm_0_2_0; }
60+
AbiVersion NullVm::getAbiVersion() { return AbiVersion::ProxyWasm_0_2_1; }
6161

6262
bool NullVm::link(std::string_view /* name */) { return true; }
6363

src/v8/v8.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ AbiVersion V8::getAbiVersion() {
378378
return AbiVersion::ProxyWasm_0_1_0;
379379
} else if (name == "proxy_abi_version_0_2_0") {
380380
return AbiVersion::ProxyWasm_0_2_0;
381+
} else if (name == "proxy_abi_version_0_2_1") {
382+
return AbiVersion::ProxyWasm_0_2_1;
381383
}
382384
}
383385
}

src/wasm.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ void WasmBase::registerCallbacks() {
141141
&ConvertFunctionWordToUint32<decltype(exports::_fn), \
142142
exports::_fn>::convertFunctionWordToUint32);
143143
_REGISTER_PROXY(log);
144-
_REGISTER_PROXY(get_log_level);
145144

146145
_REGISTER_PROXY(get_status);
147146

@@ -198,6 +197,10 @@ void WasmBase::registerCallbacks() {
198197
} else if (abiVersion() == AbiVersion::ProxyWasm_0_2_0) {
199198
_REGISTER_PROXY(continue_stream);
200199
_REGISTER_PROXY(close_stream);
200+
} else if (abiVersion() == AbiVersion::ProxyWasm_0_2_1) {
201+
_REGISTER_PROXY(continue_stream);
202+
_REGISTER_PROXY(close_stream);
203+
_REGISTER_PROXY(get_log_level);
201204
}
202205
#undef _REGISTER_PROXY
203206
}
@@ -247,7 +250,8 @@ void WasmBase::getFunctions() {
247250
if (abiVersion() == AbiVersion::ProxyWasm_0_1_0) {
248251
_GET_PROXY_ABI(on_request_headers, _abi_01);
249252
_GET_PROXY_ABI(on_response_headers, _abi_01);
250-
} else if (abiVersion() == AbiVersion::ProxyWasm_0_2_0) {
253+
} else if (abiVersion() == AbiVersion::ProxyWasm_0_2_0 ||
254+
abiVersion() == AbiVersion::ProxyWasm_0_2_1) {
251255
_GET_PROXY_ABI(on_request_headers, _abi_02);
252256
_GET_PROXY_ABI(on_response_headers, _abi_02);
253257
_GET_PROXY(on_foreign_function);

0 commit comments

Comments
 (0)