]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The scheduler did not cache or report driver information files correctly,
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 28 Aug 2009 23:59:54 +0000 (23:59 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 28 Aug 2009 23:59:54 +0000 (23:59 +0000)
leading to a variety of issues (STR #3297, STR #3305)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@8790 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.4.txt
scheduler/cups-driverd.cxx

index 034f78ed9bfa0fd330615f9529297d490b945847..3285edab2b13fede9c81814ecf5ebea995761fa3 100644 (file)
@@ -14,6 +14,8 @@ CHANGES IN CUPS V1.4.1
          query job was held (STR #3302)
        - Boolean options did not show up as selected in the web interface
          (STR #3303)
+       - The scheduler did not cache or report driver information files
+         correctly, leading to a variety of issues (STR #3297, STR #3305)
 
 
 CHANGES IN CUPS V1.4.0
index a014f1ae928f975236f618af73f040138be5720c..1439dd79583b07042666ed274f4605cd8a3982a2 100644 (file)
@@ -1493,13 +1493,21 @@ load_ppds(const char *d,                /* I - Actual directory */
        ppd->record.size == dent->fileinfo.st_size &&
        ppd->record.mtime == dent->fileinfo.st_mtime)
     {
-      do
-      {
-        ppd->found = 1;
-      }
-      while ((ppd = (ppd_info_t *)cupsArrayNext(PPDsByName)) != NULL &&
+     /*
+      * Rewind to the first entry for this file...
+      */
+
+      while ((ppd = (ppd_info_t *)cupsArrayPrev(PPDsByName)) != NULL &&
             !strcmp(ppd->record.filename, name));
 
+     /*
+      * Then mark all of the matches for this file as found...
+      */
+
+      while ((ppd = (ppd_info_t *)cupsArrayNext(PPDsByName)) != NULL &&
+            !strcmp(ppd->record.filename, name))
+        ppd->found = 1;
+
       continue;
     }
 
@@ -1904,7 +1912,8 @@ load_drv(const char  *filename,           /* I - Actual filename */
                *cups_fax,              // cupsFax attribute
                *nick_name;             // NickName attribute
   ppdcFilter   *filter;                // Current filter
-  bool         product_found;          // Found product?
+  ppd_info_t   *ppd;                   // Current PPD
+  int          products_found;         // Number of products found
   char         uri[1024],              // Driver URI
                make_model[1024];       // Make and model
   int          type;                   // Driver type
@@ -1929,7 +1938,7 @@ load_drv(const char  *filename,           /* I - Actual filename */
   * Add a dummy entry for the file...
   */
 
-  add_ppd(filename, filename, "", "", "", "", "", "", mtime, size, 0,
+  add_ppd(name, name, "", "", "", "", "", "", mtime, size, 0,
           PPD_TYPE_DRV, "drv");
   ChangedPPD = 1;
 
@@ -1981,22 +1990,28 @@ load_drv(const char  *filename,         /* I - Actual filename */
          type = PPD_TYPE_PDF;
     }
 
-    for (product = (ppdcAttr *)d->attrs->first(), product_found = false;
+    for (product = (ppdcAttr *)d->attrs->first(), products_found = 0;
          product;
         product = (ppdcAttr *)d->attrs->next())
       if (!strcmp(product->name->value, "Product"))
       {
-        product_found = true;
+        if (!products_found)
+         ppd = add_ppd(name, uri, "en", d->manufacturer->value, make_model,
+                       device_id ? device_id->value->value : "",
+                       product->value->value,
+                       ps_version ? ps_version->value->value : "(3010) 0",
+                       mtime, size, d->model_number, type, "drv");
+       else if (products_found < PPD_MAX_PROD)
+         strlcpy(ppd->record.products[products_found], product->value->value,
+                 sizeof(ppd->record.products[0]));
+       else
+         break;
 
-       add_ppd(filename, uri, "en", d->manufacturer->value, make_model,
-               device_id ? device_id->value->value : "",
-               product->value->value,
-               ps_version ? ps_version->value->value : "(3010) 0",
-               mtime, size, d->model_number, type, "drv");
+       products_found ++;
       }
 
-    if (!product_found)
-      add_ppd(filename, uri, "en", d->manufacturer->value, make_model,
+    if (!products_found)
+      add_ppd(name, uri, "en", d->manufacturer->value, make_model,
              device_id ? device_id->value->value : "",
              d->model_name->value,
              ps_version ? ps_version->value->value : "(3010) 0",