commit | 233683180638d1c7f517b713722cbbeb3b4be86e | [log] [tgz] |
---|---|---|
author | Florin Coras <fcoras@cisco.com> | Fri Jun 04 16:28:18 2021 -0700 |
committer | Dave Barach <openvpp@barachs.net> | Mon Jun 07 15:24:21 2021 +0000 |
tree | 11d230519c859267d3b964fb02d399cc58847de5 | |
parent | 778b3186fc911af2aabbbfbf56bc1df5e2373061 [diff] [blame] |
vcl: avoid multiple reads on peek Only try once and return what was found. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I50b1d26babf1b7431d36f6b7472a1fb01475bb35
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index e98f9b7..4c77b0b 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c
@@ -1987,6 +1987,10 @@ rv = app_recv_stream_raw (rx_fifo, buf, n, 0, peek); ASSERT (rv >= 0); + + if (peek) + return rv; + n_read += rv; if (svm_fifo_is_empty_cons (rx_fifo))