Remove eggcups patch
This commit is contained in:
parent
2dd8422034
commit
5d79c444d7
@ -1,130 +0,0 @@
|
||||
diff -up cups-2.3.0/backend/ipp.c.eggcups cups-2.3.0/backend/ipp.c
|
||||
--- cups-2.3.0/backend/ipp.c.eggcups 2019-08-23 17:19:38.000000000 +0200
|
||||
+++ cups-2.3.0/backend/ipp.c 2019-10-07 12:14:25.385111933 +0200
|
||||
@@ -143,6 +143,70 @@ static char tmpfilename[1024] = "";
|
||||
static char mandatory_attrs[1024] = "";
|
||||
/* cupsMandatory value */
|
||||
|
||||
+#if HAVE_DBUS
|
||||
+#include <dbus/dbus.h>
|
||||
+
|
||||
+static DBusConnection *dbus_connection = NULL;
|
||||
+
|
||||
+static int
|
||||
+init_dbus (void)
|
||||
+{
|
||||
+ DBusConnection *connection;
|
||||
+ DBusError error;
|
||||
+
|
||||
+ if (dbus_connection &&
|
||||
+ !dbus_connection_get_is_connected (dbus_connection)) {
|
||||
+ dbus_connection_unref (dbus_connection);
|
||||
+ dbus_connection = NULL;
|
||||
+ }
|
||||
+
|
||||
+ dbus_error_init (&error);
|
||||
+ connection = dbus_bus_get (getuid () ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error);
|
||||
+ if (connection == NULL) {
|
||||
+ dbus_error_free (&error);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ dbus_connection = connection;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+dbus_broadcast_queued_remote (const char *printer_uri,
|
||||
+ ipp_status_t status,
|
||||
+ unsigned int local_job_id,
|
||||
+ unsigned int remote_job_id,
|
||||
+ const char *username,
|
||||
+ const char *printer_name)
|
||||
+{
|
||||
+ DBusMessage *message;
|
||||
+ DBusMessageIter iter;
|
||||
+ const char *errstr;
|
||||
+
|
||||
+ if (!dbus_connection || !dbus_connection_get_is_connected (dbus_connection)) {
|
||||
+ if (init_dbus () || !dbus_connection)
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ errstr = ippErrorString (status);
|
||||
+ message = dbus_message_new_signal ("/com/redhat/PrinterSpooler",
|
||||
+ "com.redhat.PrinterSpooler",
|
||||
+ "JobQueuedRemote");
|
||||
+ dbus_message_iter_init_append (message, &iter);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_uri);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &errstr);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &local_job_id);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &remote_job_id);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &username);
|
||||
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_name);
|
||||
+
|
||||
+ dbus_connection_send (dbus_connection, message, NULL);
|
||||
+ dbus_connection_flush (dbus_connection);
|
||||
+ dbus_message_unref (message);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif /* HAVE_DBUS */
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -1768,6 +1832,15 @@ main(int argc, /* I - Number of comm
|
||||
fprintf(stderr, "DEBUG: Print job accepted - job ID %d.\n", job_id);
|
||||
}
|
||||
|
||||
+#if HAVE_DBUS
|
||||
+ dbus_broadcast_queued_remote (argv[0],
|
||||
+ ipp_status,
|
||||
+ atoi (argv[1]),
|
||||
+ job_id,
|
||||
+ argv[2],
|
||||
+ getenv ("PRINTER"));
|
||||
+#endif /* HAVE_DBUS */
|
||||
+
|
||||
ippDelete(response);
|
||||
|
||||
if (job_canceled)
|
||||
diff -up cups-2.3.0/backend/Makefile.eggcups cups-2.3.0/backend/Makefile
|
||||
--- cups-2.3.0/backend/Makefile.eggcups 2019-10-07 12:14:25.385111933 +0200
|
||||
+++ cups-2.3.0/backend/Makefile 2019-10-07 12:16:00.457569406 +0200
|
||||
@@ -257,7 +257,7 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbac
|
||||
|
||||
ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
- $(LD_CC) $(ALL_LDFLAGS) -o ipp ipp.o libbackend.a $(LINKCUPS)
|
||||
+ $(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LINKCUPS) $(SERVERLIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) http https ipps
|
||||
for file in $(IPPALIASES); do \
|
||||
diff -up cups-2.3.0/scheduler/subscriptions.c.eggcups cups-2.3.0/scheduler/subscriptions.c
|
||||
--- cups-2.3.0/scheduler/subscriptions.c.eggcups 2019-08-23 17:19:38.000000000 +0200
|
||||
+++ cups-2.3.0/scheduler/subscriptions.c 2019-10-07 12:18:21.736478684 +0200
|
||||
@@ -1257,13 +1257,13 @@ cupsd_send_dbus(cupsd_eventmask_t event,
|
||||
what = "PrinterAdded";
|
||||
else if (event & CUPSD_EVENT_PRINTER_DELETED)
|
||||
what = "PrinterRemoved";
|
||||
- else if (event & CUPSD_EVENT_PRINTER_CHANGED)
|
||||
- what = "QueueChanged";
|
||||
else if (event & CUPSD_EVENT_JOB_CREATED)
|
||||
what = "JobQueuedLocal";
|
||||
else if ((event & CUPSD_EVENT_JOB_STATE) && job &&
|
||||
job->state_value == IPP_JOB_PROCESSING)
|
||||
what = "JobStartedLocal";
|
||||
+ else if (event & (CUPSD_EVENT_PRINTER_CHANGED|CUPSD_EVENT_JOB_STATE_CHANGED|CUPSD_EVENT_PRINTER_STATE_CHANGED))
|
||||
+ what = "QueueChanged";
|
||||
else
|
||||
return;
|
||||
|
||||
@@ -1299,7 +1299,7 @@ cupsd_send_dbus(cupsd_eventmask_t event,
|
||||
dbus_message_append_iter_init(message, &iter);
|
||||
if (dest)
|
||||
dbus_message_iter_append_string(&iter, dest->name);
|
||||
- if (job)
|
||||
+ if (job && strcmp (what, "QueueChanged") != 0)
|
||||
{
|
||||
dbus_message_iter_append_uint32(&iter, job->id);
|
||||
dbus_message_iter_append_string(&iter, job->username);
|
@ -39,11 +39,6 @@ Patch3: cups-banners.patch
|
||||
Patch4: cups-no-export-ssllibs.patch
|
||||
# enables old uri usb:/dev/usb/lp0 - leave it here for users of old printers
|
||||
Patch5: cups-direct-usb.patch
|
||||
# fix for redhat dbus spooler - adding new dbus functions to backend/ipp.c
|
||||
# -> initialize dbus connection and sending dbus broadcast about job queued
|
||||
# on remote queue with QueueChanged type for PRINTER_CHANGED, JOB_STATE_CHANGED
|
||||
# and PRINTER_STATE_CHANGED events
|
||||
Patch6: cups-eggcups.patch
|
||||
# when system workload is high, timeout for cups-driverd can be reached -
|
||||
# increase the timeout
|
||||
Patch7: cups-driverd-timeout.patch
|
||||
@ -757,6 +752,8 @@ rm -f %{cups_serverbin}/backend/smb
|
||||
%changelog
|
||||
* Tue Nov 24 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3-20
|
||||
- fix memory leak during device discovery
|
||||
- remove logrotate patches and support - journal is now default
|
||||
- remove eggcups patch - seems to cause no harm
|
||||
|
||||
* Thu Nov 12 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.3.3-19
|
||||
- 1897023 - Cups service restart sequence during upgrade incorrect
|
||||
|
Loading…
Reference in New Issue
Block a user