void HeaderChannel::checkSupportedClient(CLIENT_TYPE ct) { if (!isSupportedClient(ct)) { throw TApplicationException( TApplicationException::UNSUPPORTED_CLIENT_TYPE, "Transport does not support this client type"); } }
void THeaderProtocol::resetProtocol() { if (proto_ && protoId_ == trans_->getProtocolId() && protoVersion_ == trans_->getProtocolVersion()) { return; } protoId_ = trans_->getProtocolId(); switch (protoId_) { case T_BINARY_PROTOCOL: proto_ = std::shared_ptr<TProtocol>( new TBinaryProtocolT<THeaderTransport>(trans_)); break; case T_COMPACT_PROTOCOL: proto_ = std::shared_ptr<TProtocol>( new TCompactProtocolT<THeaderTransport>(trans_)); break; case T_JSON_PROTOCOL: proto_ = std::shared_ptr<TProtocol>(new TJSONProtocol(trans_)); break; default: throw TApplicationException(TApplicationException::INVALID_PROTOCOL, "Unknown protocol requested"); } protoVersion_ = trans_->getProtocolVersion(); if (protoVersion_ != -1) { proto_->setVersion(protoVersion_); } }
void THeaderProtocol::resetProtocol() { if (proto_ && protoId_ == trans_->getProtocolId()) { return; } protoId_ = trans_->getProtocolId(); switch (protoId_) { case T_BINARY_PROTOCOL: proto_ = stdcxx::make_shared<TBinaryProtocolT<THeaderTransport> >(trans_); break; case T_COMPACT_PROTOCOL: proto_ = stdcxx::make_shared<TCompactProtocolT<THeaderTransport> >(trans_); break; default: throw TApplicationException(TApplicationException::INVALID_PROTOCOL, "Unknown protocol requested"); } }