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

Function SerializeFrameHead

src/brpc/policy/http2_rpc_protocol.cpp:122–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120const size_t H2_CONNECTION_PREFACE_PREFIX_SIZE = 24;
121
122void SerializeFrameHead(void* out_buf,
123 uint32_t payload_size, H2FrameType type,
124 uint8_t flags, uint32_t stream_id) {
125 uint8_t* p = (uint8_t*)out_buf;
126 *p++ = (payload_size >> 16) & 0xFF;
127 *p++ = (payload_size >> 8) & 0xFF;
128 *p++ = payload_size & 0xFF;
129 *p++ = (uint8_t)type;
130 *p++ = flags;
131 *p++ = (stream_id >> 24) & 0xFF;
132 *p++ = (stream_id >> 16) & 0xFF;
133 *p++ = (stream_id >> 8) & 0xFF;
134 *p++ = stream_id & 0xFF;
135}
136
137inline void SerializeFrameHead(void* out_buf, const H2FrameHead& h) {
138 return SerializeFrameHead(out_buf, h.payload_size, h.type,

Callers 9

TEST_FFunction · 0.85
ConsumeMethod · 0.85
OnDataMethod · 0.85
OnSettingsMethod · 0.85
OnPingMethod · 0.85
DeferWindowUpdateMethod · 0.85
PackH2MessageFunction · 0.85
AppendAndDestroySelfMethod · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68