-
Notifications
You must be signed in to change notification settings - Fork 29
/
dubbo_protocol_impl.h
41 lines (32 loc) · 1.43 KB
/
dubbo_protocol_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "src/application_protocols/dubbo/protocol.h"
namespace Envoy {
namespace Extensions {
namespace NetworkFilters {
namespace MetaProtocolProxy {
namespace Dubbo {
class DubboProtocolImpl : public Protocol {
public:
DubboProtocolImpl() = default;
~DubboProtocolImpl() override = default;
const std::string& name() const override { return ProtocolNames::get().fromType(type()); }
ProtocolType type() const override { return ProtocolType::Dubbo; }
std::pair<ContextSharedPtr, bool> decodeHeader(Buffer::Instance& buffer,
MessageMetadataSharedPtr metadata) override;
bool decodeData(Buffer::Instance& buffer, ContextSharedPtr context,
MessageMetadataSharedPtr metadata) override;
bool encode(Buffer::Instance& buffer, const MessageMetadata& metadata, const Context& ctx,
const std::string& content, RpcResponseType type) override;
static constexpr uint8_t MessageSize = 16;
static constexpr int32_t MaxBodySize = 16 * 1024 * 1024;
private:
void headerMutation(Buffer::Instance& buffer, const MessageMetadata& metadata,
const Context& context);
void rspheaderMutation(Buffer::Instance& buffer, const MessageMetadata& metadata,
const Context& context);
};
} // namespace Dubbo
} // namespace MetaProtocolProxy
} // namespace NetworkFilters
} // namespace Extensions
} // namespace Envoy