]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
chunk_queue: Remove cq_force_enqueue().
authorAndre Noll <maan@systemlinux.org>
Wed, 6 Oct 2010 22:08:48 +0000 (00:08 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 31 Oct 2010 11:18:25 +0000 (12:18 +0100)
It was only used by the UDP sender which does not use chunk queueing
any more.

chunk_queue.c
chunk_queue.h

index 468b1dc2dd4828796d53e5804d6f28611b88c462..3928edd7ebdf69c99023579c9cc6b147bbd4baab 100644 (file)
@@ -93,34 +93,6 @@ void cq_dequeue(struct chunk_queue *cq)
        free(qc);
 }
 
-/**
- * Force to add a chunk to the given queue.
- *
- * \param cq See \ref cq_enqueue.
- * \param buf See \ref cq_enqueue.
- * \param num_bytes See \ref cq_enqueue.
- *
- * If queuing the given buffer would result in exceeding the maximal queue
- * size, buffers are dropped from the beginning of the queue. Note that this
- * function still might fail.
- *
- * \return Standard.
- */
-int cq_force_enqueue(struct chunk_queue *cq, const char *buf, size_t num_bytes)
-{
-       int ret;
-
-       if (num_bytes > cq->max_pending)
-               return -E_QUEUE;
-       for (;;) {
-               ret = cq_enqueue(cq, buf, num_bytes);
-               if (ret >= 0)
-                       return ret;
-               cq_dequeue(cq);
-       }
-       /* never reached */
-}
-
 /**
  * Change the number of bytes sent for the current queued chunk.
  *
index 9e794ba8e8afd524f4837bf9be7ee891ecd8f4e3..3c138eb50f487b299e176da766786bd97b35d147 100644 (file)
@@ -16,4 +16,3 @@ void cq_update(struct chunk_queue *cq, size_t sent);
 int cq_get(struct queued_chunk *qc, const char **buf, size_t *len);
 struct chunk_queue *cq_new(size_t max_pending);
 void cq_destroy(struct chunk_queue *cq);
-int cq_force_enqueue(struct chunk_queue *cq, const char *buf, size_t num_bytes);