From: Zdenek Dohnal Date: Thu, 21 May 2020 05:58:56 +0000 (+0200) Subject: Generate ETIMEDOUT when remaining_time is reached and EHOSTDOWN when all addresses... X-Git-Tag: v2.3.3op1~86^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77721ac8e39c366d149729ba9c51c92bf142dc42;p=thirdparty%2Fcups.git Generate ETIMEDOUT when remaining_time is reached and EHOSTDOWN when all addresses are tried --- diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index 485c6f43da..a246394244 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -238,7 +238,10 @@ httpAddrConnect2( } if (!addrlist && nfds == 0) + { + errno = EHOSTDOWN; break; + } /* * See if we can connect to any of the addresses so far... @@ -369,6 +372,9 @@ httpAddrConnect2( remaining -= 250; } + if (remaining <= 0) + errno = ETIMEDOUT; + while (nfds > 0) { nfds --;