From: Andre Noll Date: Wed, 6 Oct 2010 22:08:48 +0000 (+0200) Subject: chunk_queue: Remove cq_force_enqueue(). X-Git-Tag: v0.4.5~2^2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=9d1a1e478af98eefcd73e0ed2f755943c9ba2a3d;p=paraslash.git chunk_queue: Remove cq_force_enqueue(). It was only used by the UDP sender which does not use chunk queueing any more. --- 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);