| 33 | namespace protocol { |
| 34 | |
| 35 | void THeaderProtocol::resetProtocol() { |
| 36 | if (proto_ && protoId_ == trans_->getProtocolId()) { |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | protoId_ = trans_->getProtocolId(); |
| 41 | |
| 42 | switch (protoId_) { |
| 43 | case T_BINARY_PROTOCOL: |
| 44 | proto_ = std::make_shared<TBinaryProtocolT<THeaderTransport> >(trans_); |
| 45 | break; |
| 46 | |
| 47 | case T_COMPACT_PROTOCOL: |
| 48 | proto_ = std::make_shared<TCompactProtocolT<THeaderTransport> >(trans_); |
| 49 | break; |
| 50 | |
| 51 | default: |
| 52 | throw TApplicationException(TApplicationException::INVALID_PROTOCOL, |
| 53 | "Unknown protocol requested"); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | uint32_t THeaderProtocol::writeMessageBegin(const std::string& name, |
| 58 | const TMessageType messageType, |
no test coverage detected