From 731fcaf98fc3892c827d98cb85603a6becc116ad Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 19 Feb 2004 12:34:50 +0000 Subject: [PATCH] (iovec, ioq_peekiov, ioqtoiov): Unused, minor portability complication, remove. --- src/client/ioqueue.c | 58 -------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/src/client/ioqueue.c b/src/client/ioqueue.c index 5d735b61..68044126 100644 --- a/src/client/ioqueue.c +++ b/src/client/ioqueue.c @@ -35,24 +35,11 @@ #include #include #include -#ifndef _WIN32 -#include -#include -#endif #include "misc.h" #include "queue.h" #include "ioqueue.h" -#ifdef _WIN32 -typedef struct iovec { - char *iov_base; - int iov_len; -} iovec_t; -#endif - - static int ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc); -static int ioqtoiov(register struct ioqueue *ioq, register struct iovec *iov, register int max); static void enqueuecc(struct ioqueue *ioq, s_char *buf, int cc); static int dequeuecc(register struct ioqueue *ioq, register int cc); @@ -72,19 +59,6 @@ ioq_init(struct ioqueue *ioq, int bsize) *num_teles = '\0'; } -/* - * copy batch of pointers into the passed - * iovec, but don't actually dequeue the data. - * return # of iovec initialized. - */ -int -ioq_peekiov(struct ioqueue *ioq, struct iovec *iov, int max) -{ - if (ioq->cc <= 0) - return 0; - return ioqtoiov(ioq, iov, max); -} - /* * Copy the specified number of characters into the buffer * provided, without actually dequeueing the data. Return @@ -202,38 +176,6 @@ ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc) return offset - buf; } -/* - * translate "around" max bytes to an iovec - * array. The limit max is only advisory, - * and more may get buffered. It is an attempt to limit - * really silly sends -- like sending 40k on a socket - * with one writev for example. This makes the processing - * of a full ioqueue still be quick. - */ -static int -ioqtoiov(register struct ioqueue *ioq, register struct iovec *iov, register int max) -{ - register struct io *io; - register int cc; - register int niov; - struct qelem *qp; - - cc = 0; - niov = 0; - qp = ioq->queue.q_forw; - for (qp = ioq->queue.q_forw; qp != &ioq->queue; qp = qp->q_forw) { - io = (struct io *)qp; - if (niov >= MAXIOV || cc >= max) - break; - iov->iov_base = io->data + io->offset; - iov->iov_len = io->nbytes - io->offset; - cc += io->nbytes - io->offset; - niov++; - iov++; - } - return niov; -} - /* * append a buffer to the end of the ioq. */