]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.4svn-r8148.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 19 Nov 2008 23:25:47 +0000 (23:25 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 19 Nov 2008 23:25:47 +0000 (23:25 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1068 a1ca3aef-8c08-0410-bb20-df032aa958be

24 files changed:
CHANGES-1.3.txt
CHANGES.txt
backend/lpd.c
cgi-bin/classes.c
cgi-bin/printers.c
config-scripts/cups-compiler.m4
config-scripts/cups-pap.m4
cups/request.c
doc/help/options.html
man/lp.man
scheduler/client.c
scheduler/ipp.c
scheduler/job.c
scheduler/printers.c
scheduler/subscriptions.c
systemv/lp.c
systemv/lpstat.c
test/4.1-requests.test
test/4.3-job-ops.test
test/4.4-subscription-ops.test
test/5.3-lpq.sh
test/ipptest.c
test/print-job.test
test/run-stp-tests.sh

index e386fed360bd77616ffc6a7895a2b6a2a0001d3c..60223859cd230643e7d8bad9e44b433166877b19 100644 (file)
@@ -3,7 +3,15 @@ CHANGES-1.3.txt
 
 CHANGES IN CUPS V1.3.10
 
-       - Documentation fixes (STR #2994, STR #2995)
+       - Documentation fixes (STR #2994, STR #2995, STR #3008)
+       - The scheduler would crash if you exceeded the MaxSubscriptions
+         limit.
+       - The lp "-H immediate" option did not specify that the job
+         should not be held (STR #3013)
+       - The scheduler did not support the "Connection: close"
+         HTTP header (STR #3010)
+       - The mailto notifier didn't terminate messages properly
+         (STR #3011)
        - Backends could spin trying to read back-channel data
          (STR #3001)
        - The HP-GL/2 filter was using the wrong default colors
index 0c4f2ab161a51deaed71fd27d88130500694f64c..e4cbfc6045f62b99aa4b033f5fd1fc72adde05f6 100644 (file)
@@ -1,9 +1,16 @@
-CHANGES.txt - 2008-11-14
+CHANGES.txt - 2008-11-19
 ------------------------
 
 CHANGES IN CUPS V1.4b2
 
        - Documentation updates (STR #2983, STR #2998)
+       - The LPD backend no longer tries to collect page accounting
+         information since the LPD protocol does not allow us to
+         prevent race conditions.
+       - The scheduler did not save the last marker-change-time value.
+       - Fixed a problem with printing to some IPP printers, including
+         CUPS 1.1.x.
+       - Fixed a redirection problem with the printer web page (STR #3012)
        - Fixed a PPD compiler problem with the loading of message
          catalogs (STR #2990)
        - Fixed a PPD compiler problem with the loading of .strings files
index a543c27f78ade3fc9cf747e3a7d10da1bebd0146..c0aaa653233e03f2a6d0230f863aaad567f1ea2e 100644 (file)
@@ -636,9 +636,7 @@ lpd_queue(const char *hostname,             /* I - Host to connect to */
   char                 addrname[256];  /* Address name */
   http_addrlist_t      *addrlist,      /* Address list */
                        *addr;          /* Socket address */
-  int                  snmp_fd,        /* SNMP socket */
-                       start_count,    /* Page count via SNMP at start */
-                       page_count;     /* Page count via SNMP */
+  int                  snmp_fd;        /* SNMP socket */
   int                  copy;           /* Copies written */
   time_t               start_time;     /* Time of first connect */
   int                  recoverable;    /* Recoverable error shown? */
@@ -886,7 +884,7 @@ lpd_queue(const char *hostname,             /* I - Host to connect to */
 
     if ((snmp_fd = _cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0)
     {
-      if (backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count, NULL))
+      if (backendSNMPSupplies(snmp_fd, &(addr->addr), NULL, NULL))
       {
        /*
        * No, close it...
@@ -1186,22 +1184,11 @@ lpd_queue(const char *hostname,         /* I - Host to connect to */
     }
 
    /*
-    * Collect the final page count as needed...
+    * Collect the final supply levels as needed...
     */
 
     if (snmp_fd >= 0)
-    {
-      int printer_state;               /* State of printer */
-
-
-      while (!backendSNMPSupplies(snmp_fd, &(addr->addr), &page_count,
-                                  &printer_state) &&
-            printer_state != CUPS_TC_idle)
-       sleep(3);
-
-      if (page_count > start_count)
-        fprintf(stderr, "PAGE: total %d\n", page_count - start_count);
-    }
+      backendSNMPSupplies(snmp_fd, &(addr->addr), NULL, NULL);
 
    /*
     * Close the socket connection and input file...
index fa4b49edc1ef5b39bcf842f8e16d82110ba70795..b7ea287a5a977a0ce35f8c3a40bae05bb0ca9ccc 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Class status CGI for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 2007 by Apple Inc.
+ *   Copyright 2007-2008 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *
  * Contents:
  *
+ *   main()             - Main entry for CGI.
+ *   do_class_op()      - Do a class operation.
+ *   show_all_classes() - Show all classes...
+ *   show_class()       - Show a single class.
  */
 
 /*
index 300d4869ec01ff850149b7318948a7a5733faf9b..e2fa42b8fe3c5018f9ff862b970eaa5a9129aaf7 100644 (file)
  *
  * Contents:
  *
+ *   main()              - Main entry for CGI.
+ *   do_printer_op()     - Do a printer operation.
+ *   show_all_printers() - Show all printers...
+ *   show_printer()      - Show a single printer.
  */
 
 /*
@@ -261,7 +265,7 @@ do_printer_op(http_t      *http,    /* I - HTTP connection */
 
     cgiRewriteURL(uri, url, sizeof(url), NULL);
     cgiFormEncode(uri, url, sizeof(uri));
-    snprintf(refresh, sizeof(refresh), "5;URL=q%s", uri);
+    snprintf(refresh, sizeof(refresh), "5;URL=%s", uri);
     cgiSetVariable("refresh_page", refresh);
 
     cgiStartHTML(title);
index c641a7efeec4998807c0ea3626730a51235ca5e6..0f6b01de29f3ee0c510e2be58c3becea84fcdd4a 100644 (file)
@@ -33,7 +33,7 @@ else
 fi
 
 dnl Debug printfs can slow things down, so provide a separate option for that
-if test x$enable_debug_printf = xyes; then
+if test x$enable_debug_printfs = xyes; then
        CFLAGS="$CFLAGS -DDEBUG"
 fi
 
index ec52d3c5f26fce067d0facc2c9888fafe214d7be..56d1b852f8394bffc531949dde4c66dc9626f294 100644 (file)
@@ -21,8 +21,9 @@ PAP=""
 AC_SUBST(PAP)
 
 if test x$enable_pap != xno -a $uname = Darwin; then
-       PAP="pap"
-       AC_CHECK_HEADER(AppleTalk/at_proto.h)
+       AC_CHECK_HEADER(netat/appletalk.h,[
+               PAP="pap"
+               AC_CHECK_HEADER(AppleTalk/at_proto.h)])
 fi
 
 dnl
index d0c5e320930848200db45721f50e6d006a4e30b2..20f3b2f751ee1314875dea876a5961df28e6f913 100644 (file)
@@ -203,6 +203,9 @@ cupsDoIORequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
   else
     length = ippLength(request);
 
+  DEBUG_printf(("cupsDoIORequest: Request length=%ld, total length=%ld",
+                (long)ippLength(request), (long)length));
+
  /*
   * Loop until we can send the request without authorization problems.
   */
@@ -658,8 +661,6 @@ cupsSendRequest(http_t     *http,   /* I - Connection to server or @code CUPS_HTTP
 
       if (httpWait(http, 1000))
         status = httpUpdate(http);
-      else
-        status = HTTP_EXPECTATION_FAILED;
     }
     else if (httpCheck(http))
       status = httpUpdate(http);
@@ -711,6 +712,12 @@ cupsSendRequest(http_t     *http,  /* I - Connection to server or @code CUPS_HTTP
          */
 
          expect = (http_status_t)0;
+
+         if (httpReconnect(http))
+         {
+           _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+           return (HTTP_SERVICE_UNAVAILABLE);
+         }
          break;
 
       default :
index c2d37220c2e6c12a30fa62b44cd5e40e34d28f2f..24fb3e68e0494d29552795ae4f2e175e144104ae 100644 (file)
@@ -440,6 +440,15 @@ of the order of the pages in the <CODE>page-ranges</CODE> option.
 
 <P>The default is to print all pages.
 
+<blockquote><b>Note:</b>
+
+<p>The page numbers used by <code>page-ranges</code> refer to the output
+pages and not the document's page numbers. Options like <code>number-up</code>
+can make the output page numbering not match the document page numbers.</p>
+
+</blockquote>
+
+
 <H3><A NAME="PAGESET">Selecting Even or Odd Pages</A></H3>
 
 <P>Use the <CODE>-o page-set=set</CODE> option to select the even or odd pages:</P>
index 00ce38deebe5ede95db870018b548a3285e52398..3ae537d3d46920a714f4177492165601caae0851 100644 (file)
@@ -12,7 +12,7 @@
 .\"   which should have been included with this file.  If this file is
 .\"   file is missing or damaged, see the license at "http://www.cups.org/".
 .\"
-.TH lp 1 "Common UNIX Printing System" "29 August 2008" "Apple Inc."
+.TH lp 1 "Common UNIX Printing System" "17 November 2008" "Apple Inc."
 .SH NAME
 lp - print files
 .SH SYNOPSIS
@@ -154,7 +154,10 @@ a completed job.
 .br
 Specifies which pages to print in the document. The list can
 contain a list of numbers and ranges (#-#) separated by commas
-(e.g. 1,3-5,16).
+(e.g. 1,3-5,16). The page numbers refer to the output pages and
+not the document's original pages - options like "number-up" can
+affect the numbering of the pages.
+that are 
 .SH COMMON JOB OPTIONS
 Aside from the printer-specific options reported by the
 \fIlpoptions(1)\fR command, the following generic options are
@@ -186,6 +189,18 @@ landscape pages.
 .br
 Scales the print file to fit on the page.
 .TP 5
+-o number-up=2
+.TP 5
+-o number-up=4
+.TP 5
+-o number-up=6
+.TP 5
+-o number-up=9
+.TP 5
+-o number-up=16
+.br
+Prints multiple document pages on each output page.
+.TP 5
 -o scaling=number
 .br
 Scales image files to use up to \fInumber\fR percent of the page.
index d50e6e387525cae8a39f1dc94c4779061f6c04dc..f49ce453354ecae7a6887c698e8a05d0a27ddee4 100644 (file)
@@ -1136,9 +1136,11 @@ cupsdReadClient(cupsd_client_t *con)     /* I - Client to read from */
 
     cupsdAuthorize(con);
 
-    if (!strncmp(con->http.fields[HTTP_FIELD_CONNECTION], "Keep-Alive", 10) &&
+    if (!strncasecmp(con->http.fields[HTTP_FIELD_CONNECTION], "Keep-Alive", 10) &&
         KeepAlive)
       con->http.keep_alive = HTTP_KEEPALIVE_ON;
+    else if (!strncasecmp(con->http.fields[HTTP_FIELD_CONNECTION], "close", 5))
+      con->http.keep_alive = HTTP_KEEPALIVE_OFF;
 
     if (!con->http.fields[HTTP_FIELD_HOST][0] &&
         con->http.version >= HTTP_1_1)
index 2f2638e3cad20d36b723f819c87533efaba3da2e..c7e98ed715574ef9d6462853b11562a0a3aace7e 100644 (file)
@@ -2162,24 +2162,25 @@ add_job_subscriptions(
     if (mask == CUPSD_EVENT_NONE)
       mask = CUPSD_EVENT_JOB_COMPLETED;
 
-    sub = cupsdAddSubscription(mask, cupsdFindDest(job->dest), job, recipient,
-                               0);
+    if ((sub = cupsdAddSubscription(mask, cupsdFindDest(job->dest), job,
+                                    recipient, 0)) != NULL)
+    {
+      sub->interval = interval;
 
-    sub->interval = interval;
+      cupsdSetString(&sub->owner, job->username);
 
-    cupsdSetString(&sub->owner, job->username);
+      if (user_data)
+      {
+       sub->user_data_len = user_data->values[0].unknown.length;
+       memcpy(sub->user_data, user_data->values[0].unknown.data,
+              sub->user_data_len);
+      }
 
-    if (user_data)
-    {
-      sub->user_data_len = user_data->values[0].unknown.length;
-      memcpy(sub->user_data, user_data->values[0].unknown.data,
-             sub->user_data_len);
+      ippAddSeparator(con->response);
+      ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER,
+                   "notify-subscription-id", sub->id);
     }
 
-    ippAddSeparator(con->response);
-    ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER,
-                  "notify-subscription-id", sub->id);
-
     if (attr)
       attr = attr->next;
   }
@@ -6229,7 +6230,12 @@ create_subscription(
     else
       job = NULL;
 
-    sub = cupsdAddSubscription(mask, printer, job, recipient, 0);
+    if ((sub = cupsdAddSubscription(mask, printer, job, recipient, 0)) == NULL)
+    {
+      send_ipp_status(con, IPP_TOO_MANY_SUBSCRIPTIONS,
+                     _("There are too many subscriptions."));
+      return;
+    }
 
     if (job)
       cupsdLogMessage(CUPSD_LOG_DEBUG, "Added subscription %d for job %d",
index adb7084555ecd1ed08c2bcabae4f2a036fb807fc..abdc338e8572a02e3ec4c9dc2538a0c57c817b37 100644 (file)
@@ -3761,6 +3761,7 @@ update_job(cupsd_job_t *job)              /* I - Job to check */
         cupsdSetPrinterAttr(job->printer, "marker-colors", (char *)attr);
        job->printer->marker_time = time(NULL);
        event |= CUPSD_EVENT_PRINTER_STATE;
+        cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
       }
 
       if ((attr = cupsGetOption("marker-levels", num_attrs, attrs)) != NULL)
@@ -3768,6 +3769,7 @@ update_job(cupsd_job_t *job)              /* I - Job to check */
         cupsdSetPrinterAttr(job->printer, "marker-levels", (char *)attr);
        job->printer->marker_time = time(NULL);
        event |= CUPSD_EVENT_PRINTER_STATE;
+        cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
       }
 
       if ((attr = cupsGetOption("marker-message", num_attrs, attrs)) != NULL)
@@ -3775,6 +3777,7 @@ update_job(cupsd_job_t *job)              /* I - Job to check */
         cupsdSetPrinterAttr(job->printer, "marker-message", (char *)attr);
        job->printer->marker_time = time(NULL);
        event |= CUPSD_EVENT_PRINTER_STATE;
+        cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
       }
 
       if ((attr = cupsGetOption("marker-names", num_attrs, attrs)) != NULL)
@@ -3782,6 +3785,7 @@ update_job(cupsd_job_t *job)              /* I - Job to check */
         cupsdSetPrinterAttr(job->printer, "marker-names", (char *)attr);
        job->printer->marker_time = time(NULL);
        event |= CUPSD_EVENT_PRINTER_STATE;
+        cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
       }
 
       if ((attr = cupsGetOption("marker-types", num_attrs, attrs)) != NULL)
@@ -3789,6 +3793,7 @@ update_job(cupsd_job_t *job)              /* I - Job to check */
         cupsdSetPrinterAttr(job->printer, "marker-types", (char *)attr);
        job->printer->marker_time = time(NULL);
        event |= CUPSD_EVENT_PRINTER_STATE;
+        cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
       }
 
       cupsFreeOptions(num_attrs, attrs);
index f15cef334a6e57c0d2dee409a2a975b9a054a988..5a2af4a2d084fb77104831597d282d78e3d83c7f 100644 (file)
@@ -1312,10 +1312,10 @@ cupsdLoadAllPrinters(void)
         if (!p->attrs)
          cupsdSetPrinterAttrs(p);
 
-        cupsdSetPrinterAttr(p, value, valueptr);
-
-       if (!strncmp(value, "marker-", 7))
-         p->marker_time = time(NULL);
+        if (!strcmp(value, "marker-change-time"))
+         p->marker_time = atoi(valueptr);
+       else
+          cupsdSetPrinterAttr(p, value, valueptr);
       }
     }
     else
@@ -1681,6 +1681,10 @@ cupsdSaveAllPrinters(void)
       cupsFilePutConf(fp, "Attribute", value);
     }
 
+    if (printer->marker_time)
+      cupsFilePrintf(fp, "Attribute marker-change-time %ld\n",
+                     (long)printer->marker_time);
+
     cupsFilePuts(fp, "</Printer>\n");
 
 #ifdef __sgi
@@ -2044,8 +2048,6 @@ cupsdSetPrinterAttr(
         value = ptr;
     }
   }
-
-  cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
 }
 
 
index fa7fb4891cbe6379814f26250e629c11a552c4e5..2247d12de205ce59bdcd00e56996f5eb7b97e243 100644 (file)
@@ -341,8 +341,56 @@ cupsdAddSubscription(
   * Limit the number of subscriptions...
   */
 
-  if (cupsArrayCount(Subscriptions) >= MaxSubscriptions)
+  if (MaxSubscriptions > 0 && cupsArrayCount(Subscriptions) >= MaxSubscriptions)
+  {
+    cupsdLogMessage(CUPSD_LOG_DEBUG,
+                    "cupsdAddSubscription: Reached MaxSubscriptions %d "
+                   "(count=%d)", MaxSubscriptions,
+                   cupsArrayCount(Subscriptions));
     return (NULL);
+  }
+
+  if (MaxSubscriptionsPerJob > 0 && job)
+  {
+    int        count;                          /* Number of job subscriptions */
+
+    for (temp = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions),
+             count = 0;
+         temp;
+        temp = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
+      if (temp->job == job)
+        count ++;
+
+    if (count >= MaxSubscriptionsPerJob)
+    {
+      cupsdLogMessage(CUPSD_LOG_DEBUG,
+                     "cupsdAddSubscription: Reached MaxSubscriptionsPerJob %d "
+                     "for job #%d (count=%d)", MaxSubscriptionsPerJob,
+                     job->id, count);
+      return (NULL);
+    }
+  }
+
+  if (MaxSubscriptionsPerPrinter > 0 && dest)
+  {
+    int        count;                          /* Number of printer subscriptions */
+
+    for (temp = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions),
+             count = 0;
+         temp;
+        temp = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
+      if (temp->dest == dest)
+        count ++;
+
+    if (count >= MaxSubscriptionsPerPrinter)
+    {
+      cupsdLogMessage(CUPSD_LOG_DEBUG,
+                     "cupsdAddSubscription: Reached "
+                     "MaxSubscriptionsPerPrinter %d for %s (count=%d)",
+                     MaxSubscriptionsPerPrinter, dest->name, count);
+      return (NULL);
+    }
+  }
 
  /*
   * Allocate memory for this subscription...
@@ -765,7 +813,6 @@ cupsdLoadAllSubscriptions(void)
       cupsdLogMessage(CUPSD_LOG_ERROR,
                       "Syntax error on line %d of subscriptions.conf.",
                      linenum);
-      break;
     }
     else if (!strcasecmp(line, "Events"))
     {
index c14ec2d62c808a05491bbe26b896995516f6e46f..e09c79f829889391f0a16736332698806536a336 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   "lp" command for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 2007 by Apple Inc.
+ *   Copyright 2007-2008 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -418,8 +418,12 @@ main(int  argc,                            /* I - Number of command-line arguments */
               num_options = cupsAddOption("job-hold-until", "no-hold",
                                          num_options, &options);
            else if (!strcmp(val, "immediate"))
+           {
+              num_options = cupsAddOption("job-hold-until", "no-hold",
+                                         num_options, &options);
               num_options = cupsAddOption("job-priority", "100",
                                          num_options, &options);
+           }
            else if (!strcmp(val, "restart"))
            {
              if (job_id < 1)
index 41fdb7a84edab9a76da4fdf43068ad147806e981..ed613869e676a764ccd6c75ed7a101e18f26b954 100644 (file)
@@ -1307,18 +1307,23 @@ show_jobs(const char *dests,            /* I - Destinations */
   *
   *    attributes-charset
   *    attributes-natural-language
-  *    job-uri
+  *    printer-uri
   *    requested-attributes
+  *    requesting-user-name
+  *    which-jobs
   */
 
   request = ippNewRequest(IPP_GET_JOBS);
 
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
+               NULL, "ipp://localhost/");
+
   ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                 "requested-attributes", sizeof(jattrs) / sizeof(jattrs[0]),
                NULL, jattrs);
 
-  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
-               NULL, "ipp://localhost/jobs/");
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
+               NULL, cupsUser());
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs",
                NULL, which);
index ca0c8d32695aa1710394e35005ed06884e3a300b..fc4697b057ba23c63df4cf6c05bdecb5187aaafa 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: 4.1-requests.test 1595 2001-03-01 20:40:17Z mike $"
+# "$Id: 4.1-requests.test 8144 2008-11-19 19:23:12Z mike $"
 #
 #   Verify that the server requires the following attributes:
 #
        GROUP operation
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
-       ATTR uri job-uri $method://$hostname:$port/jobs
+       ATTR uri job-uri $scheme://$hostname:$port/jobs
 
        # What statuses are OK?
-       STATUS successful-ok
+       STATUS client-error-bad-request
 
        # What attributes do we expect?
        EXPECT attributes-charset
        EXPECT attributes-natural-language
 }
 #
-# End of "$Id: 4.1-requests.test 1595 2001-03-01 20:40:17Z mike $"
+# End of "$Id: 4.1-requests.test 8144 2008-11-19 19:23:12Z mike $"
 #
index 30aeccc4550ee62176afe55fe5af74ac307c40c1..1b0a71afae1f315d362a5cd63729839dda250067 100644 (file)
        GROUP operation
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
-       ATTR uri job-uri $method://$hostname:$port/jobs
+       ATTR uri printer-uri $scheme://$hostname:$port/
 
        # What statuses are OK?
        STATUS successful-ok
index 823f8dacd44785bce7f2f0b24c13017dab0d994b..f63cfcbd2236b7551cebc8071518469b7d8e8cc0 100644 (file)
@@ -15,7 +15,7 @@
        GROUP operation
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
-       ATTR uri printer-uri $method://$hostname:$port/printers/Test1
+       ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
 
         GROUP subscription
        ATTR uri notify-recipient-uri testnotify://
@@ -46,7 +46,7 @@
        GROUP operation
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
-       ATTR uri printer-uri $method://$hostname:$port/printers/Test1
+       ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
        ATTR integer notify-subscription-id $notify-subscription-id
 
        # What statuses are OK?
@@ -68,7 +68,7 @@
        GROUP operation
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
-       ATTR uri printer-uri $method://$hostname:$port/printers/Test1
+       ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
 
         GROUP subscription
        ATTR uri notify-recipient-uri testnotify://
        GROUP operation
        ATTR charset attributes-charset utf-8
        ATTR language attributes-natural-language en
-       ATTR uri printer-uri $method://$hostname:$port/printers/Test1
+       ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
 
        # What statuses are OK?
        STATUS successful-ok
        EXPECT notify-events
        DISPLAY notify-events
 }
+{
+       # The name of the test...
+       NAME "Check MaxSubscriptions limits"
+
+       # The operation to use
+       OPERATION Create-Printer-Subscription
+       RESOURCE /
+
+       # The attributes to send
+       GROUP operation
+       ATTR charset attributes-charset utf-8
+       ATTR language attributes-natural-language en
+       ATTR uri printer-uri $scheme://$hostname:$port/printers/Test1
+
+        GROUP subscription
+       ATTR uri notify-recipient-uri testnotify://
+       ATTR keyword notify-events printer-state-changed
+       ATTR integer notify-lease-duration 5
+
+       # What statuses are OK?
+       STATUS client-error-too-many-subscriptions
+
+       # What attributes do we expect?
+       EXPECT attributes-charset
+       EXPECT attributes-natural-language
+}
 
 #
 # End of "$Id: 4.4-subscription-ops.test 6635 2007-07-09 20:34:48Z mike $"
index cef36288f1f073137dfb2788875935dc8def9a91..cff0a5597f4058fcbc4852b045c284fba30d50ce 100644 (file)
@@ -16,8 +16,8 @@
 
 echo "LPQ Test"
 echo ""
-echo "    lpq"
-../berkeley/lpq 2>&1
+echo "    lpq -P Test1"
+../berkeley/lpq -P Test1 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index bca4ceebd4d33ace3f81d4313a2a50103abbe241..dcd17e23cfb4da0d6fea2a596ac5c3a8281c56e2 100644 (file)
@@ -16,7 +16,6 @@
  *
  *   main()       - Parse options and do tests.
  *   do_tests()   - Do tests as specified in the test file.
- *   ippTagValue()    - Get an IPP value or group tag from a name...
  *   get_token()  - Get a token from a file.
  *   print_attr() - Print an attribute on the screen.
  *   usage()      - Show program usage.
@@ -171,7 +170,7 @@ do_tests(const char *uri,           /* I - URI to connect on */
   int          linenum;                /* Current line number */
   int          version;                /* IPP version number to use */
   http_t       *http;                  /* HTTP connection to server */
-  char         method[HTTP_MAX_URI],   /* URI method */
+  char         scheme[HTTP_MAX_URI],   /* URI scheme */
                userpass[HTTP_MAX_URI], /* username:password */
                server[HTTP_MAX_URI],   /* Server */
                resource[HTTP_MAX_URI]; /* Resource path */
@@ -215,7 +214,7 @@ do_tests(const char *uri,           /* I - URI to connect on */
   * Connect to the server...
   */
 
-  httpSeparateURI(HTTP_URI_CODING_ALL, uri, method, sizeof(method), userpass,
+  httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass,
                   sizeof(userpass), server, sizeof(server), &port, resource,
                  sizeof(resource));
   if ((http = httpConnect(server, port)) == NULL)
@@ -255,7 +254,7 @@ do_tests(const char *uri,           /* I - URI to connect on */
     * Initialize things...
     */
 
-    httpSeparateURI(HTTP_URI_CODING_ALL, uri, method, sizeof(method), userpass,
+    httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass,
                     sizeof(userpass), server, sizeof(server), &port, resource,
                    sizeof(resource));
 
@@ -365,9 +364,10 @@ do_tests(const char *uri,          /* I - URI to connect on */
              strlcpy(tokenptr, uri, sizeof(token) - (tokenptr - token));
              tempptr += 4;
            }
-           else if (!strncasecmp(tempptr + 1, "method", 6))
+           else if (!strncasecmp(tempptr + 1, "scheme", 6) ||
+                    !strncasecmp(tempptr + 1, "method", 6))
            {
-             strlcpy(tokenptr, method, sizeof(token) - (tokenptr - token));
+             strlcpy(tokenptr, scheme, sizeof(token) - (tokenptr - token));
              tempptr += 7;
            }
            else if (!strncasecmp(tempptr + 1, "username", 8))
index 5bbc92c91a8f794a487d36529796911a307aeb0f..a0c814e534d73876fd73434ccc151072e0f23398 100644 (file)
        GROUP job
        ATTR integer copies 1
 
-       FILE ../data/testprint.ps
+       FILE testfile.ps
 
        # What statuses are OK?
-       STATUS ok
-       STATUS ok-subst
+       STATUS successful-ok
+       STATUS successful-ok-ignored-or-substituted-attributes
 
        # What attributes do we expect?
        EXPECT job-id
index c5d671813b6ebd3e7bd8d2072764b5590dd4af5a..ce876297f7fa4617de1c35e7df841f12fafe6c77 100755 (executable)
@@ -326,6 +326,7 @@ PassEnv LOCALEDIR
 DocumentRoot $root/doc
 RequestRoot /tmp/cups-$user/spool
 TempDir /tmp/cups-$user/spool/temp
+MaxSubscriptions 3
 MaxLogSize 0
 AccessLog /tmp/cups-$user/log/access_log
 ErrorLog /tmp/cups-$user/log/error_log
@@ -668,10 +669,10 @@ fi
 
 # Error log messages
 count=`grep '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
-if test $count != 15; then
-       echo "FAIL: $count error messages, expected 15."
+if test $count != 17; then
+       echo "FAIL: $count error messages, expected 17."
        grep '^E ' /tmp/cups-$user/log/error_log
-       echo "<P>FAIL: $count error messages, expected 9.</P>" >>$strfile
+       echo "<P>FAIL: $count error messages, expected 17.</P>" >>$strfile
        echo "<PRE>" >>$strfile
        grep '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile