Re: [LOW] STR #4075: PPD: Message Processing Bottlenecks

Michael Sweet <[email protected]>
Newsgroups gmane.comp.printing.cups.bugs
Message-ID <[email protected]>
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Closed w/Resolution]

Fixed in Subversion repository.

Link: http://www.cups.org/str.php?L4075
Version: 1.6-current
Fix Version: 1.6-current (r10502)

_______________________________________________
cups-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/cups-bugs
str4075.patch (text/plain, 1.7 KB)
Index: scheduler/job.c
===================================================================
--- scheduler/job.c	(revision 10492)
+++ scheduler/job.c	(working copy)
@@ -3363,6 +3363,21 @@
   cupsArrayRemove(PrintingJobs, job);
 
  /*
+  * Apply any PPD updates...
+  */
+
+  if (job->num_keywords)
+  {
+    if (cupsdUpdatePrinterPPD(job->printer, job->num_keywords, job->keywords))
+      cupsdSetPrinterAttrs(job->printer);
+
+    cupsFreeOptions(job->num_keywords, job->keywords);
+
+    job->num_keywords = 0;
+    job->keywords     = NULL;
+  }
+
+ /*
   * Clear the printer <-> job association...
   */
 
@@ -4827,18 +4842,10 @@
       * Set attribute(s)...
       */
 
-      int		num_keywords;	/* Number of keywords */
-      cups_option_t	*keywords;	/* Keywords */
-
-
       cupsdLogJob(job, CUPSD_LOG_DEBUG, "PPD: %s", message);
 
-      num_keywords = cupsParseOptions(message, 0, &keywords);
-
-      if (cupsdUpdatePrinterPPD(job->printer, num_keywords, keywords))
-        cupsdSetPrinterAttrs(job->printer);
-
-      cupsFreeOptions(num_keywords, keywords);
+      job->num_keywords = cupsParseOptions(message, job->num_keywords,
+                                           &job->keywords);
     }
     else
     {
Index: scheduler/job.h
===================================================================
--- scheduler/job.h	(revision 10492)
+++ scheduler/job.h	(working copy)
@@ -80,6 +80,8 @@
   void			*profile;	/* Security profile */
   cups_array_t		*history;	/* Debug log history */
   int			progress;	/* Printing progress */
+  int			num_keywords;	/* Number of PPD keywords */
+  cups_option_t		*keywords;	/* PPD keywords */
 };
 
 typedef struct cupsd_joblog_s		/**** Job log message ****/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.