Skip to content

Instantly share code, notes, and snippets.

@shawncao
Created July 23, 2019 14:46
Show Gist options
  • Save shawncao/7f3d6bb26feb2e0f48888a5ea4ab0f53 to your computer and use it in GitHub Desktop.
Save shawncao/7f3d6bb26feb2e0f48888a5ea4ab0f53 to your computer and use it in GitHub Desktop.
// Deserialize by pulling the
- static grpc::Status Deserialize(grpc_byte_buffer *buffer,
+ static grpc::Status Deserialize(ByteBuffer *bb,
flatbuffers::grpc::Message<T> *msg) {
- if (!buffer) {
+ grpc_byte_buffer* buffer = nullptr;
+ if (!bb || !(buffer = bb->c_buffer())) {
return ::grpc::Status(::grpc::StatusCode::INTERNAL, "No payload");
}
// Check if this is a single uncompressed slice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment