- QUIC_DBG (1, "EGRESS %lu bytes in TX", *len);
- memcpy (dst, sbuf->egress.buf.base + off, *len);
+ /* TODO, use something like : return svm_fifo_peek (f, off, *len, dst); */
+ max_rd_chunk = svm_fifo_max_read_chunk (f);
+
+ first_deq = 0;
+ if (off < max_rd_chunk)
+ {
+ first_deq = clib_min (*len, max_rd_chunk - off);
+ clib_memcpy_fast (dst, svm_fifo_head (f) + off, first_deq);
+ }
+
+ if (max_rd_chunk < off + *len)
+ {
+ rem_offset = max_rd_chunk < off ? off - max_rd_chunk : 0;
+ clib_memcpy_fast (dst + first_deq, f->head_chunk->data + rem_offset,
+ *len - first_deq);
+ }