From 9d1a1e478af98eefcd73e0ed2f755943c9ba2a3d Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 7 Oct 2010 00:08:48 +0200 Subject: [PATCH] chunk_queue: Remove cq_force_enqueue(). It was only used by the UDP sender which does not use chunk queueing any more. --- chunk_queue.c | 28 ---------------------------- chunk_queue.h | 1 - 2 files changed, 29 deletions(-) diff --git a/chunk_queue.c b/chunk_queue.c index 468b1dc2..3928edd7 100644 --- a/chunk_queue.c +++ b/chunk_queue.c @@ -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. * diff --git a/chunk_queue.h b/chunk_queue.h index 9e794ba8..3c138eb5 100644 --- a/chunk_queue.h +++ b/chunk_queue.h @@ -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); -- 2.39.5