vcl: handle incomplete dgram read 50/43850/2
authorFlorin Coras <[email protected]>
Tue, 7 Oct 2025 06:48:19 +0000 (23:48 -0700)
committerFlorin Coras <[email protected]>
Tue, 7 Oct 2025 06:14:46 +0000 (06:14 +0000)
Type: improvement

Change-Id: I06e2c61376630e9c969986fa31cc6a17798b8614
Signed-off-by: Florin Coras <[email protected]>
src/vcl/vppcom.c

index 6364693..75af90c 100644 (file)
@@ -2154,7 +2154,16 @@ vppcom_session_read_internal (uint32_t session_handle, void *buf, int n,
 read_again:
 
   if (s->is_dgram)
-    rv = app_recv_dgram_raw (rx_fifo, buf, n, &s->transport, 0, peek);
+    {
+      rv = app_recv_dgram_raw (rx_fifo, buf, n, &s->transport, 0, peek);
+      /* Incomplete dgram. Probably due to how transport handled the enq */
+      if (PREDICT_FALSE (!rv))
+       {
+         if (is_nonblocking)
+           return VPPCOM_EWOULDBLOCK;
+         goto read_again;
+       }
+    }
   else
     rv = app_recv_stream_raw (rx_fifo, buf, n, 0, peek);