diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2007-09-28 20:09:54 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2007-09-28 20:09:54 +0000 |
commit | 7dfedb921d49c26230599519e7ddb624d6677372 (patch) | |
tree | 53604f8aea820de2b04ba520e7f3c605c59d517a /scheduler | |
parent | c277e2f802a006f02ab9d5807f12bc96d4831100 (diff) | |
download | cups-7dfedb921d49c26230599519e7ddb624d6677372.tar.gz |
Import changes from CUPS 1.3svn-r7000.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@485 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler')
-rw-r--r-- | scheduler/client.c | 46 | ||||
-rw-r--r-- | scheduler/job.c | 9 | ||||
-rw-r--r-- | scheduler/process.c | 5 |
3 files changed, 50 insertions, 10 deletions
diff --git a/scheduler/client.c b/scheduler/client.c index f0a1225e5..933e96ead 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -1,5 +1,5 @@ /* - * "$Id: client.c 6799 2007-08-15 19:33:36Z mike $" + * "$Id: client.c 7000 2007-09-28 19:47:00Z mike $" * * Client routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -4235,6 +4235,7 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */ script_name[1024], /* SCRIPT_NAME environment variable */ server_name[1024], /* SERVER_NAME environment variable */ server_port[1024]; /* SERVER_PORT environment variable */ + ipp_attribute_t *attr; /* attributes-natural-language attribute */ /* @@ -4370,8 +4371,45 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */ else auth_type[0] = '\0'; - if (con->language) - snprintf(lang, sizeof(lang), "LANG=%s.UTF-8", con->language->language); + if (con->request && + (attr = ippFindAttribute(con->request, "attributes-natural-language", + IPP_TAG_LANGUAGE)) != NULL) + { + switch (strlen(attr->values[0].string.text)) + { + default : + /* + * This is an unknown or badly formatted language code; use + * the POSIX locale... + */ + + strcpy(lang, "LANG=C"); + break; + + case 2 : + /* + * Just the language code (ll)... + */ + + snprintf(lang, sizeof(lang), "LANG=%s.UTF8", + attr->values[0].string.text); + break; + + case 5 : + /* + * Language and country code (ll-cc)... + */ + + snprintf(lang, sizeof(lang), "LANG=%c%c_%c%c.UTF8", + attr->values[0].string.text[0], + attr->values[0].string.text[1], + toupper(attr->values[0].string.text[3] & 255), + toupper(attr->values[0].string.text[4] & 255)); + break; + } + } + else if (con->language) + snprintf(lang, sizeof(lang), "LANG=%s.UTF8", con->language->language); else strcpy(lang, "LANG=C"); @@ -4614,5 +4652,5 @@ write_pipe(cupsd_client_t *con) /* I - Client connection */ /* - * End of "$Id: client.c 6799 2007-08-15 19:33:36Z mike $". + * End of "$Id: client.c 7000 2007-09-28 19:47:00Z mike $". */ diff --git a/scheduler/job.c b/scheduler/job.c index aecad497e..277be5f1d 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1,5 +1,5 @@ /* - * "$Id: job.c 6887 2007-08-29 21:52:06Z mike $" + * "$Id: job.c 7000 2007-09-28 19:47:00Z mike $" * * Job management routines for the Common UNIX Printing System (CUPS). * @@ -3007,7 +3007,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */ * Just the language code (ll)... */ - snprintf(lang, sizeof(lang), "LANG=%s", + snprintf(lang, sizeof(lang), "LANG=%s.UTF8", attr->values[0].string.text); break; @@ -3016,7 +3016,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */ * Language and country code (ll-cc)... */ - snprintf(lang, sizeof(lang), "LANG=%c%c_%c%c", + snprintf(lang, sizeof(lang), "LANG=%c%c_%c%c.UTF8", attr->values[0].string.text[0], attr->values[0].string.text[1], toupper(attr->values[0].string.text[3] & 255), @@ -3610,6 +3610,7 @@ update_job(cupsd_job_t *job) /* I - Job to check */ attrs)) != NULL) { cupsdSetAuthInfoRequired(job->printer, attr, NULL); + cupsdSetPrinterAttrs(job->printer); cupsdSaveAllPrinters(); } @@ -3788,5 +3789,5 @@ update_job_attrs(cupsd_job_t *job) /* I - Job to update */ /* - * End of "$Id: job.c 6887 2007-08-29 21:52:06Z mike $". + * End of "$Id: job.c 7000 2007-09-28 19:47:00Z mike $". */ diff --git a/scheduler/process.c b/scheduler/process.c index 06c9800c4..97c6e5614 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -1,5 +1,5 @@ /* - * "$Id: process.c 6783 2007-08-10 19:48:57Z mike $" + * "$Id: process.c 6988 2007-09-25 15:44:07Z mike $" * * Process management routines for the Common UNIX Printing System (CUPS). * @@ -135,6 +135,7 @@ cupsdStartProcess( { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to execute %s: %s", command, strerror(errno)); + *pid = 0; return (0); } @@ -349,5 +350,5 @@ compare_procs(cupsd_proc_t *a, /* I - First process */ /* - * End of "$Id: process.c 6783 2007-08-10 19:48:57Z mike $". + * End of "$Id: process.c 6988 2007-09-25 15:44:07Z mike $". */ |