Skip to content
Merged
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
9 changes: 6 additions & 3 deletions proxy_wasm_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ template <typename Pairs> void exportPairs(const Pairs &pairs, const char **ptr,
char *buffer = static_cast<char *>(::malloc(size));
marshalPairs(pairs, buffer);
*size_ptr = size;
*ptr = buffer;
}

struct PairHash {
Expand Down Expand Up @@ -609,9 +610,11 @@ inline WasmResult sendLocalResponse(uint32_t response_code, std::string_view res
const char *ptr = nullptr;
size_t size = 0;
exportPairs(additional_response_headers, &ptr, &size);
return proxy_send_local_response(response_code, response_code_details.data(),
response_code_details.size(), body.data(), body.size(), ptr,
size, static_cast<uint32_t>(grpc_status));
WasmResult result = proxy_send_local_response(
response_code, response_code_details.data(), response_code_details.size(), body.data(),
body.size(), ptr, size, static_cast<uint32_t>(grpc_status));
::free(const_cast<char *>(ptr));
return result;
}

// SharedData
Expand Down