From: Amos Jeffries Date: Sun, 23 Mar 2008 12:04:09 +0000 (+1200) Subject: Replace a goto with do-while X-Git-Tag: BASIC_TPROXY4~15^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=213b6c90af0f1f36bf33f3c059f7a97bfa762859;p=thirdparty%2Fsquid.git Replace a goto with do-while --- diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 9a9c197062..3aed082c30 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -774,28 +774,26 @@ idnsSendQuery(idns_query * q) assert(q->lru.prev == NULL); -try_again: - ns = q->nsends % nns; + do { + ns = q->nsends % nns; - if (q->need_vc) { - idnsSendQueryVC(q, ns); - x = 0; - } else - x = comm_udp_sendto(DnsSocket, - nameservers[ns].S, - q->buf, - q->sz); + if (q->need_vc) { + idnsSendQueryVC(q, ns); + x = 0; + } else { + x = comm_udp_sendto(DnsSocket, nameservers[ns].S, q->buf, q->sz); + } - q->nsends++; + q->nsends++; - q->sent_t = current_time; + q->sent_t = current_time; - if (x < 0) { - debugs(50, 1, "idnsSendQuery: FD " << DnsSocket << ": sendto: " << xstrerror()); + if (x < 0) + debugs(50, 1, "idnsSendQuery: FD " << DnsSocket << ": sendto: " << xstrerror()); - if (q->nsends % nns != 0) - goto try_again; - } else { + } while( x<0 && q->nsends % nns != 0); + + if(x >= 0) { fd_bytes(DnsSocket, x, FD_WRITE); commSetSelect(DnsSocket, COMM_SELECT_READ, idnsRead, NULL, 0); }