This commit is contained in:
Zdenek Dohnal 2019-01-08 12:00:44 +01:00
parent 6239c46f66
commit 2010263180
4 changed files with 6 additions and 93 deletions

1
.gitignore vendored
View File

@ -87,3 +87,4 @@
/cups-filters-1.20.3.tar.xz
/cups-filters-1.21.2.tar.xz
/cups-filters-1.21.5.tar.xz
/cups-filters-1.21.6.tar.xz

View File

@ -1,88 +0,0 @@
diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index ee361d9a..02de23d1 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -4476,15 +4476,6 @@ gboolean update_cups_queues(gpointer unused) {
current_time = time(NULL);
timeout_reached = 0;
- /* cups-browsed tried to add this print queue unsuccessfully for too
- many times due to timeouts - Skip print queue creation for this one */
- if (p->timeouted >= HttpMaxRetries)
- {
- fprintf(stderr, "Max number of retries (%d) for creating print queue %s reached, skipping it.\n",
- HttpMaxRetries, p->queue_name);
- continue;
- }
-
/* terminating means we have received a signal and should shut down.
in_shutdown means we have exited the main loop.
update_cups_queues() is called after having exited the main loop
@@ -4686,6 +4677,14 @@ gboolean update_cups_queues(gpointer unused) {
if (p->timeout > current_time)
break;
+ /* cups-browsed tried to add this print queue unsuccessfully for too
+ many times due to timeouts - Skip print queue creation for this one */
+ if (p->timeouted >= HttpMaxRetries) {
+ fprintf(stderr, "Max number of retries (%d) for creating print queue %s reached, skipping it.\n",
+ HttpMaxRetries, p->queue_name);
+ continue;
+ }
+
debug_printf("Creating/Updating CUPS queue %s\n",
p->queue_name);
@@ -5477,6 +5476,24 @@ gboolean update_cups_queues(gpointer unused) {
} else
p->timeout = (time_t) -1;
+ /* Check if an HTTP timeout happened during the print queue creation
+ If it does - increment p->timeouted and set status to TO_BE_CREATED
+ because the creation can fall through the process, have state changed to
+ STATUS_CONFIRMED and experience the timeout */
+ /* If no timeout has happened, clear p->timeouted */
+ if (timeout_reached == 1) {
+ fprintf(stderr, "Timeout happened during creation of the queue %s, turn on DebugLogging for more info.\n", p->queue_name);
+ p->timeouted ++;
+ debug_printf("The queue %s already timeouted %d times in a row.\n",
+ p->queue_name, p->timeouted);
+ p->status = STATUS_TO_BE_CREATED;
+ p->timeout = current_time + TIMEOUT_RETRY;
+ } else if (p->timeouted != 0) {
+ debug_printf("Creating the queue %s went smoothly after %d timeouts.\n",
+ p->queue_name, p->timeouted);
+ p->timeouted = 0;
+ }
+
p->no_autosave = 0;
break;
@@ -5496,27 +5513,6 @@ gboolean update_cups_queues(gpointer unused) {
break;
}
-
- /* Check if an HTTP timeout happened during the print queue creation
- If it does - increment p->timeouted and set status to TO_BE_CREATED
- because the creation can fall through the process, have state changed to
- STATUS_CONFIRMED and experience the timeout */
- /* If no timeout has happened, clear p->timeouted */
- if (timeout_reached == 1)
- {
- fprintf(stderr, "Timeout happened during creating the queue %s, turn on DebugLogging for more info.\n", p->queue_name);
- p->timeouted ++;
-
- debug_printf("The queue %s already timeouted %d times in a row.\n",
- p->queue_name, p->timeouted);
- p->status = STATUS_TO_BE_CREATED;
- }
- else if (p->timeouted != 0)
- {
- debug_printf("Creating the queue %s went smoothly after %d timeouts.\n",
- p->queue_name, p->timeouted);
- p->timeouted = 0;
- }
}
log_all_printers();

View File

@ -3,7 +3,7 @@
Summary: OpenPrinting CUPS filters and backends
Name: cups-filters
Version: 1.21.5
Version: 1.21.6
Release: 1%{?dist}
# For a breakdown of the licensing, see COPYING file
@ -28,7 +28,6 @@ Patch01: cups-filters-createall.patch
Patch02: cups-browsed.8.patch
# backport from upstream - checking for timeouts were done for disappearing queues,
# which caused crashes
Patch03: 0001-cups-browsed-Fixed-crashes-caused-by-checking-HTTP-t.patch
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
@ -135,8 +134,6 @@ This is the development package for OpenPrinting CUPS filters and backends.
%patch01 -p1 -b .createall
# links in manpage
%patch02 -p1 -b .manpage
# timeouts - backport from upstream
%patch03 -p1 -b .timeouts
%build
# work-around Rpath
@ -309,6 +306,9 @@ fi
%{_libdir}/libfontembed.so
%changelog
* Tue Jan 08 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.6-1
- 1.21.6
* Thu Dec 13 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.5-1
- 1.21.5

View File

@ -1 +1 @@
SHA512 (cups-filters-1.21.5.tar.xz) = 41ed3364cb0a87e8b2b2482f3c8de90eba63538682ad3fa1079908beadec5e975d9eda151d822e93f62dcc32fe2a6189cc02b6b7691640fb00434efec35c0f7a
SHA512 (cups-filters-1.21.6.tar.xz) = 804250745ac710706ff1bfa6e161c0b1a8a65a74850a76a311b7614694a7e5d07f01dfd15f277ad79ed7fe1e84ea680bab1643e0b82cefa3e26603fa2eea935a