| 200 | } |
| 201 | |
| 202 | bool |
| 203 | http2_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 | |
| 226 | bool |
| 227 | http2_write_rst_stream(uint32_t error_code, IOVec iov) |
no test coverage detected