MCPcopy Create free account
hub / github.com/apache/brpc / ReadThriftException

Function ReadThriftException

src/brpc/policy/thrift_protocol.cpp:176–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void ReadThriftException(const butil::IOBuf& body,
177 ::apache::thrift::TApplicationException* x) {
178 size_t body_len = body.size();
179 uint8_t* thrift_buffer = (uint8_t*)malloc(body_len);
180 body.copy_to(thrift_buffer, body_len);
181 auto in_buffer =
182 THRIFT_STDCXX::make_shared<apache::thrift::transport::TMemoryBuffer>(
183 thrift_buffer, body_len,
184 ::apache::thrift::transport::TMemoryBuffer::TAKE_OWNERSHIP);
185 apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer> iprot(in_buffer);
186
187 x->read(&iprot);
188 iprot.readMessageEnd();
189 iprot.getTransport()->readEnd();
190}
191
192// The continuation of request processing. Namely send response back to client.
193class ThriftClosure : public google::protobuf::Closure {

Callers 1

ProcessThriftResponseFunction · 0.85

Calls 2

sizeMethod · 0.45
copy_toMethod · 0.45

Tested by

no test coverage detected