in neqo-http3/src/server.rs [290:323]
fn prepare_data(
stream_info: Http3StreamInfo,
handler_borrowed: &mut RefMut<Http3ServerHandler>,
conn: &ConnectionRef,
handler: &HandlerRef,
now: Instant,
events: &Http3ServerEvents,
) {
loop {
let mut data = vec![0; MAX_EVENT_DATA_SIZE];
let res = handler_borrowed.read_data(
&mut conn.borrow_mut(),
now,
stream_info.stream_id(),
&mut data,
);
if let Ok((amount, fin)) = res {
if amount > 0 || fin {
if amount < MAX_EVENT_DATA_SIZE {
data.resize(amount, 0);
}
events.data(conn.clone(), Rc::clone(handler), stream_info, data, fin);
}
if amount < MAX_EVENT_DATA_SIZE || fin {
break;
}
} else {
// Any error will closed the handler, just ignore this event, the next event must
// be a state change event.
break;
}
}
}