MCPcopy Create free account
hub / github.com/apache/trafficserver / http2_write_frame_header

Function http2_write_frame_header

src/proxy/http2/HTTP2.cc:202–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202bool
203http2_write_frame_header(const Http2FrameHeader &hdr, IOVec iov)
204{
205 byte_pointer ptr(iov.iov_base);
206
207 if (unlikely(iov.iov_len < HTTP2_FRAME_HEADER_LEN)) {
208 return false;
209 }
210
211 byte_addressable_value<uint32_t> length;
212 // cppcheck-suppress unreadVariable ; it's an union and be read as pval.bytes
213 length.value = htonl(hdr.length);
214 // MSB length.bytes[0] is unused.
215 write_and_advance(ptr, length.bytes[1]);
216 write_and_advance(ptr, length.bytes[2]);
217 write_and_advance(ptr, length.bytes[3]);
218
219 write_and_advance(ptr, hdr.type);
220 write_and_advance(ptr, hdr.flags);
221 write_and_advance(ptr, hdr.streamid);
222
223 return true;
224}
225
226bool
227http2_write_rst_stream(uint32_t error_code, IOVec iov)

Callers 1

write_toMethod · 0.85

Calls 1

write_and_advanceFunction · 0.85

Tested by

no test coverage detected