| 174 | } |
| 175 | |
| 176 | void 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. |
| 193 | class ThriftClosure : public google::protobuf::Closure { |
no test coverage detected