From 77721ac8e39c366d149729ba9c51c92bf142dc42 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Thu, 21 May 2020 07:58:56 +0200 Subject: [PATCH] Generate ETIMEDOUT when remaining_time is reached and EHOSTDOWN when all addresses are tried --- cups/http-addrlist.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 --; -- 2.47.2