Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge(*) host properties FFI getter/setter
- Properties - Rename to project patterns (e.g. `_handler_pt`, `host_props`) and "host property getter/setter" from within the FFI. Since the feature can only be used through the FFI, proxy_wasm_properties know it as "FFI host props getter/setter". - Guard feature to OpenResty builds. - Share the request pointer between getter/setter. - Use `crc32` for rbtree hashes like all other rbtrees in codebase (and move `hash_str` to HTTP-only builds) - Various optimizations and readability improvements (e.g. assertions for readers). - FFI - **Breaking change**: rename `proxy_wasm.set_property_(s|g)etter()` to `proxy_wasm.set_host_properties_(s|g)etter()` -> less confusing since `set_property_getter` feels like setting a single property getter handler (and doesn't mention "host properties), while all other parts of the code refer to host properties in plural form. It's "host properties" or "host_props" for code abbreviations. In fact speaking about this API, I would even be in favor of merging the setter/getter functions into a single FFI call: `set_host_properties_handlers`, as I do not see the benefit of splitting the operation in two different calls, it feels unnecessarily bloated or "copy-pasted" for easy-mirroring. - Re-organize proxy_wasm.lua. - Fix FFI definitions signatures (`int`). - `store_c_value` without `retrieve` in setter (for the reader). - Avoid double-logging getter/setter callback errors. - Allow logging in callbacks (with `set_r` patch from Hisham). - Obtain callback errors in the FFI `proxy_wasm.get/set_property()` err return value, this error has no stacktrace hence contains some format with the property key. - Hostcalls - Produce a trap on callback errors. - Tests - Trim all test cases to bare-minimum. - Switch multiple log checks to `--- grep_error_log`. - Test logging in callbacks. - Test yielding behavior in callbacks. - Test errors through FFI + filters in both getters/setters. - Rename and reorder properties tests consistently between 03-proxy-wasm and 04-openresty.
- Loading branch information