From: Michael R Sweet Date: Thu, 1 Apr 2021 17:12:22 +0000 (-0400) Subject: Add -R option to repeat on server-error-busy (Issue #153) X-Git-Tag: v2.4b1~163^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b834833bcff7ff63d04671fa0d6e3c329840a99;p=thirdparty%2Fcups.git Add -R option to repeat on server-error-busy (Issue #153) --- diff --git a/CHANGES.md b/CHANGES.md index 0081a727cc..9bebc1b7e6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ CUPS v2.4rc1 (Pending) - The USB backend now runs as root (Issue #121) - Added pkg-config file for libcups (Issue #122) - Fixed a PPD memory leak caused by emulator definitions (Issue #124) +- Added several features and improvements to `ipptool` (Issue #153) - The scheduler now includes the `[Job N]` prefix for job log messages, even when using syslog logging (Issue #154) - Added support for locales using the GB18030 character set (Issue #159) diff --git a/tools/ipptool.c b/tools/ipptool.c index 084ebc8c41..6820fd460c 100644 --- a/tools/ipptool.c +++ b/tools/ipptool.c @@ -106,6 +106,7 @@ typedef struct ipptool_test_s /**** Test Data ****/ http_encryption_t encryption; /* Encryption for connection */ int family; /* Address family */ ipptool_output_t output; /* Output mode */ + int repeat_on_busy; /* Repeat tests on server-error-busy */ int stop_after_include_error; /* Stop after include errors? */ double timeout; /* Timeout for connection */ @@ -369,6 +370,10 @@ main(int argc, /* I - Number of command-line args */ } break; + case 'R' : /* Repeat on server-error-busy */ + data.repeat_on_busy = 1; + break; + case 'S' : /* Encrypt with SSL */ #ifdef HAVE_TLS data.encryption = HTTP_ENCRYPT_ALWAYS; @@ -1633,6 +1638,13 @@ do_test(_ipp_file_t *f, /* I - IPP data file */ * values... */ + if (ippGetStatusCode(response) == IPP_STATUS_ERROR_BUSY && data->repeat_on_busy) + { + // Repeat on a server-error-busy status code... + status_ok = 1; + repeat_test = 1; + } + for (i = 0, status_ok = 0; i < data->num_statuses; i ++) { if (data->statuses[i].if_defined && @@ -5095,6 +5107,7 @@ usage(void) _cupsLangPuts(stderr, _("-I Ignore errors")); _cupsLangPuts(stderr, _("-L Send requests using content-length")); _cupsLangPuts(stderr, _("-P filename.plist Produce XML plist to a file and test report to standard output")); + _cupsLangPuts(stderr, _("-R Repeat tests on server-error-busy")); _cupsLangPuts(stderr, _("-S Test with encryption using HTTPS")); _cupsLangPuts(stderr, _("-T seconds Set the receive/send timeout in seconds")); _cupsLangPuts(stderr, _("-V version Set default IPP version"));