size_t pos = 0;
while (pos < len) {
+ // send_body takes care of setting fin to false if it cannot send the entire content so we can try again.
auto res = quiche_h3_send_body(conn, quic_conn,
streamID, const_cast<uint8_t*>(body) + pos, len - pos, true);
if (res < 0) {
pos = 0;
while (pos < response.size()) {
+ // stream_send sets fin to false itself when the capacity of the stream is less than the desired writing length
auto res = quiche_conn_stream_send(conn.d_conn.get(), streamID, &response.at(pos), response.size() - pos, true);
if (res < 0) {
quiche_conn_stream_shutdown(conn.d_conn.get(), streamID, QUICHE_SHUTDOWN_WRITE, static_cast<uint64_t>(DOQ_Error_Codes::DOQ_INTERNAL_ERROR));