From: Michael Sweet Date: Thu, 5 Oct 2017 19:04:19 +0000 (-0400) Subject: The network backends now retry on more error conditions (Issue #5123) X-Git-Tag: v2.2.5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cf66fef48e992ae8f8196db50a742c6276e415b;p=thirdparty%2Fcups.git The network backends now retry on more error conditions (Issue #5123) --- diff --git a/CHANGES.md b/CHANGES.md index 1bdf177b22..19947a2efc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,6 +44,7 @@ CHANGES IN CUPS V2.2.5 directive in `cups-files.conf` to the list of deprecated configuration directives (Issue #5117) - Added USB quirk rule for HP LaserJet 1160 printer (Issue #5121) +- The network backends now retry on more error conditions (Issue #5123) - `httpAddrConnect` leaked sockets in certain circumstances, causing some printers to hang (rdar://31965686) - Fixed an issue with Chinese localizations on macOS (rdar://32419311) diff --git a/backend/ipp.c b/backend/ipp.c index 685d4d9dff..588ad995ed 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -743,8 +743,7 @@ main(int argc, /* I - Number of command-line args */ fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(errno)); - if (errno == ECONNREFUSED || errno == EHOSTDOWN || - errno == EHOSTUNREACH) + if (errno == ECONNREFUSED || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == ETIMEDOUT || errno == ENOTCONN) { if (contimeout && (time(NULL) - start_time) > contimeout) { @@ -763,13 +762,13 @@ main(int argc, /* I - Number of command-line args */ break; case EHOSTUNREACH : + default : _cupsLangPrintFilter(stderr, "WARNING", _("The printer is unreachable at this " "time.")); break; case ECONNREFUSED : - default : _cupsLangPrintFilter(stderr, "WARNING", _("The printer is in use.")); break; diff --git a/backend/lpd.c b/backend/lpd.c index 835f9eaeee..4325b7c788 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -867,8 +867,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(error)); - if (error == ECONNREFUSED || error == EHOSTDOWN || - error == EHOSTUNREACH) + if (errno == ECONNREFUSED || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == ETIMEDOUT || errno == ENOTCONN) { if (contimeout && (time(NULL) - start_time) > contimeout) { @@ -886,13 +885,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ break; case EHOSTUNREACH : + default : _cupsLangPrintFilter(stderr, "WARNING", _("The printer is unreachable at " "this time.")); break; case ECONNREFUSED : - default : _cupsLangPrintFilter(stderr, "WARNING", _("The printer is in use.")); break; diff --git a/backend/socket.c b/backend/socket.c index 7fc0880f16..c16a1a097d 100644 --- a/backend/socket.c +++ b/backend/socket.c @@ -330,8 +330,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(error)); - if (error == ECONNREFUSED || error == EHOSTDOWN || - error == EHOSTUNREACH) + if (errno == ECONNREFUSED || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == ETIMEDOUT || errno == ENOTCONN) { if (contimeout && (time(NULL) - start_time) > contimeout) { @@ -349,13 +348,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ break; case EHOSTUNREACH : + default : _cupsLangPrintFilter(stderr, "WARNING", _("The printer is unreachable at this " "time.")); break; case ECONNREFUSED : - default : _cupsLangPrintFilter(stderr, "WARNING", _("The printer is in use.")); break;