proxy-wasm-rust-sdk
proxy-wasm-rust-sdk copied to clipboard
Fix BorrowMutError panic when invoking dispatch_grpc_call() from on_grpc_call_response()
Panic with message "proxy-wasm-rust-sdk/src/dispatcher.rs:121:14:\nalready borrowed: BorrowMutError" is triggered when dispatch_grpc_call() is invoked from on_grpc_call_response(). The problem is originated by a self.grpc_callouts.borrow_mut() being invoked inside an if condition, that keeps the RefMut alive until the true branch ends.
This PR adopts the same approach than on_http_call_response(), by invoking the RefCell::borrow_mut() outside the if condition.