+ max_deq = svm_fifo_max_dequeue_cons (session->rx_fifo);
+
+ if (session->is_dgram)
+ {
+ session_dgram_pre_hdr_t ph;
+
+ if (max_deq <= SESSION_CONN_HDR_LEN)
+ return 0;
+ if (svm_fifo_peek (session->rx_fifo, 0, sizeof (ph), (u8 *) & ph) < 0)
+ return 0;
+ if (ph.data_length + SESSION_CONN_HDR_LEN > max_deq)
+ return 0;
+
+ return ph.data_length;
+ }
+
+ return max_deq;