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

Function output_encoder_stream_data

src/proxy/http3/test/test_QPACK.cc:152–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void
153output_encoder_stream_data(FILE *fd, TestQUICStream *stream)
154{
155 uint8_t buf[1024];
156
157 // Write StreamId (0)
158 uint64_t stream_id = 0;
159 fwrite(reinterpret_cast<uint8_t *>(&stream_id), 8, 1, fd);
160
161 // Skip 32 bits for Length
162 fseek(fd, 4, SEEK_CUR);
163
164 // Write QPACKData
165 uint64_t total, nread;
166 total = 0;
167 while ((nread = stream->read(buf, sizeof(buf))) > 0) {
168 fwrite(buf, nread, 1, fd);
169 total += nread;
170 }
171
172 // Back to the position for Length
173 fseek(fd, -(total + 4), SEEK_CUR);
174
175 // Write Length
176 uint32_t len = htobe32(total);
177 fwrite(reinterpret_cast<uint8_t *>(&len), 4, 1, fd);
178
179 // Back to the tail
180 fseek(fd, 0, SEEK_END);
181}
182
183void
184output_encoded_data(FILE *fd, uint64_t stream_id, IOBufferReader *header_block_reader)

Callers 1

test_encodeFunction · 0.85

Calls 2

htobe32Function · 0.85
readMethod · 0.45

Tested by

no test coverage detected