From: msweet
Date: Tue, 27 Jul 2010 00:17:12 +0000 (+0000)
Subject: Merge changes from CUPS 1.5svn-r9214.
X-Git-Tag: release-1.6.3~66
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4220952d4d4e3b02701326ea2189a71ab3529a5f;p=thirdparty%2Fcups.git
Merge changes from CUPS 1.5svn-r9214.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@2395 a1ca3aef-8c08-0410-bb20-df032aa958be
---
diff --git a/CHANGES-1.4.txt b/CHANGES-1.4.txt
index 5dac60fbc9..330778b10f 100644
--- a/CHANGES-1.4.txt
+++ b/CHANGES-1.4.txt
@@ -4,6 +4,11 @@ CHANGES-1.4.txt
CHANGES IN CUPS V1.4.5
- Documentation fixes (STR #3542)
+ - PJL value substitution of more than 9 values was broken (STR #3621)
+ - Custom options with missing string values caused ppdEmit* to segfault
+ (STR #3620)
+ - Fixed an issue with the Italian version of the web interface
+ (STR #3624)
- Fixed the Solaris SMF configuration file for cups-lpd (STR #3611)
- The scheduler did not set the notify-subscribed-event attribute when
delivering printer-added or printer-modified events (STR #3608)
diff --git a/backend/ipp.c b/backend/ipp.c
index 0a41ab3673..5d2a82963a 100644
--- a/backend/ipp.c
+++ b/backend/ipp.c
@@ -1062,8 +1062,7 @@ main(int argc, /* I - Number of command-line args */
{
fprintf(stderr, "DEBUG: Read %d bytes...\n", (int)bytes);
- if ((http_status = cupsWriteRequestData(http, buffer, bytes))
- != HTTP_CONTINUE)
+ if (cupsWriteRequestData(http, buffer, bytes) != HTTP_CONTINUE)
break;
else
{
@@ -1186,8 +1185,7 @@ main(int argc, /* I - Number of command-line args */
{
while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
{
- if ((http_status = cupsWriteRequestData(http, buffer, bytes))
- != HTTP_CONTINUE)
+ if (cupsWriteRequestData(http, buffer, bytes) != HTTP_CONTINUE)
break;
else
{
diff --git a/cups/emit.c b/cups/emit.c
index cc8bdddfef..60da1f9a14 100644
--- a/cups/emit.c
+++ b/cups/emit.c
@@ -678,7 +678,8 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
case PPD_CUSTOM_PASSCODE :
case PPD_CUSTOM_PASSWORD :
case PPD_CUSTOM_STRING :
- bufsize += strlen(cparam->current.custom_string);
+ if (cparam->current.custom_string)
+ bufsize += strlen(cparam->current.custom_string);
break;
}
}
@@ -723,7 +724,9 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
case PPD_CUSTOM_PASSCODE :
case PPD_CUSTOM_PASSWORD :
case PPD_CUSTOM_STRING :
- bufsize += 3 + 4 * strlen(cparam->current.custom_string);
+ bufsize += 3;
+ if (cparam->current.custom_string)
+ bufsize += 4 * strlen(cparam->current.custom_string);
break;
}
}
@@ -792,8 +795,8 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
*/
pnum = *cptr++ - '0';
- while (isalnum(*cptr & 255))
- pnum = pnum * 10 + *cptr - '0';
+ while (isdigit(*cptr & 255))
+ pnum = pnum * 10 + *cptr++ - '0';
for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params);
cparam;
@@ -823,9 +826,12 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
case PPD_CUSTOM_PASSCODE :
case PPD_CUSTOM_PASSWORD :
case PPD_CUSTOM_STRING :
- strlcpy(bufptr, cparam->current.custom_string,
- bufend - bufptr);
- bufptr += strlen(bufptr);
+ if (cparam->current.custom_string)
+ {
+ strlcpy(bufptr, cparam->current.custom_string,
+ bufend - bufptr);
+ bufptr += strlen(bufptr);
+ }
break;
}
}
@@ -1028,14 +1034,19 @@ ppdEmitString(ppd_file_t *ppd, /* I - PPD file record */
case PPD_CUSTOM_STRING :
*bufptr++ = '(';
- for (s = cparam->current.custom_string; *s; s ++)
- if (*s < ' ' || *s == '(' || *s == ')' || *s >= 127)
+ if (cparam->current.custom_string)
+ {
+ for (s = cparam->current.custom_string; *s; s ++)
{
- snprintf(bufptr, bufend - bufptr + 1, "\\%03o", *s & 255);
- bufptr += strlen(bufptr);
+ if (*s < ' ' || *s == '(' || *s == ')' || *s >= 127)
+ {
+ snprintf(bufptr, bufend - bufptr + 1, "\\%03o", *s & 255);
+ bufptr += strlen(bufptr);
+ }
+ else
+ *bufptr++ = *s;
}
- else
- *bufptr++ = *s;
+ }
*bufptr++ = ')';
*bufptr++ = '\n';
diff --git a/cups/ppd-private.h b/cups/ppd-private.h
index 3b2d3aa1a4..b5a769b490 100644
--- a/cups/ppd-private.h
+++ b/cups/ppd-private.h
@@ -100,6 +100,7 @@ typedef struct _pwg_s /**** PWG-PPD conversion data ****/
*custom_min_keyword, /* Minimum custom size PWG keyword */
custom_ppd_size[41]; /* Custom PPD size name */
_pwg_size_t custom_size; /* Custom size record */
+ char *source_option; /* PPD option for media source */
int num_sources; /* Number of media sources */
_pwg_map_t *sources; /* Media sources */
int num_types; /* Number of media types */
diff --git a/cups/pwg-file.c b/cups/pwg-file.c
index 6ebd4aaeb2..a6552e11ac 100644
--- a/cups/pwg-file.c
+++ b/cups/pwg-file.c
@@ -238,6 +238,10 @@ _pwgCreateWithFile(const char *filename)/* I - File to read */
pwg->custom_min_width, pwg->custom_min_length);
pwg->custom_min_keyword = _cupsStrAlloc(pwg_keyword);
}
+ else if (!strcasecmp(line, "SourceOption"))
+ {
+ pwg->source_option = _cupsStrAlloc(value);
+ }
else if (!strcasecmp(line, "NumSources"))
{
if (num_sources > 0)
@@ -461,6 +465,9 @@ _pwgDestroy(_pwg_t *pwg) /* I - PWG mapping data */
free(pwg->sizes);
}
+ if (pwg->source_option)
+ _cupsStrFree(pwg->source_option);
+
if (pwg->sources)
{
for (i = pwg->num_sources, map = pwg->sources; i > 0; i --, map ++)
@@ -565,6 +572,9 @@ _pwgWriteFile(_pwg_t *pwg, /* I - PWG mapping data */
* Media sources...
*/
+ if (pwg->source_option)
+ cupsFilePrintf(fp, "SourceOption %s\n", pwg->source_option);
+
if (pwg->num_sources > 0)
{
cupsFilePrintf(fp, "NumSources %d\n", pwg->num_sources);
diff --git a/cups/pwg-ppd.c b/cups/pwg-ppd.c
index 86c7715ec6..071eb7b175 100644
--- a/cups/pwg-ppd.c
+++ b/cups/pwg-ppd.c
@@ -223,8 +223,13 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
* Copy and convert InputSlot data...
*/
- if ((input_slot = ppdFindOption(ppd, "InputSlot")) != NULL)
+ if ((input_slot = ppdFindOption(ppd, "InputSlot")) == NULL)
+ input_slot = ppdFindOption(ppd, "HPPaperSource");
+
+ if (input_slot)
{
+ pwg->source_option = _cupsStrAlloc(input_slot->keyword);
+
if ((pwg->sources = calloc(input_slot->num_choices,
sizeof(_pwg_map_t))) == NULL)
{
@@ -245,6 +250,10 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
pwg_name = "auto";
else if (!strcasecmp(choice->choice, "Cassette"))
pwg_name = "main";
+ else if (!strcasecmp(choice->choice, "PhotoTray"))
+ pwg_name = "photo";
+ else if (!strcasecmp(choice->choice, "CDTray"))
+ pwg_name = "disc";
else if (!strncasecmp(choice->choice, "Multipurpose", 12) ||
!strcasecmp(choice->choice, "MP") ||
!strcasecmp(choice->choice, "MPTray"))
@@ -443,62 +452,102 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
if (!pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME][_PWG_PRINT_QUALITY_DRAFT] &&
!pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME][_PWG_PRINT_QUALITY_NORMAL] &&
- !pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME][_PWG_PRINT_QUALITY_HIGH] &&
- (color_model = ppdFindOption(ppd, "ColorModel")) != NULL &&
- ppdFindChoice(color_model, "Gray"))
+ !pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME][_PWG_PRINT_QUALITY_HIGH])
{
/*
- * Copy and convert ColorModel (output-mode) data...
+ * Try adding some common color options to create grayscale presets. These
+ * are listed in order of popularity...
*/
- cups_option_t *coption, /* Color option */
- *moption; /* Monochrome option */
+ const char *color_option = NULL, /* Color control option */
+ *gray_choice = NULL; /* Choice to select grayscale */
- for (pwg_print_quality = _PWG_PRINT_QUALITY_DRAFT;
- pwg_print_quality < _PWG_PRINT_QUALITY_MAX;
- pwg_print_quality ++)
+ if ((color_model = ppdFindOption(ppd, "ColorModel")) != NULL &&
+ ppdFindChoice(color_model, "Gray"))
{
- if (pwg->num_presets[_PWG_OUTPUT_MODE_COLOR][pwg_print_quality])
- {
- /*
- * Copy the color options...
- */
+ color_option = "ColorModel";
+ gray_choice = "Gray";
+ }
+ else if ((color_model = ppdFindOption(ppd, "HPColorMode")) != NULL &&
+ ppdFindChoice(color_model, "grayscale"))
+ {
+ color_option = "HPColorMode";
+ gray_choice = "grayscale";
+ }
+ else if ((color_model = ppdFindOption(ppd, "BRMonoColor")) != NULL &&
+ ppdFindChoice(color_model, "Mono"))
+ {
+ color_option = "BRMonoColor";
+ gray_choice = "Mono";
+ }
+ else if ((color_model = ppdFindOption(ppd, "CNIJSGrayScale")) != NULL &&
+ ppdFindChoice(color_model, "1"))
+ {
+ color_option = "CNIJSGrayScale";
+ gray_choice = "1";
+ }
+ else if ((color_model = ppdFindOption(ppd, "HPColorAsGray")) != NULL &&
+ ppdFindChoice(color_model, "True"))
+ {
+ color_option = "HPColorAsGray";
+ gray_choice = "True";
+ }
- num_options = pwg->num_presets[_PWG_OUTPUT_MODE_COLOR]
- [pwg_print_quality];
- options = calloc(sizeof(cups_option_t), num_options);
+ if (color_option && gray_choice)
+ {
+ /*
+ * Copy and convert ColorModel (output-mode) data...
+ */
- if (options)
+ cups_option_t *coption, /* Color option */
+ *moption; /* Monochrome option */
+
+ for (pwg_print_quality = _PWG_PRINT_QUALITY_DRAFT;
+ pwg_print_quality < _PWG_PRINT_QUALITY_MAX;
+ pwg_print_quality ++)
+ {
+ if (pwg->num_presets[_PWG_OUTPUT_MODE_COLOR][pwg_print_quality])
{
- for (i = num_options, moption = options,
- coption = pwg->presets[_PWG_OUTPUT_MODE_COLOR]
- [pwg_print_quality];
- i > 0;
- i --, moption ++, coption ++)
+ /*
+ * Copy the color options...
+ */
+
+ num_options = pwg->num_presets[_PWG_OUTPUT_MODE_COLOR]
+ [pwg_print_quality];
+ options = calloc(sizeof(cups_option_t), num_options);
+
+ if (options)
{
- moption->name = _cupsStrRetain(coption->name);
- moption->value = _cupsStrRetain(coption->value);
+ for (i = num_options, moption = options,
+ coption = pwg->presets[_PWG_OUTPUT_MODE_COLOR]
+ [pwg_print_quality];
+ i > 0;
+ i --, moption ++, coption ++)
+ {
+ moption->name = _cupsStrRetain(coption->name);
+ moption->value = _cupsStrRetain(coption->value);
+ }
+
+ pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME][pwg_print_quality] =
+ num_options;
+ pwg->presets[_PWG_OUTPUT_MODE_MONOCHROME][pwg_print_quality] =
+ options;
}
-
- pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME][pwg_print_quality] =
- num_options;
- pwg->presets[_PWG_OUTPUT_MODE_MONOCHROME][pwg_print_quality] =
- options;
}
- }
- else if (pwg_print_quality != _PWG_PRINT_QUALITY_NORMAL)
- continue;
+ else if (pwg_print_quality != _PWG_PRINT_QUALITY_NORMAL)
+ continue;
- /*
- * Add ColorModel=Gray to the preset...
- */
+ /*
+ * Add the grayscale option to the preset...
+ */
- pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME][pwg_print_quality] =
- cupsAddOption("ColorModel", "Gray",
- pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME]
- [pwg_print_quality],
- pwg->presets[_PWG_OUTPUT_MODE_MONOCHROME] +
- pwg_print_quality);
+ pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME][pwg_print_quality] =
+ cupsAddOption(color_option, gray_choice,
+ pwg->num_presets[_PWG_OUTPUT_MODE_MONOCHROME]
+ [pwg_print_quality],
+ pwg->presets[_PWG_OUTPUT_MODE_MONOCHROME] +
+ pwg_print_quality);
+ }
}
}
@@ -607,13 +656,30 @@ _pwgGetInputSlot(_pwg_t *pwg, /* I - PWG mapping data */
ipp_attribute_t *media_col, /* media-col attribute */
*media_source; /* media-source attribute */
+ _pwg_size_t size; /* Dimensional size */
+ int margins_set; /* Were the margins set? */
media_col = ippFindAttribute(job, "media-col", IPP_TAG_BEGIN_COLLECTION);
if (media_col &&
(media_source = ippFindAttribute(media_col->values[0].collection,
"media-source",
IPP_TAG_KEYWORD)) != NULL)
+ {
+ /*
+ * Use the media-source value from media-col...
+ */
+
keyword = media_source->values[0].string.text;
+ }
+ else if (_pwgInitSize(&size, job, &margins_set))
+ {
+ /*
+ * For media <= 5x7, look for a photo tray...
+ */
+
+ if (size.width <= (5 * 2540) && size.length <= (7 * 2540))
+ keyword = "photo";
+ }
}
if (keyword)
diff --git a/cups/transcode.c b/cups/transcode.c
index 7b98f25185..f437dfe09c 100644
--- a/cups/transcode.c
+++ b/cups/transcode.c
@@ -88,7 +88,6 @@ cupsCharsetToUTF8(
const cups_encoding_t encoding) /* I - Encoding */
{
cups_utf8_t *destptr; /* Pointer into UTF-8 buffer */
- int bytes; /* Number of bytes converted */
size_t srclen, /* Length of source string */
outBytesLeft; /* Bytes remaining in output buffer */
@@ -172,9 +171,10 @@ cupsCharsetToUTF8(
{
srclen = strlen(src);
outBytesLeft = maxout - 1;
- bytes = (int)iconv(map_to_utf8, (char **)&src, &srclen,
- (char **)&destptr, &outBytesLeft);
- *destptr = '\0';
+
+ iconv(map_to_utf8, (char **)&src, &srclen, (char **)&destptr,
+ &outBytesLeft);
+ *destptr = '\0';
_cupsMutexUnlock(&map_mutex);
@@ -206,7 +206,6 @@ cupsUTF8ToCharset(
const cups_encoding_t encoding) /* I - Encoding */
{
char *destptr; /* Pointer into destination */
- int bytes; /* Number of bytes converted */
size_t srclen, /* Length of source string */
outBytesLeft; /* Bytes remaining in output buffer */
@@ -293,9 +292,9 @@ cupsUTF8ToCharset(
{
srclen = strlen((char *)src);
outBytesLeft = maxout - 1;
- bytes = (int)iconv(map_from_utf8, (char **)&src, &srclen,
- &destptr, &outBytesLeft);
- *destptr = '\0';
+
+ iconv(map_from_utf8, (char **)&src, &srclen, &destptr, &outBytesLeft);
+ *destptr = '\0';
_cupsMutexUnlock(&map_mutex);
diff --git a/doc/help/ref-cupsd-conf.html.in b/doc/help/ref-cupsd-conf.html.in
index 4f1089a172..a35ca4af67 100644
--- a/doc/help/ref-cupsd-conf.html.in
+++ b/doc/help/ref-cupsd-conf.html.in
@@ -2931,23 +2931,23 @@ SetEnv MY_ENV_VAR foo
variable that should be passed to child processes.
-
+
Examples
-SSLOptions 127.0.0.1:443
-SSLOptions 192.0.2.1:443
+SSLListen 127.0.0.1:443
+SSLListen 192.0.2.1:443
Description
-The SSLOptions directive specifies a network
+
The SSLListen directive specifies a network
address and port to listen for secure connections. Multiple
-SSLOptions directives can be provided to listen on
+SSLListen directives can be provided to listen on
multiple addresses.
-The SSLOptions directive is similar to the The SSLListen directive is similar to the SSLPort directive but allows you
to restrict access to specific interfaces or networks.
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index 9cc8fbc840..897c2f46d3 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -1362,7 +1362,6 @@ add_job(cupsd_client_t *con, /* I - Client connection */
int kbytes; /* Size of print file */
int i; /* Looping var */
int lowerpagerange; /* Page range bound */
- const char *ppd; /* PPD keyword for media selection */
int exact; /* Did we have an exact match? */
ipp_attribute_t *media_col, /* media-col attribute */
*media_margin; /* media-*-margin attribute */
@@ -1538,7 +1537,7 @@ add_job(cupsd_client_t *con, /* I - Client connection */
if (!ippFindAttribute(con->request, "PageRegion", IPP_TAG_ZERO) &&
!ippFindAttribute(con->request, "PageSize", IPP_TAG_ZERO) &&
- (ppd = _pwgGetPageSize(printer->pwg, con->request, NULL, &exact)) != NULL)
+ _pwgGetPageSize(printer->pwg, con->request, NULL, &exact))
{
if (!exact &&
(media_col = ippFindAttribute(con->request, "media-col",
@@ -2944,11 +2943,11 @@ add_printer(cupsd_client_t *con, /* I - Client connection */
char cache_name[1024]; /* Cache filename for printer attrs */
- snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp2", CacheDir,
+ snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp3", CacheDir,
printer->name);
unlink(cache_name);
- snprintf(cache_name, sizeof(cache_name), "%s/%s.pwg", CacheDir,
+ snprintf(cache_name, sizeof(cache_name), "%s/%s.pwg2", CacheDir,
printer->name);
unlink(cache_name);
@@ -3994,7 +3993,7 @@ cancel_all_jobs(cupsd_client_t *con, /* I - Client connection */
{
for (i = 0; i < job_ids->num_values; i ++)
{
- if ((job = cupsdFindJob(job_ids->values[i].integer)) == NULL)
+ if (!cupsdFindJob(job_ids->values[i].integer))
break;
}
@@ -4633,7 +4632,6 @@ close_job(cupsd_client_t *con, /* I - Client connection */
ipp_attribute_t *uri) /* I - Printer URI */
{
cupsd_job_t *job; /* Job */
- cupsd_printer_t *printer; /* Printer */
ipp_attribute_t *attr; /* Attribute */
char job_uri[HTTP_MAX_URI],
/* Job URI */
@@ -4681,8 +4679,6 @@ close_job(cupsd_client_t *con, /* I - Client connection */
return;
}
- printer = cupsdFindDest(job->dest);
-
/*
* See if the job is owned by the requesting user...
*/
@@ -6660,10 +6656,10 @@ delete_printer(cupsd_client_t *con, /* I - Client connection */
printer->name);
unlink(filename);
- snprintf(filename, sizeof(filename), "%s/%s.ipp2", CacheDir, printer->name);
+ snprintf(filename, sizeof(filename), "%s/%s.ipp3", CacheDir, printer->name);
unlink(filename);
- snprintf(filename, sizeof(filename), "%s/%s.pwg", CacheDir, printer->name);
+ snprintf(filename, sizeof(filename), "%s/%s.pwg2", CacheDir, printer->name);
unlink(filename);
#ifdef __APPLE__
@@ -7356,7 +7352,7 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */
for (i = 0; i < job_ids->num_values; i ++)
{
- if ((job = cupsdFindJob(job_ids->values[i].integer)) == NULL)
+ if (!cupsdFindJob(job_ids->values[i].integer))
break;
}
diff --git a/scheduler/job.c b/scheduler/job.c
index 9822ac5817..2d930302bd 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -3120,28 +3120,35 @@ get_options(cupsd_job_t *job, /* I - Job */
num_pwgppds = cupsAddOption(pwg->sides_option, pwg->sides_2sided_short,
num_pwgppds, &pwgppds);
}
- }
-
- if (!ippFindAttribute(job->attrs, "InputSlot", IPP_TAG_ZERO) &&
- (ppd = _pwgGetInputSlot(job->printer->pwg, job->attrs, NULL)) != NULL)
- num_pwgppds = cupsAddOption("InputSlot", ppd, num_pwgppds, &pwgppds);
- if (!ippFindAttribute(job->attrs, "MediaType", IPP_TAG_ZERO) &&
- (ppd = _pwgGetMediaType(job->printer->pwg, job->attrs, NULL)) != NULL)
- num_pwgppds = cupsAddOption("MediaType", ppd, num_pwgppds, &pwgppds);
-
- if (!ippFindAttribute(job->attrs, "PageRegion", IPP_TAG_ZERO) &&
- !ippFindAttribute(job->attrs, "PageSize", IPP_TAG_ZERO) &&
- (ppd = _pwgGetPageSize(job->printer->pwg, job->attrs, NULL,
- &exact)) != NULL)
- num_pwgppds = cupsAddOption("PageSize", ppd, num_pwgppds, &pwgppds);
+ if (!ippFindAttribute(job->attrs, "InputSlot", IPP_TAG_ZERO) &&
+ !ippFindAttribute(job->attrs, "HPPaperSource", IPP_TAG_ZERO))
+ {
+ if ((ppd = _pwgGetInputSlot(pwg, job->attrs, NULL)) != NULL)
+ num_pwgppds = cupsAddOption(pwg->source_option, ppd, num_pwgppds,
+ &pwgppds);
+ else if (!ippFindAttribute(job->attrs, "AP_D_InputSlot", IPP_TAG_ZERO))
+ num_pwgppds = cupsAddOption("AP_D_InputSlot", "", num_pwgppds,
+ &pwgppds);
+ }
- if (!ippFindAttribute(job->attrs, "OutputBin", IPP_TAG_ZERO) &&
- (attr = ippFindAttribute(job->attrs, "output-bin",
- IPP_TAG_ZERO)) != NULL &&
- (attr->value_tag == IPP_TAG_KEYWORD || attr->value_tag == IPP_TAG_NAME) &&
- (ppd = _pwgGetOutputBin(pwg, attr->values[0].string.text)) != NULL)
- num_pwgppds = cupsAddOption("OutputBin", ppd, num_pwgppds, &pwgppds);
+ if (!ippFindAttribute(job->attrs, "MediaType", IPP_TAG_ZERO) &&
+ (ppd = _pwgGetMediaType(pwg, job->attrs, NULL)) != NULL)
+ num_pwgppds = cupsAddOption("MediaType", ppd, num_pwgppds, &pwgppds);
+
+ if (!ippFindAttribute(job->attrs, "PageRegion", IPP_TAG_ZERO) &&
+ !ippFindAttribute(job->attrs, "PageSize", IPP_TAG_ZERO) &&
+ (ppd = _pwgGetPageSize(pwg, job->attrs, NULL, &exact)) != NULL)
+ num_pwgppds = cupsAddOption("PageSize", ppd, num_pwgppds, &pwgppds);
+
+ if (!ippFindAttribute(job->attrs, "OutputBin", IPP_TAG_ZERO) &&
+ (attr = ippFindAttribute(job->attrs, "output-bin",
+ IPP_TAG_ZERO)) != NULL &&
+ (attr->value_tag == IPP_TAG_KEYWORD ||
+ attr->value_tag == IPP_TAG_NAME) &&
+ (ppd = _pwgGetOutputBin(pwg, attr->values[0].string.text)) != NULL)
+ num_pwgppds = cupsAddOption("OutputBin", ppd, num_pwgppds, &pwgppds);
+ }
/*
* Figure out how much room we need...
@@ -3275,6 +3282,10 @@ get_options(cupsd_job_t *job, /* I - Job */
if (!attr->values[i].boolean)
strlcat(optptr, "no", optlength - (optptr - options));
+ strlcat(optptr, attr->name,
+ optlength - (optptr - options));
+ break;
+
case IPP_TAG_RANGE :
if (attr->values[i].range.lower == attr->values[i].range.upper)
snprintf(optptr, optlength - (optptr - options) - 1,
diff --git a/scheduler/printers.c b/scheduler/printers.c
index 76eb860280..b0298c0ec3 100644
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
@@ -1,7 +1,7 @@
/*
* "$Id: printers.c 7968 2008-09-19 23:03:01Z mike $"
*
- * Printer routines for the Common UNIX Printing System (CUPS).
+ * Printer routines for the CUPS scheduler.
*
* Copyright 2007-2010 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
@@ -4002,11 +4002,11 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */
* Check to see if the cache is up-to-date...
*/
- snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp2", CacheDir, p->name);
+ snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp3", CacheDir, p->name);
if (stat(cache_name, &cache_info))
cache_info.st_mtime = 0;
- snprintf(pwg_name, sizeof(pwg_name), "%s/%s.pwg", CacheDir, p->name);
+ snprintf(pwg_name, sizeof(pwg_name), "%s/%s.pwg2", CacheDir, p->name);
if (stat(pwg_name, &pwg_info))
pwg_info.st_mtime = 0;
@@ -4487,10 +4487,17 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */
ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
"output-bin-default", NULL, p->pwg->bins[0].pwg);
}
- else if ((ppd_attr = ppdFindAttr(ppd, "DefaultOutputOrder",
+ else if (((ppd_attr = ppdFindAttr(ppd, "DefaultOutputOrder",
NULL)) != NULL &&
- !strcasecmp(ppd_attr->value, "Reverse"))
+ !strcasecmp(ppd_attr->value, "Reverse")) ||
+ (!ppd_attr && ppd->manufacturer && /* EPSON "compatibility heuristic" */
+ !strcasecmp(ppd->manufacturer, "epson")))
{
+ /*
+ * Report that this printer has a single output bin that leaves pages face
+ * up.
+ */
+
ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
"output-bin-supported", NULL, "face-up");
ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
diff --git a/templates/it/jobs-header.tmpl b/templates/it/jobs-header.tmpl
index bdfe0d634e..38538d12f5 100644
--- a/templates/it/jobs-header.tmpl
+++ b/templates/it/jobs-header.tmpl
@@ -1,5 +1,5 @@
{?which_jobs=?:}
-{?which_jobs=completed?:}
-{?which_jobs=all?:}
+{?which_jobs=completed?:}
+{?which_jobs=all?:}
{total=0?Nessuna stampa:Mostrat{total=1?a:e} {#job_id} di {total} stamp{total=1?a:e} {?which_jobs=?attiva:{which_jobs=all?:completata}} }.