This evades the COMM_ERR_PROTOCOL results from comm_connect_addr.
Ideally those errors would now be unused, however there are still
components which call comm_connect_addr directly.
/* find some socket we can use. will also bind the local address to it if needed. */
while(paths->size() > 0 && (*i)->fd <= 0) {
+#if USE_IPV6
+ /* outbound sockets have no need to be protocol agnostic. */
+ if ((*i)->local.IsIPv6() && (*i)->local.IsIPv4()) {
+ (*i)->local.SetIPv4();
+ }
+#endif
(*i)->fd = comm_openex(SOCK_STREAM, IPPROTO_TCP, (*i)->local, (*i)->flags, (*i)->tos, host);
if ((*i)->fd <= 0) {
debugs(5 , 2, HERE << "Unable to connect " << (*i)->local << " -> " << (*i)->remote << " for " << host);
if (status > HTTP_INVALID_HEADER)
return;
- assert(tries);
-
- tries--;
+ assert(tries >= 0);
if (tries > MAX_FWD_STATS_IDX)
tries = MAX_FWD_STATS_IDX;