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

Method _handle_uni_stream_on_write_ready

src/proxy/http3/Http3App.cc:335–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335void
336Http3App::_handle_uni_stream_on_write_ready(int /* event */, VIO *vio)
337{
338 QUICStreamVCAdapter *adapter = static_cast<QUICStreamVCAdapter *>(vio->vc_server);
339
340 auto it = this->_local_uni_stream_map.find(adapter->stream().id());
341 if (it == this->_local_uni_stream_map.end()) {
342 ink_abort("stream not found");
343 return;
344 }
345
346 switch (it->second) {
347 case Http3StreamType::CONTROL:
348 if (!this->_is_control_stream_initialized) {
349 uint8_t buf[] = {static_cast<uint8_t>(it->second)};
350 vio->get_writer()->write(buf, sizeof(uint8_t));
351 this->_is_control_stream_initialized = true;
352 } else {
353 size_t nwritten = 0;
354 bool all_done = false;
355 this->_control_stream_collector.on_write_ready(adapter->stream().id(), *vio->get_writer(), nwritten, all_done);
356 vio->nbytes += nwritten;
357 if (all_done) {
358 vio->done();
359 }
360 }
361 break;
362 case Http3StreamType::QPACK_ENCODER:
363 case Http3StreamType::QPACK_DECODER: {
364 this->_set_qpack_stream(it->second, adapter);
365 }
366 case Http3StreamType::UNKNOWN:
367 case Http3StreamType::PUSH:
368 default:
369 break;
370 }
371}
372
373void
374Http3App::_handle_uni_stream_on_write_complete(int event, VIO *vio)

Callers 2

main_event_handlerMethod · 0.95

Calls 9

_set_qpack_streamMethod · 0.95
get_writerMethod · 0.80
on_write_readyMethod · 0.80
ink_abortFunction · 0.50
findMethod · 0.45
idMethod · 0.45
endMethod · 0.45
writeMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected