]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.5svn-r9323.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 1 Oct 2010 22:44:58 +0000 (22:44 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 1 Oct 2010 22:44:58 +0000 (22:44 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@2733 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.4.txt
backend/usb-darwin.c
cups/http-support.c
cups/ipp-support.c
cups/ipp.h
cups/pwg-ppd.c
cups/request.c
cups/test.ppd
cups/testpwg.c
scheduler/ipp.c

index 2888b12a91e7cf28e117d44cb185ec7cb9e5ef86..1cd4d6cf549adb3bb0eb7e9a136dd76291339ca3 100644 (file)
@@ -9,6 +9,9 @@ CHANGES IN CUPS V1.4.5
 
        - Documentation fixes (STR #3542, STR #3650)
        - Localization fixes (STR #3635, STR #3636, STR #3647, STR #3666)
+       - The CUPS API incorrectly mapped the HTTP_UNAUTHORIZED status to the
+         IPP_NOT_AUTHORIZED status code, when IPP_NOT_AUTHENTICATED would be
+         the correct mapping (STR #3684)
        - The scheduler would restart jobs while shutting down (STR #3679)
        - Fixed a PPD loader bug that could cause a crash in cupsd (STR #3680)
        - Improved the mapping of non-standard PPD and PWG names (STR #3671)
index 7bc883e5ef8b3ad63667996b8873738b1df2fc4f..17905f8e90d134f65925f6d9478c5c0ccb2fbf45 100644 (file)
 *
 * Contents:
 *
-*  list_devices()      - List all USB devices.
-*  print_device()      - Print a file to a USB device.
-*  sidechannel_thread() - Thread to handle side-channel requests.
-*  read_thread()       - Thread to read the backchannel data on.
-*  list_device_cb()    - list_device iterator callback.
-*  find_device_cb()    - print_device iterator callback.
-*  status_timer_cb()   - Status timer callback.
-*  iterate_printers()  - Iterate over all the printers.
-*  device_added()      - Device added notifier.
-*  copy_deviceinfo()   - Copy strings from the 1284 device ID.
-*  release_deviceinfo()        - Release deviceinfo strings.
-*  load_classdriver()  - Load a classdriver.
-*  unload_classdriver()        - Unload a classdriver.
-*  load_printerdriver()        - Load vendor's classdriver.
-*  registry_open()     - Open a connection to the printer.
-*  registry_close()    - Close the connection to the printer.
-*  copy_deviceid()     - Copy the 1284 device id string.
-*  copy_devicestring() - Copy the 1284 device id string.
-*  copy_value_for_key()        - Copy value string associated with a key.
-*  cfstr_create_trim() - Create CFString and trim whitespace characters.
-*  parse_options()     - Parse uri options.
-*  setup_cfLanguage()  - Create AppleLanguages array from LANG environment var.
-*  run_legacy_backend()        - Re-exec backend as ppc or i386.
-*  sigterm_handler()   - SIGTERM handler.
-*  next_line()         - Find the next line in a buffer.
-*  parse_pserror()     - Scan the backchannel data for postscript errors.
-*  get_device_id()     - Return IEEE-1284 device ID.
+ *   list_devices()       - List all USB devices.
+ *   print_device()       - Print a file to a USB device.
+ *   read_thread()        - Thread to read the backchannel data on.
+ *   sidechannel_thread() - Handle side-channel requests.
+ *   iterate_printers()   - Iterate over all the printers.
+ *   device_added()       - Device added notifier.
+ *   list_device_cb()     - list_device iterator callback.
+ *   find_device_cb()     - print_device iterator callback.
+ *   status_timer_cb()    - Status timer callback.
+ *   copy_deviceinfo()    - Copy strings from the 1284 device ID.
+ *   release_deviceinfo() - Release deviceinfo strings.
+ *   load_classdriver()   - Load a classdriver.
+ *   unload_classdriver() - Unload a classdriver.
+ *   load_printerdriver() - Load vendor's classdriver.
+ *   registry_open()      - Open a connection to the printer.
+ *   registry_close()     - Close the connection to the printer.
+ *   copy_deviceid()      - Copy the 1284 device id string.
+ *   copy_devicestring()  - Copy the 1284 device id string.
+ *   copy_value_for_key() - Copy value string associated with a key.
+ *   cfstr_create_trim()  - Create CFString and trim whitespace characters.
+ *   parse_options()      - Parse URI options.
+ *   sigterm_handler()    - SIGTERM handler.
+ *   next_line()          - Find the next line in a buffer.
+ *   parse_pserror()      - Scan the backchannel data for postscript errors.
+ *   soft_reset()         - Send a soft reset to the device.
+ *   get_device_id()      - Return IEEE-1284 device ID.
 */
 
 /*
@@ -292,8 +291,8 @@ static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
 #if defined(__i386__) || defined(__x86_64__)
 static pid_t   child_pid;              /* Child PID */
 static void run_legacy_backend(int argc, char *argv[], int fd);        /* Starts child backend process running as a ppc executable */
-static void sigterm_handler(int sig);  /* SIGTERM handler */
 #endif /* __i386__ || __x86_64__ */
+static void sigterm_handler(int sig);  /* SIGTERM handler */
 
 #ifdef PARSE_PS_ERRORS
 static const char *next_line (const char *buffer);
@@ -763,7 +762,8 @@ print_device(const char *uri,               /* I - Device URI */
     memset(&action, 0, sizeof(action));
 
     sigemptyset(&action.sa_mask);
-    action.sa_handler = SIG_DFL;
+    sigaddset(&action.sa_mask, SIGTERM);
+    action.sa_handler = sigterm_handler;
     sigaction(SIGTERM, &action, NULL);
   }
 
@@ -797,6 +797,7 @@ print_device(const char *uri,               /* I - Device URI */
        * Force the side-channel thread to exit...
        */
 
+        fputs("DEBUG: Force the side-channel thread to exit...\n", stderr);
        pthread_kill(sidechannel_thread_id, SIGTERM);
       }
     }
@@ -837,6 +838,7 @@ print_device(const char *uri,               /* I - Device URI */
       */
 
       g.wait_eof = 0;
+      fputs("DEBUG: Force the read thread to exit...\n", stderr);
       pthread_kill(read_thread_id, SIGTERM);
     }
   }
@@ -2051,6 +2053,8 @@ static void run_legacy_backend(int argc,
 
   exit(exitstatus);
 }
+#endif /* __i386__ || __x86_64__ */
+
 
 /*
  * 'sigterm_handler()' - SIGTERM handler.
@@ -2059,8 +2063,11 @@ static void run_legacy_backend(int argc,
 static void
 sigterm_handler(int sig)               /* I - Signal */
 {
-  /* If we started a child process pass the signal on to it...
-   */
+#if defined(__i386__) || defined(__x86_64__)
+ /*
+  * If we started a child process pass the signal on to it...
+  */
+
   if (child_pid)
   {
    /*
@@ -2082,9 +2089,8 @@ sigterm_handler(int sig)          /* I - Signal */
       exit(CUPS_BACKEND_STOP);
     }
   }
-}
-
 #endif /* __i386__ || __x86_64__ */
+}
 
 
 #ifdef PARSE_PS_ERRORS
index 92c66e1fbf6a6a562852b39ff27761776f95ba15..452a946f3adf51683f536b8ee79ce95ebeb4009b 100644 (file)
@@ -1364,7 +1364,8 @@ _httpResolveURI(
     DNSServiceRef      ref,            /* DNS-SD master service reference */
                        domainref,      /* DNS-SD service reference for domain */
                        localref;       /* DNS-SD service reference for .local */
-    int                        domainsent = 0; /* Send the domain resolve? */
+    int                        domainsent = 0, /* Send the domain resolve? */
+                       offline = 0;    /* offline-report state set? */
     char               *regtype,       /* Pointer to type in hostname */
                        *domain;        /* Pointer to domain in hostname */
     _http_uribuf_t     uribuf;         /* URI buffer */
@@ -1494,6 +1495,17 @@ _httpResolveURI(
                                    &uribuf) == kDNSServiceErr_NoError)
                domainsent = 1;
            }
+
+          /*
+           * If it hasn't resolved within 5 seconds set the offline-report
+           * printer-state-reason...
+           */
+
+           if (logit && offline == 0 && time(NULL) > (start_time + 5))
+           {
+             fputs("STATE: +offline-report\n", stderr);
+             offline = 1;
+           }
          }
          else
          {
@@ -1521,7 +1533,7 @@ _httpResolveURI(
       else
         fputs("DEBUG: Unable to resolve URI\n", stderr);
 
-      fputs("STATE: -connecting-to-device\n", stderr);
+      fputs("STATE: -connecting-to-device,offline-report\n", stderr);
     }
 
 #else
index c1b556fe8ee4710693789cbb418aba47dbff87ef..c12917f26552d069915954a26f3df37a3dea3847 100644 (file)
@@ -540,8 +540,8 @@ ippErrorString(ipp_status_t error)  /* I - Error status */
     return (ipp_status_400s[error - IPP_BAD_REQUEST]);
   else if (error >= IPP_INTERNAL_ERROR && error <= IPP_PRINTER_IS_DEACTIVATED)
     return (ipp_status_500s[error - IPP_INTERNAL_ERROR]);
-  else if (error >= IPP_AUTHORIZATION_CANCELED && error <= IPP_UPGRADE_REQUIRED)
-    return (ipp_status_1000s[error - IPP_AUTHORIZATION_CANCELED]);
+  else if (error >= IPP_AUTHENTICATION_CANCELED && error <= IPP_UPGRADE_REQUIRED)
+    return (ipp_status_1000s[error - IPP_AUTHENTICATION_CANCELED]);
 
  /*
   * No, build an "unknown-xxxx" error string...
index e639d8ee845a5641a38bfc2e37e75532a6e3ef8b..9eacc3c13d24df927f03b34d07a78f0aad2410c0 100644 (file)
@@ -312,7 +312,7 @@ typedef enum ipp_status_e           /**** IPP status codes ****/
   IPP_MULTIPLE_JOBS_NOT_SUPPORTED,     /* server-error-multiple-document-jobs-not-supported */
   IPP_PRINTER_IS_DEACTIVATED,          /* server-error-printer-is-deactivated */
 
-  IPP_AUTHORIZATION_CANCELED = 0x1000, /* Authorization canceled by user @since CUPS 1.4@ */
+  IPP_AUTHENTICATION_CANCELED = 0x1000,        /* Authentication canceled by user @since CUPS 1.5@ */
   IPP_PKI_ERROR,                       /* Error negotiating a secure connection @since CUPS 1.5@ */
   IPP_UPGRADE_REQUIRED                 /* TLS upgrade required */
 } ipp_status_t;
index 9cd27f6e2d5c2674448045889a0576061b03abd2..5307019c7b9c44c7dade9b75bbc558b8b0d7c947 100644 (file)
@@ -182,7 +182,6 @@ _pwgCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
     }
     else
     {
-
      /*
       * Not a standard name; convert it to a PWG vendor name of the form:
       *
@@ -209,8 +208,8 @@ _pwgCreateWithPPD(ppd_file_t *ppd)  /* I - PPD file */
     new_right      = _PWG_FROMPTS(ppd_size->width - ppd_size->right);
     new_top        = _PWG_FROMPTS(ppd_size->length - ppd_size->top);
     new_imageable  = new_length - new_top - new_bottom;
-    new_borderless = new_bottom == 0 && new_top == 0 &&
-                     new_left == 0 && new_right == 0;
+    new_borderless = (new_bottom == 0 && new_top == 0) ||
+                     (new_left == 0 && new_right == 0);
 
     for (k = pwg->num_sizes, similar = 0, old_size = pwg->sizes, new_size = NULL;
          k > 0 && !similar;
@@ -906,6 +905,9 @@ _pwgGetPageSize(_pwg_t     *pwg,    /* I - PWG mapping data */
   const char   *ppd_name;              /* PPD media name */
 
 
+  DEBUG_printf(("_pwgGetPageSize(pwg=%p, job=%p, keyword=\"%s\", exact=%p)",
+               pwg, job, keyword, exact));
+
  /*
   * Range check input...
   */
@@ -930,11 +932,21 @@ _pwgGetPageSize(_pwg_t     *pwg,  /* I - PWG mapping data */
       if ((attr = ippFindAttribute(job, "PageRegion", IPP_TAG_ZERO)) == NULL)
         attr = ippFindAttribute(job, "media", IPP_TAG_ZERO);
 
+#ifdef DEBUG
+    if (attr)
+      DEBUG_printf(("1_pwgGetPageSize: Found attribute %s (%s)", attr->name,
+                   ippTagString(attr->value_tag)));
+    else
+      DEBUG_puts("1_pwgGetPageSize: Did not find media attribute.");
+#endif /* DEBUG */
+
     if (attr && (attr->value_tag == IPP_TAG_NAME ||
                  attr->value_tag == IPP_TAG_KEYWORD))
       ppd_name = attr->values[0].string.text;
   }
 
+  DEBUG_printf(("1_pwgGetPageSize: ppd_name=\"%s\"", ppd_name));
+
   if (ppd_name)
   {
    /*
@@ -942,8 +954,20 @@ _pwgGetPageSize(_pwg_t     *pwg,   /* I - PWG mapping data */
     */
 
     for (i = pwg->num_sizes, size = pwg->sizes; i > 0; i --, size ++)
+    {
+      DEBUG_printf(("2_pwgGetPageSize: size[%d]=[\"%s\" \"%s\"]",
+                    (int)(size - pwg->sizes), size->map.pwg, size->map.ppd));
+
       if (!strcasecmp(ppd_name, size->map.ppd))
+      {
+       if (exact)
+         *exact = 1;
+
+        DEBUG_printf(("1_pwgGetPageSize: Returning \"%s\"", ppd_name));
+
         return (ppd_name);
+      }
+    }
   }
 
   if (job && !keyword)
@@ -1029,11 +1053,18 @@ _pwgGetPageSize(_pwg_t     *pwg,        /* I - PWG mapping data */
     if (exact)
       *exact = 1;
 
+    DEBUG_printf(("1_pwgGetPageSize: Returning \"%s\"", size->map.ppd));
+
     return (size->map.ppd);
   }
 
   if (closest)
+  {
+    DEBUG_printf(("1_pwgGetPageSize: Returning \"%s\" (closest)",
+                  closest->map.ppd));
+
     return (closest->map.ppd);
+  }
 
  /*
   * If we get here we need to check for custom page size support...
@@ -1065,6 +1096,9 @@ _pwgGetPageSize(_pwg_t     *pwg,  /* I - PWG mapping data */
     else if (exact)
       *exact = 1;
 
+    DEBUG_printf(("1_pwgGetPageSize: Returning \"%s\" (custom)",
+                  pwg->custom_ppd_size));
+
     return (pwg->custom_ppd_size);
   }
 
@@ -1072,6 +1106,8 @@ _pwgGetPageSize(_pwg_t     *pwg,  /* I - PWG mapping data */
   * No custom page size support or the size is out of range - return NULL.
   */
 
+  DEBUG_puts("1_pwgGetPageSize: Returning NULL");
+
   return (NULL);
 }
 
index 3320131fbc8203ac8ec7816e7f0ce2acc0b43b5e..8b7a329415dbab186a2824a30fade7c07ca09271 100644 (file)
@@ -969,11 +969,11 @@ _cupsSetHTTPError(http_status_t status)   /* I - HTTP status code */
        break;
 
     case HTTP_UNAUTHORIZED :
-       _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status), 0);
+       _cupsSetError(IPP_NOT_AUTHENTICATED, httpStatus(status), 0);
        break;
 
     case HTTP_AUTHORIZATION_CANCELED :
-       _cupsSetError(IPP_AUTHORIZATION_CANCELED, httpStatus(status), 0);
+       _cupsSetError(IPP_AUTHENTICATION_CANCELED, httpStatus(status), 0);
        break;
 
     case HTTP_FORBIDDEN :
index 779d789d90fa52f2c33bd8c15583a96015d67c78..fc453a6499086f1b31fa8faa77e5d2f60e0913a4 100644 (file)
@@ -65,6 +65,9 @@
 *PageSize Letter/US Letter:    "PageSize=Letter"
 *fr.PageSize Letter/French US Letter: ""
 *fr_CA.PageSize Letter/French Canadian US Letter: ""
+*PageSize Letter.Banner/US Letter Banner: "PageSize=Letter.Banner"
+*fr.PageSize Letter.Banner/French US Letter Banner: ""
+*fr_CA.PageSize Letter.Banner/French Canadian US Letter Banner: ""
 *PageSize Letter.Fullbleed/US Letter Borderless: "PageSize=Letter.Fullbleed"
 *fr.PageSize Letter.Fullbleed/French US Letter Borderless: ""
 *fr_CA.PageSize Letter.Fullbleed/French Canadian US Letter Borderless: ""
@@ -81,6 +84,7 @@
 *OrderDependency: 10 AnySetup *PageRegion
 *DefaultPageRegion: Letter
 *PageRegion Letter/US Letter:  "PageRegion=Letter"
+*PageRegion Letter.Banner/US Letter Banner: "PageRegion=Letter.Fullbleed"
 *PageRegion Letter.Fullbleed/US Letter Borderless: "PageRegion=Letter.Fullbleed"
 *PageRegion A4/A4:             "PageRegion=A4"
 *PageRegion Env10/#10 Envelope:        "PageRegion=Env10"
 
 *fr.Translation PageRegion/French Page Region: ""
 *fr.PageRegion Letter/French US Letter: ""
+*fr.PageRegion Letter.Banner/French US Letter Banner: ""
 *fr.PageRegion Letter.Fullbleed/French US Letter Borderless: ""
 *fr.PageRegion A4/French A4: ""
 *fr.PageRegion Env10/French #10 Envelope: ""
 
 *fr_CA.Translation PageRegion/French Canadian Page Region: ""
 *fr_CA.PageRegion Letter/French Canadian US Letter: ""
+*fr_CA.PageRegion Letter.Banner/French Canadian US Letter Banner: ""
 *fr_CA.PageRegion Letter.Fullbleed/French Canadian US Letter Borderless: ""
 *fr_CA.PageRegion A4/French Canadian A4: ""
 *fr_CA.PageRegion Env10/French Canadian #10 Envelope: ""
 
 *DefaultImageableArea: Letter 
 *ImageableArea Letter: "18 36 594 756"
+*ImageableArea Letter.Banner:  "18 0 594 792"
 *ImageableArea Letter.Fullbleed:       "0 0 612 792"
 *ImageableArea A4:     "18 36 577 806"
 *ImageableArea Env10:  "18 36 279 648"
 
 *DefaultPaperDimension: Letter
 *PaperDimension Letter:        "612 792"
+*PaperDimension Letter.Banner: "612 792"
 *PaperDimension Letter.Fullbleed:      "612 792"
 *PaperDimension A4:    "595 842"
 *PaperDimension Env10: "297 684"
index c77033613425c5c060788164ce9261dfac1266e7..f15e11e4c2da9b159f871d1fa5d04b231abac4fa 100644 (file)
@@ -15,8 +15,9 @@
  *
  * Contents:
  *
- *   main()     - Main entry.
- *   test_pwg() - Test the PWG mapping functions.
+ *   main()          - Main entry.
+ *   test_pagesize() - Test the PWG mapping functions.
+ *   test_pwg()      - Test the PWG mapping functions.
  */
 
 /*
  */
 
 #include "ppd-private.h"
+#include "file-private.h"
 
 
 /*
  * Local functions...
  */
 
-static int     test_pwg(_pwg_t *pwg);
+static int     test_pwg(_pwg_t *pwg, ppd_file_t *ppd);
+static int     test_pagesize(_pwg_t *pwg, ppd_file_t *ppd,
+                             const char *ppdsize);
 
 
 /*
@@ -50,13 +54,13 @@ main(int  argc,                             /* I - Number of command-line args */
 
   status = 0;
 
-  if (argc != 2)
+  if (argc < 2 || argc > 3)
   {
-    puts("Usage: ./testpwg filename.ppd");
+    puts("Usage: ./testpwg filename.ppd [jobfile]");
     return (1);
   }
-  else
-    ppdfile = argv[1];
+
+  ppdfile = argv[1];
 
   printf("ppdOpenFile(%s): ", ppdfile);
   if ((ppd = ppdOpenFile(ppdfile)) == NULL)
@@ -83,7 +87,59 @@ main(int  argc,                              /* I - Number of command-line args */
   else
   {
     puts("PASS");
-    status += test_pwg(pwg);
+    status += test_pwg(pwg, ppd);
+
+    if (argc == 3)
+    {
+     /*
+      * Test PageSize mapping code.
+      */
+
+      int              fd;             /* Job file descriptor */
+      const char       *pagesize;      /* PageSize value */
+      ipp_t            *job;           /* Job attributes */
+      ipp_attribute_t  *media;         /* Media attribute */
+
+      if ((fd = open(argv[2], O_RDONLY)) >= 0)
+      {
+       job = ippNew();
+       ippReadFile(fd, job);
+       close(fd);
+
+        if ((media = ippFindAttribute(job, "media", IPP_TAG_ZERO)) != NULL &&
+           media->value_tag != IPP_TAG_NAME &&
+           media->value_tag != IPP_TAG_KEYWORD)
+         media = NULL;
+
+       if (media)
+         printf("_pwgGetPageSize(media=%s): ", media->values[0].string.text);
+       else
+         fputs("_pwgGetPageSize(media-col): ", stdout);
+
+        fflush(stdout);
+
+       if ((pagesize = _pwgGetPageSize(pwg, job, NULL, NULL)) == NULL)
+       {
+         puts("FAIL (Not Found)");
+         status = 1;
+       }
+       else if (media && strcasecmp(pagesize, media->values[0].string.text))
+       {
+         printf("FAIL (Got \"%s\", Expected \"%s\")\n", pagesize,
+                media->values[0].string.text);
+         status = 1;
+       }
+       else
+         printf("PASS (%s)\n", pagesize);
+
+       ippDelete(job);
+      }
+      else
+      {
+        perror(argv[2]);
+       status = 1;
+      }
+    }
 
    /*
     * _pwgDestroy should never fail...
@@ -207,12 +263,71 @@ main(int  argc,                           /* I - Number of command-line args */
 }
 
 
+/*
+ * 'test_pagesize()' - Test the PWG mapping functions.
+ */
+
+static int                             /* O - 1 on failure, 0 on success */
+test_pagesize(_pwg_t     *pwg,         /* I - PWG mapping data */
+              ppd_file_t *ppd,         /* I - PPD file */
+             const char *ppdsize)      /* I - PPD page size */
+{
+  int          status = 0;             /* Return status */
+  ipp_t                *job;                   /* Job attributes */
+  const char   *pagesize;              /* PageSize value */
+
+
+  if (ppdPageSize(ppd, ppdsize))
+  {
+    printf("_pwgGetPageSize(keyword=%s): ", ppdsize);
+    fflush(stdout);
+
+    if ((pagesize = _pwgGetPageSize(pwg, NULL, ppdsize, NULL)) == NULL)
+    {
+      puts("FAIL (Not Found)");
+      status = 1;
+    }
+    else if (strcasecmp(pagesize, ppdsize))
+    {
+      printf("FAIL (Got \"%s\", Expected \"%s\")\n", pagesize, ppdsize);
+      status = 1;
+    }
+    else
+      puts("PASS");
+
+    job = ippNew();
+    ippAddString(job, IPP_TAG_JOB, IPP_TAG_KEYWORD, "media", NULL, ppdsize);
+
+    printf("_pwgGetPageSize(media=%s): ", ppdsize);
+    fflush(stdout);
+
+    if ((pagesize = _pwgGetPageSize(pwg, job, NULL, NULL)) == NULL)
+    {
+      puts("FAIL (Not Found)");
+      status = 1;
+    }
+    else if (strcasecmp(pagesize, ppdsize))
+    {
+      printf("FAIL (Got \"%s\", Expected \"%s\")\n", pagesize, ppdsize);
+      status = 1;
+    }
+    else
+      puts("PASS");
+
+    ippDelete(job);
+  }
+
+  return (status);
+}
+
+
 /*
  * 'test_pwg()' - Test the PWG mapping functions.
  */
 
 static int                             /* O - 1 on failure, 0 on success */
-test_pwg(_pwg_t *pwg)                  /* I - PWG mapping data */
+test_pwg(_pwg_t     *pwg,              /* I - PWG mapping data */
+         ppd_file_t *ppd)              /* I - PPD file */
 {
   int          i,                      /* Looping var */
                status = 0;             /* Return status */
@@ -358,8 +473,19 @@ test_pwg(_pwg_t *pwg)                      /* I - PWG mapping data */
 
     if (!status)
       puts("PASS");
+
+    _pwgDestroy(pwg2);
   }
 
+ /*
+  * Test PageSize mapping code...
+  */
+
+  status += test_pagesize(pwg, ppd, "Letter");
+  status += test_pagesize(pwg, ppd, "na-letter");
+  status += test_pagesize(pwg, ppd, "A4");
+  status += test_pagesize(pwg, ppd, "iso-a4");
+
   return (status);
 }
 
index f711b8bd0ad27e1679b33f8f641f1770df637e7a..b1049b1ff03ca6da06ded0b91318e31ed84d8093 100644 (file)
@@ -4391,7 +4391,8 @@ check_rss_recipient(
  * 'check_quotas()' - Check quotas for a printer and user.
  */
 
-static int                             /* O - 1 if OK, 0 if not */
+static int                             /* O - 1 if OK, 0 if forbidden,
+                                              -1 if limit reached */
 check_quotas(cupsd_client_t  *con,     /* I - Client connection */
              cupsd_printer_t *p)       /* I - Printer or class */
 {
@@ -4441,7 +4442,7 @@ check_quotas(cupsd_client_t  *con,        /* I - Client connection */
     {
       cupsdLogMessage(CUPSD_LOG_INFO, "Too many jobs for printer \"%s\"...",
                       p->name);
-      return (0);
+      return (-1);
     }
   }
 
@@ -4455,7 +4456,7 @@ check_quotas(cupsd_client_t  *con,        /* I - Client connection */
     {
       cupsdLogMessage(CUPSD_LOG_INFO, "Too many jobs for user \"%s\"...",
                       username);
-      return (0);
+      return (-1);
     }
   }