summaryrefslogtreecommitdiff
path: root/nuttx/include/nuttx/net
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-07 07:28:17 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-07 07:28:17 -0600
commita4e51c1a1e1722d6ada8f4727130569971dd3344 (patch)
tree64a11c2bfacc204e7157e10382fa3419d031fc3e /nuttx/include/nuttx/net
parent1beeff73e138563e949c2afc74d6b07aa06dcb57 (diff)
downloadnuttx-a4e51c1a1e1722d6ada8f4727130569971dd3344.tar.gz
nuttx-a4e51c1a1e1722d6ada8f4727130569971dd3344.tar.bz2
nuttx-a4e51c1a1e1722d6ada8f4727130569971dd3344.zip
NET: Important fix to the read-ahead buffer queue managment: Consumed bytes were being trimmed from the head of the queue, but the queue head itself was not being updated. From Rony XLN
Diffstat (limited to 'nuttx/include/nuttx/net')
-rw-r--r--nuttx/include/nuttx/net/iob.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/net/iob.h b/nuttx/include/nuttx/net/iob.h
index 333e806b3..2cad4fa22 100644
--- a/nuttx/include/nuttx/net/iob.h
+++ b/nuttx/include/nuttx/net/iob.h
@@ -249,7 +249,9 @@ FAR struct iob_s *iob_remove_queue(FAR struct iob_queue_s *iobq);
*
****************************************************************************/
+#if CONFIG_IOB_NCHAINS > 0
FAR struct iob_s *iob_peek_queue(FAR struct iob_queue_s *iobq);
+#endif
/****************************************************************************
* Name: iob_free_queue
@@ -319,6 +321,27 @@ void iob_concat(FAR struct iob_s *iob1, FAR struct iob_s *iob2);
FAR struct iob_s *iob_trimhead(FAR struct iob_s *iob, unsigned int trimlen);
/****************************************************************************
+ * Name: iob_trimhead_queue
+ *
+ * Description:
+ * Remove bytes from the beginning of an I/O chain at the head of the
+ * queue. Emptied I/O buffers are freed and, hence, the head of the
+ * queue may change.
+ *
+ * This function is just a wrapper around iob_trimhead() that assures that
+ * the iob at the head of queue is modified with the trimming operations.
+ *
+ * Returned Value:
+ * The new iob at the head of the queue is returned.
+ *
+ ****************************************************************************/
+
+#if CONFIG_IOB_NCHAINS > 0
+FAR struct iob_s *iob_trimhead_queue(FAR struct iob_queue_s *qhead,
+ unsigned int trimlen);
+#endif
+
+/****************************************************************************
* Name: iob_trimtail
*
* Description: