tls svm: prealloc tcp fifo chunks before ssl write
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7c47b55ec6f0c83f2d13e0e737d0559a32f7c837
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c
index 14eeb1c..2150694 100644
--- a/src/svm/svm_fifo.c
+++ b/src/svm/svm_fifo.c
@@ -1257,6 +1257,9 @@
if (n_avail < len && f_try_chunk_alloc (f, head, tail, len))
return SVM_FIFO_EGROW;
+ if (!fs || !n_segs)
+ return 0;
+
c = f_tail_cptr (f);
head_pos = (tail - c->start_byte);
fs[0].data = c->data + head_pos;