*frm = NULL;
}
+/* Move forward <strm> STREAM frame by <data> bytes. */
+static inline void qc_stream_frm_mv_fwd(struct quic_stream *strm, uint64_t data)
+{
+ struct buffer cf_buf;
+
+ strm->offset.key += data;
+ strm->len -= data;
+ cf_buf = b_make(b_orig(strm->buf),
+ b_size(strm->buf),
+ (char *)strm->data - b_orig(strm->buf), 0);
+ strm->data = (unsigned char *)b_peek(&cf_buf, data);
+}
+
#endif /* USE_QUIC */
#endif /* _HAPROXY_QUIC_FRAME_H */
continue;
}
else if (strm_frm->offset.key < stream_desc->ack_offset) {
- strm_frm->offset.key = stream_desc->ack_offset;
- strm_frm->len -= stream_desc->ack_offset - strm_frm->offset.key;
+ uint64_t diff = stream_desc->ack_offset - strm_frm->offset.key;
+
+ qc_stream_frm_mv_fwd(strm_frm, diff);
TRACE_DEVEL("updated partially acked frame",
QUIC_EV_CONN_PRSAFRM, qc, frm);
}
continue;
}
else if (strm_frm->offset.key < stream_desc->ack_offset) {
- strm_frm->offset.key = stream_desc->ack_offset;
- strm_frm->len -= stream_desc->ack_offset - strm_frm->offset.key;
+ uint64_t diff = stream_desc->ack_offset - strm_frm->offset.key;
+
+ qc_stream_frm_mv_fwd(strm_frm, diff);
TRACE_DEVEL("updated partially acked frame",
QUIC_EV_CONN_PRSAFRM, qc, frm);
}
continue;
}
else if (strm->offset.key < stream_desc->ack_offset) {
- strm->offset.key = stream_desc->ack_offset;
- strm->len -= stream_desc->ack_offset - strm->offset.key;
+ uint64_t diff = stream_desc->ack_offset - strm->offset.key;
+
+ qc_stream_frm_mv_fwd(strm, diff);
TRACE_DEVEL("updated partially acked frame",
QUIC_EV_CONN_PRSAFRM, qc, cf);
}