From: msweet Date: Wed, 19 Nov 2008 23:25:47 +0000 (+0000) Subject: Merge changes from CUPS 1.4svn-r8148. X-Git-Tag: release-1.6.3~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52f6f666c3ffd368f98d5be963e2e7a92f3dc82b;p=thirdparty%2Fcups.git Merge changes from CUPS 1.4svn-r8148. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1068 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-1.3.txt b/CHANGES-1.3.txt index e386fed360..60223859cd 100644 --- a/CHANGES-1.3.txt +++ b/CHANGES-1.3.txt @@ -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 diff --git a/CHANGES.txt b/CHANGES.txt index 0c4f2ab161..e4cbfc6045 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/backend/lpd.c b/backend/lpd.c index a543c27f78..c0aaa65323 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -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... diff --git a/cgi-bin/classes.c b/cgi-bin/classes.c index fa4b49edc1..b7ea287a5a 100644 --- a/cgi-bin/classes.c +++ b/cgi-bin/classes.c @@ -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 @@ -14,6 +14,10 @@ * * 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. */ /* diff --git a/cgi-bin/printers.c b/cgi-bin/printers.c index 300d4869ec..e2fa42b8fe 100644 --- a/cgi-bin/printers.c +++ b/cgi-bin/printers.c @@ -14,6 +14,10 @@ * * 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); diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 index c641a7efee..0f6b01de29 100644 --- a/config-scripts/cups-compiler.m4 +++ b/config-scripts/cups-compiler.m4 @@ -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 diff --git a/config-scripts/cups-pap.m4 b/config-scripts/cups-pap.m4 index ec52d3c5f2..56d1b852f8 100644 --- a/config-scripts/cups-pap.m4 +++ b/config-scripts/cups-pap.m4 @@ -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 diff --git a/cups/request.c b/cups/request.c index d0c5e32093..20f3b2f751 100644 --- a/cups/request.c +++ b/cups/request.c @@ -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 : diff --git a/doc/help/options.html b/doc/help/options.html index c2d37220c2..24fb3e68e0 100644 --- a/doc/help/options.html +++ b/doc/help/options.html @@ -440,6 +440,15 @@ of the order of the pages in the page-ranges option.

The default is to print all pages. +

Note: + +

The page numbers used by page-ranges refer to the output +pages and not the document's page numbers. Options like number-up +can make the output page numbering not match the document page numbers.

+ +
+ +

Selecting Even or Odd Pages

Use the -o page-set=set option to select the even or odd pages:

diff --git a/man/lp.man b/man/lp.man index 00ce38deeb..3ae537d3d4 100644 --- a/man/lp.man +++ b/man/lp.man @@ -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. diff --git a/scheduler/client.c b/scheduler/client.c index d50e6e3875..f49ce45335 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -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) diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 2f2638e3ca..c7e98ed715 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -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", diff --git a/scheduler/job.c b/scheduler/job.c index adb7084555..abdc338e85 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -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); diff --git a/scheduler/printers.c b/scheduler/printers.c index f15cef334a..5a2af4a2d0 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -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, "\n"); #ifdef __sgi @@ -2044,8 +2048,6 @@ cupsdSetPrinterAttr( value = ptr; } } - - cupsdMarkDirty(CUPSD_DIRTY_PRINTERS); } diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index fa7fb4891c..2247d12de2 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -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")) { diff --git a/systemv/lp.c b/systemv/lp.c index c14ec2d62c..e09c79f829 100644 --- a/systemv/lp.c +++ b/systemv/lp.c @@ -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) diff --git a/systemv/lpstat.c b/systemv/lpstat.c index 41fdb7a84e..ed613869e6 100644 --- a/systemv/lpstat.c +++ b/systemv/lpstat.c @@ -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); diff --git a/test/4.1-requests.test b/test/4.1-requests.test index ca0c8d3269..fc4697b057 100644 --- a/test/4.1-requests.test +++ b/test/4.1-requests.test @@ -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: # @@ -126,15 +126,15 @@ 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 $" # diff --git a/test/4.3-job-ops.test b/test/4.3-job-ops.test index 30aeccc455..1b0a71afae 100644 --- a/test/4.3-job-ops.test +++ b/test/4.3-job-ops.test @@ -309,7 +309,7 @@ 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 diff --git a/test/4.4-subscription-ops.test b/test/4.4-subscription-ops.test index 823f8dacd4..f63cfcbd22 100644 --- a/test/4.4-subscription-ops.test +++ b/test/4.4-subscription-ops.test @@ -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:// @@ -101,7 +101,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 # What statuses are OK? STATUS successful-ok @@ -116,6 +116,32 @@ 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 $" diff --git a/test/5.3-lpq.sh b/test/5.3-lpq.sh index cef36288f1..cff0a5597f 100644 --- a/test/5.3-lpq.sh +++ b/test/5.3-lpq.sh @@ -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 diff --git a/test/ipptest.c b/test/ipptest.c index bca4ceebd4..dcd17e23cf 100644 --- a/test/ipptest.c +++ b/test/ipptest.c @@ -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)) diff --git a/test/print-job.test b/test/print-job.test index 5bbc92c91a..a0c814e534 100644 --- a/test/print-job.test +++ b/test/print-job.test @@ -20,11 +20,11 @@ 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 diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh index c5d671813b..ce876297f7 100755 --- a/test/run-stp-tests.sh +++ b/test/run-stp-tests.sh @@ -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 "

FAIL: $count error messages, expected 9.

" >>$strfile + echo "

FAIL: $count error messages, expected 17.

" >>$strfile echo "
" >>$strfile
 	grep '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 	echo "
" >>$strfile