Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49491afe90 | ||
|
|
9e0a7b0c23 | ||
|
|
12a91c59ae |
3 changed files with 162 additions and 1 deletions
137
cups-filters-timeouts.patch
Normal file
137
cups-filters-timeouts.patch
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
diff -up cups-filters-1.13.4/utils/cups-browsed.c.httptimeouts cups-filters-1.13.4/utils/cups-browsed.c
|
||||
--- cups-filters-1.13.4/utils/cups-browsed.c.httptimeouts 2018-03-05 20:09:53.596815387 +0100
|
||||
+++ cups-filters-1.13.4/utils/cups-browsed.c 2018-03-05 20:27:17.625885188 +0100
|
||||
@@ -351,6 +351,8 @@ static size_t NumBrowsePoll = 0;
|
||||
static guint update_netifs_sourceid = 0;
|
||||
static char local_server_str[1024];
|
||||
static char *DomainSocket = NULL;
|
||||
+static unsigned int HttpLocalTimeout = 5;
|
||||
+static unsigned int HttpRemoteTimeout = 10;
|
||||
static ip_based_uris_t IPBasedDeviceURIs = IP_BASED_URIS_NO;
|
||||
static unsigned int CreateRemoteRawPrinterQueues = 0;
|
||||
static unsigned int CreateRemoteCUPSPrinterQueues = 1;
|
||||
@@ -587,6 +589,7 @@ httpConnectEncryptShortTimeout(const cha
|
||||
int
|
||||
http_timeout_cb(http_t *http, void *user_data)
|
||||
{
|
||||
+ debug_printf("HTTP timeout! (consider increasing HttpLocalTimeout/HttpRemoteTimeout value)\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -599,7 +602,7 @@ http_connect_local (void)
|
||||
cupsEncryption());
|
||||
}
|
||||
if (local_conn)
|
||||
- httpSetTimeout(local_conn, 3, http_timeout_cb, NULL);
|
||||
+ httpSetTimeout(local_conn, HttpLocalTimeout, http_timeout_cb, NULL);
|
||||
else
|
||||
debug_printf("cups-browsed: Failed creating http connection to local CUPS daemon: %s:%d\n", cupsServer(), ippPort());
|
||||
|
||||
@@ -2631,7 +2634,7 @@ on_printer_state_changed (CupsNotifier *
|
||||
p->port);
|
||||
if (http) {
|
||||
/* Check whether the printer is idle, processing, or disabled */
|
||||
- httpSetTimeout(http, 2, http_timeout_cb, NULL);
|
||||
+ httpSetTimeout(http, HttpRemoteTimeout, http_timeout_cb, NULL);
|
||||
request = ippNewRequest(CUPS_GET_PRINTERS);
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes",
|
||||
@@ -3690,7 +3693,7 @@ gboolean handle_cups_queues(gpointer unu
|
||||
p->timeout = current_time + TIMEOUT_RETRY;
|
||||
break;
|
||||
}
|
||||
- httpSetTimeout(http, 3, http_timeout_cb, NULL);
|
||||
+ httpSetTimeout(http, HttpLocalTimeout, http_timeout_cb, NULL);
|
||||
|
||||
/* Do not auto-save option settings due to the print queue creation
|
||||
process */
|
||||
@@ -3743,7 +3746,7 @@ gboolean handle_cups_queues(gpointer unu
|
||||
p->no_autosave = 0;
|
||||
break;
|
||||
}
|
||||
- httpSetTimeout(remote_http, 3, http_timeout_cb, NULL);
|
||||
+ httpSetTimeout(remote_http, HttpRemoteTimeout, http_timeout_cb, NULL);
|
||||
if ((loadedppd = cupsGetPPD2(remote_http, p->name)) == NULL &&
|
||||
CreateRemoteRawPrinterQueues == 0) {
|
||||
debug_printf("Unable to load PPD file for %s from the server %s:%d!\n",
|
||||
@@ -5772,7 +5775,7 @@ browse_poll_cancel_subscription (browsep
|
||||
return;
|
||||
}
|
||||
|
||||
- httpSetTimeout(conn, 3, http_timeout_cb, NULL);
|
||||
+ httpSetTimeout(conn, HttpRemoteTimeout, http_timeout_cb, NULL);
|
||||
|
||||
debug_printf ("cups-browsed [BrowsePoll %s:%d]: IPP-Cancel-Subscription\n",
|
||||
context->server, context->port);
|
||||
@@ -5914,7 +5917,7 @@ browse_poll (gpointer data)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- httpSetTimeout(conn, 3, http_timeout_cb, NULL);
|
||||
+ httpSetTimeout(conn, HttpRemoteTimeout, http_timeout_cb, NULL);
|
||||
|
||||
if (context->can_subscribe) {
|
||||
if (context->subscription_id == -1) {
|
||||
@@ -6430,6 +6433,19 @@ read_configuration (const char *filename
|
||||
} else if (!strcasecmp(line, "DomainSocket") && value) {
|
||||
if (value[0] != '\0')
|
||||
DomainSocket = strdup(value);
|
||||
+ } else if ((!strcasecmp(line, "HttpLocalTimeout") || !strcasecmp(line, "HttpRemoteTimeout")) && value) {
|
||||
+ int t = atoi(value);
|
||||
+ if (t >= 0) {
|
||||
+ if (!strcasecmp(line, "HttpLocalTimeout"))
|
||||
+ HttpLocalTimeout = t;
|
||||
+ else if (!strcasecmp(line, "HttpRemoteTimeout"))
|
||||
+ HttpRemoteTimeout = t;
|
||||
+
|
||||
+ debug_printf("Set %s to %d sec.\n",
|
||||
+ line, t);
|
||||
+ } else
|
||||
+ debug_printf("Invalid %s value: %d\n",
|
||||
+ line, t);
|
||||
} else if (!strcasecmp(line, "IPBasedDeviceURIs") && value) {
|
||||
if (!strcasecmp(value, "IPv4") || !strcasecmp(value, "IPv4Only"))
|
||||
IPBasedDeviceURIs = IP_BASED_URIS_IPV4_ONLY;
|
||||
diff -up cups-filters-1.13.4/utils/cups-browsed.conf.5.httptimeouts cups-filters-1.13.4/utils/cups-browsed.conf.5
|
||||
--- cups-filters-1.13.4/utils/cups-browsed.conf.5.httptimeouts 2018-03-05 20:10:00.042761769 +0100
|
||||
+++ cups-filters-1.13.4/utils/cups-browsed.conf.5 2018-03-05 20:13:23.417070065 +0100
|
||||
@@ -416,6 +416,19 @@ or "Off" lets cups-browsed not use CUPS'
|
||||
|
||||
.fam T
|
||||
.fi
|
||||
+Set HTTP timeout (in seconds) for requests sent to local/remote
|
||||
+resources Note that too short timeouts can make services getting
|
||||
+missed when they are present and operations be unneccesarily
|
||||
+repeated and too long timeouts can make operations take too long
|
||||
+when the server does not respond.
|
||||
+.PP
|
||||
+.nf
|
||||
+.fam C
|
||||
+ HttpLocalTimeout 5
|
||||
+ HttpRemoteTimeout 10
|
||||
+
|
||||
+.fam T
|
||||
+.fi
|
||||
The interval between browsing/broadcasting cycles, local and/or
|
||||
remote, can be adjusted with the BrowseInterval directive.
|
||||
.PP
|
||||
diff -up cups-filters-1.13.4/utils/cups-browsed.conf.in.httptimeouts cups-filters-1.13.4/utils/cups-browsed.conf.in
|
||||
--- cups-filters-1.13.4/utils/cups-browsed.conf.in.httptimeouts 2018-03-05 20:10:05.452716768 +0100
|
||||
+++ cups-filters-1.13.4/utils/cups-browsed.conf.in 2018-03-05 20:11:51.917831172 +0100
|
||||
@@ -301,6 +301,16 @@ BrowseRemoteProtocols @BROWSEREMOTEPROTO
|
||||
# DomainSocket Off
|
||||
|
||||
|
||||
+# Set HTTP timeout (in seconds) for requests sent to local/remote
|
||||
+# resources Note that too short timeouts can make services getting
|
||||
+# missed when they are present and operations be unneccesarily
|
||||
+# repeated and too long timeouts can make operations take too long
|
||||
+# when the server does not respond.
|
||||
+
|
||||
+# HttpLocalTimeout 5
|
||||
+# HttpRemoteTimeout 10
|
||||
+
|
||||
+
|
||||
# Set IPBasedDeviceURIs to "Yes" if cups-browsed should create its
|
||||
# local queues with device URIs with the IP addresses instead of the
|
||||
# host names of the remote servers. This mode is there for any
|
||||
11
cups-filters-xerox.patch
Normal file
11
cups-filters-xerox.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
diff -up cups-filters-1.13.4/filter/pdftops.c.xerox cups-filters-1.13.4/filter/pdftops.c
|
||||
--- cups-filters-1.13.4/filter/pdftops.c.xerox 2018-05-03 12:10:32.961381421 +0200
|
||||
+++ cups-filters-1.13.4/filter/pdftops.c 2018-05-03 12:20:22.096532993 +0200
|
||||
@@ -469,6 +469,7 @@ main(int argc, /* I - Number of comm
|
||||
if (make_model[0] &&
|
||||
(!strncasecmp(make_model, "Brother", 7) ||
|
||||
!strncasecmp(make_model, "Dell", 4) ||
|
||||
+ !strncasecmp(make_model, "Xerox", 5) ||
|
||||
strcasestr(make_model, "Minolta") ||
|
||||
(!strncasecmp(make_model, "Apple", 5) &&
|
||||
(ptr = strcasestr(make_model, "LaserWriter")) &&
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
Summary: OpenPrinting CUPS filters and backends
|
||||
Name: cups-filters
|
||||
Version: 1.13.4
|
||||
Release: 3%{?dist}
|
||||
Release: 6%{?dist}
|
||||
|
||||
# For a breakdown of the licensing, see COPYING file
|
||||
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
|
||||
|
|
@ -21,6 +21,8 @@ Url: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups
|
|||
Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{version}.tar.xz
|
||||
|
||||
Patch01: cups-filters-apremotequeueid.patch
|
||||
Patch02: cups-filters-timeouts.patch
|
||||
Patch03: cups-filters-xerox.patch
|
||||
|
||||
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
|
|
@ -116,6 +118,8 @@ This is the development package for OpenPrinting CUPS filters and backends.
|
|||
%prep
|
||||
%setup -q
|
||||
%patch01 -p1 -b .apremotequeueid
|
||||
%patch02 -p1 -b .timeouts
|
||||
%patch03 -p1 -b .xerox
|
||||
|
||||
%build
|
||||
# work-around Rpath
|
||||
|
|
@ -279,6 +283,15 @@ fi
|
|||
%{_libdir}/libfontembed.so
|
||||
|
||||
%changelog
|
||||
* Thu May 03 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.13.4-6
|
||||
- use poppler for xerox printers
|
||||
|
||||
* Wed Apr 18 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.13.4-5
|
||||
- rebuilt for qpdf-7.1.1
|
||||
|
||||
* Mon Mar 05 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.13.4-4
|
||||
- 1487873 - cups-browsed and cups in endless updating loop
|
||||
|
||||
* Thu Aug 10 2017 Zdenek Dohnal <zdohnal@redhat.com> - 1.13.4-3
|
||||
- rebuilt for qpdf-libs
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue