Skip to content

Instantly share code, notes, and snippets.

@shawncao
Created July 23, 2019 14:46
Show Gist options
  • Select an option

  • Save shawncao/7f3d6bb26feb2e0f48888a5ea4ab0f53 to your computer and use it in GitHub Desktop.

Select an option

Save shawncao/7f3d6bb26feb2e0f48888a5ea4ab0f53 to your computer and use it in GitHub Desktop.

Revisions

  1. shawncao created this gist Jul 23, 2019.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    // 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.