From 26ffaa263b627b7ec9ac81bc7241d6ed67501a37 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 29 Jul 2004 07:24:39 +0000 Subject: variable type fix --- ares/ares_process.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'ares') diff --git a/ares/ares_process.c b/ares/ares_process.c index df7c4573d..9e5156e4e 100644 --- a/ares/ares_process.c +++ b/ares/ares_process.c @@ -82,7 +82,8 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now) struct send_request *sendreq; struct iovec *vec; int i; - ssize_t count; + ssize_t scount; + int wcount; size_t n; for (i = 0; i < channel->nservers; i++) @@ -110,21 +111,21 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now) vec[n].iov_len = sendreq->len; n++; } - count = writev(server->tcp_socket, vec, n); + wcount = writev(server->tcp_socket, vec, n); free(vec); - if (count < 0) + if (wcount < 0) { handle_error(channel, i, now); continue; } /* Advance the send queue by as many bytes as we sent. */ - while (count) + while (wcount) { sendreq = server->qhead; - if ((size_t)count >= sendreq->len) + if ((size_t)wcount >= sendreq->len) { - count -= sendreq->len; + wcount -= sendreq->len; server->qhead = sendreq->next; if (server->qhead == NULL) server->qtail = NULL; @@ -132,8 +133,8 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now) } else { - sendreq->data += count; - sendreq->len -= count; + sendreq->data += wcount; + sendreq->len -= wcount; break; } } @@ -143,16 +144,16 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now) /* Can't allocate iovecs; just send the first request. */ sendreq = server->qhead; - count = send(server->tcp_socket, sendreq->data, sendreq->len, 0); + scount = send(server->tcp_socket, sendreq->data, sendreq->len, 0); - if (count < 0) + if (scount < 0) { handle_error(channel, i, now); continue; } /* Advance the send queue by as many bytes as we sent. */ - if ((size_t)count == sendreq->len) + if ((size_t)scount == sendreq->len) { server->qhead = sendreq->next; if (server->qhead == NULL) @@ -161,8 +162,8 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now) } else { - sendreq->data += count; - sendreq->len -= count; + sendreq->data += scount; + sendreq->len -= scount; } } } -- cgit v1.2.3