con->request->request.any.version[1]);
send_ipp_status(con, IPP_VERSION_NOT_SUPPORTED,
- _("Bad request version number %d.%d"),
+ _("Bad request version number %d.%d."),
con->request->request.any.version[0],
con->request->request.any.version[1]);
}
IPP_BAD_REQUEST, con->http.hostname,
con->request->request.any.request_id);
- send_ipp_status(con, IPP_BAD_REQUEST, _("Bad request ID %d"),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad request ID %d."),
con->request->request.any.request_id);
}
else if (!con->request->attrs)
"%04X %s No attributes in request",
IPP_BAD_REQUEST, con->http.hostname);
- send_ipp_status(con, IPP_BAD_REQUEST, _("No attributes in request"));
+ send_ipp_status(con, IPP_BAD_REQUEST, _("No attributes in request."));
}
else
{
IPP_BAD_REQUEST, con->http.hostname);
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Attribute groups are out of order (%x < %x)"),
+ _("Attribute groups are out of order (%x < %x)."),
attr->group_tag, group);
break;
}
IPP_CHARSET, con->http.hostname,
charset->values[0].string.text);
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Unsupported character set \"%s\""),
+ _("Unsupported character set \"%s\"."),
charset->values[0].string.text);
}
else if (!charset || !language ||
cupsdLogMessage(CUPSD_LOG_DEBUG, "End of attributes...");
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Missing required attributes"));
+ _("Missing required attributes."));
}
else
{
ippOpString(con->request->request.op.operation_id));
send_ipp_status(con, IPP_OPERATION_NOT_SUPPORTED,
- _("%s not supported"),
+ _("%s not supported."),
ippOpString(
con->request->request.op.operation_id));
break;
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
printer->accepting = 1;
printer->state_message[0] = '\0';
- cupsdAddPrinterHistory(printer);
-
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, printer, NULL,
"Now accepting jobs.");
*/
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("A printer named \"%s\" already exists"),
+ _("A printer named \"%s\" already exists."),
resource + 9);
return;
}
pclass->name, attr->values[0].boolean, pclass->accepting);
pclass->accepting = attr->values[0].boolean;
- cupsdAddPrinterHistory(pclass);
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, pclass, NULL, "%s accepting jobs.",
pclass->accepting ? "Now" : "No longer");
attr->values[0].integer != IPP_PRINTER_STOPPED)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Attempt to set %s printer-state to bad value %d"),
+ _("Attempt to set %s printer-state to bad value %d."),
pclass->name, attr->values[0].integer);
return;
}
{
strlcpy(pclass->state_message, attr->values[0].string.text,
sizeof(pclass->state_message));
- cupsdAddPrinterHistory(pclass);
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, pclass, NULL, "%s",
pclass->state_message);
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
else if (dtype & CUPS_PRINTER_CLASS)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Nested classes are not allowed"));
+ _("Nested classes are not allowed."));
return;
}
}
else
{
- cupsdAddPrinterHistory(pclass);
-
cupsdAddEvent(CUPSD_EVENT_PRINTER_ADDED,
pclass, NULL, "New class \"%s\" added by \"%s\".",
pclass->name, get_username(con));
if (con)
send_ipp_status(con, IPP_INTERNAL_ERROR,
- _("Unable to allocate memory for file types"));
+ _("Unable to allocate memory for file types."));
return (-1);
}
strcasecmp(con->http.hostname, ServerName))
{
send_ipp_status(con, IPP_NOT_AUTHORIZED,
- _("The printer or class is not shared"));
+ _("The printer or class is not shared."));
return (NULL);
}
filetype->type);
send_ipp_status(con, IPP_DOCUMENT_FORMAT,
- _("Unsupported format \'%s\'"), mimetype);
+ _("Unsupported format \"%s\"."), mimetype);
ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE,
"document-format", NULL, mimetype);
if (attr->value_tag != IPP_TAG_KEYWORD &&
attr->value_tag != IPP_TAG_NAME)
{
- send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-sheets value type"));
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-sheets value type."));
return (NULL);
}
if (attr->num_values > 2)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Too many job-sheets values (%d > 2)"),
+ _("Too many job-sheets values (%d > 2)."),
attr->num_values);
return (NULL);
}
if (strcmp(attr->values[i].string.text, "none") &&
!cupsdFindBanner(attr->values[i].string.text))
{
- send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-sheets value \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-sheets value \"%s\"."),
attr->values[i].string.text);
return (NULL);
}
if (!ippFindAttribute(con->request, "PageRegion", IPP_TAG_ZERO) &&
!ippFindAttribute(con->request, "PageSize", IPP_TAG_ZERO) &&
- _pwgGetPageSize(printer->pwg, con->request, NULL, &exact))
+ _ppdCacheGetPageSize(printer->pc, con->request, NULL, &exact))
{
if (!exact &&
(media_col = ippFindAttribute(con->request, "media-col",
if (MaxJobs && cupsArrayCount(Jobs) >= MaxJobs)
{
- send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Too many active jobs."));
+ send_ipp_status(con, IPP_NOT_POSSIBLE, _("Too many active jobs."));
return (NULL);
}
if ((job = cupsdAddJob(priority, printer->name)) == NULL)
{
send_ipp_status(con, IPP_INTERNAL_ERROR,
- _("Unable to add job for destination \"%s\""),
+ _("Unable to add job for destination \"%s\"."),
printer->name);
return (NULL);
}
}
else if ((attr = ippFindAttribute(job->attrs, "job-sheets",
IPP_TAG_ZERO)) != NULL)
- job->sheets = attr;
+ job->job_sheets = attr;
/*
* Fill in the response info...
resource, sizeof(resource)) < HTTP_URI_OK)
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Bad notify-recipient-uri URI \"%s\""), recipient);
+ _("Bad notify-recipient-uri \"%s\"."), recipient);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_URI_SCHEME);
return;
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
_("notify-recipient-uri URI \"%s\" uses unknown "
- "scheme"), recipient);
+ "scheme."), recipient);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_URI_SCHEME);
return;
if (!strcmp(scheme, "rss") && !check_rss_recipient(recipient))
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("notify-recipient-uri URI \"%s\" is already used"),
+ _("notify-recipient-uri URI \"%s\" is already used."),
recipient);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_ATTRIBUTES);
if (strcmp(pullmethod, "ippget"))
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Bad notify-pull-method \"%s\""), pullmethod);
+ _("Bad notify-pull-method \"%s\"."), pullmethod);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_ATTRIBUTES);
return;
strcmp(attr->values[0].string.text, "utf-8"))
{
send_ipp_status(con, IPP_CHARSET,
- _("Character set \"%s\" not supported"),
+ _("Character set \"%s\" not supported."),
attr->values[0].string.text);
return;
}
strcmp(attr->values[0].string.text, DefaultLanguage)))
{
send_ipp_status(con, IPP_CHARSET,
- _("Language \"%s\" not supported"),
+ _("Language \"%s\" not supported."),
attr->values[0].string.text);
return;
}
{
send_ipp_status(con, IPP_REQUEST_VALUE,
_("The notify-user-data value is too large "
- "(%d > 63 octets)"),
+ "(%d > 63 octets)."),
attr->values[0].unknown.length);
return;
}
add_job_uuid(cupsd_client_t *con, /* I - Client connection */
cupsd_job_t *job) /* I - Job */
{
- char uuid[1024]; /* job-uuid string */
- _cups_md5_state_t md5state; /* MD5 state */
- unsigned char md5sum[16]; /* MD5 digest/sum */
-
+ char uuid[64]; /* job-uuid string */
- /*
- * First see if the job already has a job-uuid attribute; if so, return...
- */
-
- if (ippFindAttribute(job->attrs, "job-uuid", IPP_TAG_URI))
- return;
/*
- * No job-uuid attribute, so build a version 3 UUID with the local job
- * ID at the end; see RFC 4122 for details. Start with the MD5 sum of
- * the ServerName, server name and port that the client connected to,
- * and local job ID...
+ * Add a job-uuid attribute if none exists...
*/
- snprintf(uuid, sizeof(uuid), "%s:%s:%d:%d", ServerName, con->servername,
- con->serverport, job->id);
-
- _cupsMD5Init(&md5state);
- _cupsMD5Append(&md5state, (unsigned char *)uuid, strlen(uuid));
- _cupsMD5Finish(&md5state, md5sum);
-
- /*
- * Format the UUID URI using the MD5 sum and job ID.
- */
-
- snprintf(uuid, sizeof(uuid),
- "urn:uuid:%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-"
- "%02x%02x%02x%02x%02x%02x",
- md5sum[0], md5sum[1], md5sum[2], md5sum[3], md5sum[4], md5sum[5],
- (md5sum[6] & 15) | 0x30, md5sum[7], (md5sum[8] & 0x3f) | 0x40,
- md5sum[9], md5sum[10], md5sum[11], md5sum[12], md5sum[13],
- md5sum[14], md5sum[15]);
-
- ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI, "job-uuid", NULL, uuid);
+ if (!ippFindAttribute(job->attrs, "job-uuid", IPP_TAG_URI))
+ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_URI, "job-uuid", NULL,
+ cupsdMakeUUID(job->dest, job->id, uuid, sizeof(uuid)));
}
*/
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("A class named \"%s\" already exists"),
+ _("A class named \"%s\" already exists."),
resource + 10);
return;
}
if (uri_status < HTTP_URI_OK)
{
- send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri \"%s\""),
+ send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri \"%s\"."),
attr->values[0].string.text);
cupsdLogMessage(CUPSD_LOG_DEBUG,
"add_printer: httpSeparateURI returned %d", uri_status);
*/
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("File device URIs have been disabled! "
+ _("File device URIs have been disabled. "
"To enable, see the FileDevice directive in "
"\"%s/cupsd.conf\"."),
ServerRoot);
* Could not find device in list!
*/
- send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad device-uri scheme \"%s\""),
- scheme);
+ send_ipp_status(con, IPP_NOT_POSSIBLE,
+ _("Bad device-uri scheme \"%s\"."), scheme);
return;
}
}
if (!supported || i >= supported->num_values)
{
- send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad port-monitor \"%s\""),
+ send_ipp_status(con, IPP_NOT_POSSIBLE, _("Bad port-monitor \"%s\"."),
attr->values[0].string.text);
return;
}
printer->name, attr->values[0].boolean, printer->accepting);
printer->accepting = attr->values[0].boolean;
- cupsdAddPrinterHistory(printer);
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, printer, NULL,
"%s accepting jobs.",
if (attr->values[0].integer != IPP_PRINTER_IDLE &&
attr->values[0].integer != IPP_PRINTER_STOPPED)
{
- send_ipp_status(con, IPP_BAD_REQUEST, _("Bad printer-state value %d"),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad printer-state value %d."),
attr->values[0].integer);
return;
}
{
strlcpy(printer->state_message, attr->values[0].string.text,
sizeof(printer->state_message));
- cupsdAddPrinterHistory(printer);
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, printer, NULL, "%s",
printer->state_message);
(int)(sizeof(printer->reasons) / sizeof(printer->reasons[0])))
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Too many printer-state-reasons values (%d > %d)"),
+ _("Too many printer-state-reasons values (%d > %d)."),
attr->num_values,
(int)(sizeof(printer->reasons) /
sizeof(printer->reasons[0])));
if (copy_model(con, attr->values[0].string.text, dstfile))
{
- send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to copy PPD file"));
+ send_ipp_status(con, IPP_INTERNAL_ERROR, _("Unable to copy PPD file."));
return;
}
char cache_name[1024]; /* Cache filename for printer attrs */
- snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp4", CacheDir,
- printer->name);
- unlink(cache_name);
-
- snprintf(cache_name, sizeof(cache_name), "%s/%s.pwg3", CacheDir,
+ snprintf(cache_name, sizeof(cache_name), "%s/%s.data", CacheDir,
printer->name);
unlink(cache_name);
}
else
{
- cupsdAddPrinterHistory(printer);
-
cupsdAddEvent(CUPSD_EVENT_PRINTER_ADDED,
printer, NULL, "New printer \"%s\" added by \"%s\".",
printer->name, get_username(con));
# ifdef HAVE_COLORSYNCREGISTERDEVICE
if (iccfile)
{
- url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+ url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
(const UInt8 *)iccfile,
strlen(iccfile), false);
kCFPreferencesCurrentHost
};
CFDictionaryRef deviceDict; /* Device dictionary */
- CFUUIDRef deviceUUID; /* Device UUID (TODO: use printer-uuid value) */
+ CFStringRef printerUUID; /* Printer UUID */
+ CFUUIDRef deviceUUID; /* Device UUID */
deviceDict = CFDictionaryCreate(kCFAllocatorDefault,
(const void **)deviceDictKeys,
sizeof(deviceDictKeys[0]),
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
- deviceUUID = ColorSyncCreateUUIDFromUInt32(device_id);
- if (deviceDict && deviceUUID &&
- !ColorSyncRegisterDevice(kColorSyncPrinterDeviceClass, deviceUUID,
- deviceDict))
- error = 1001;
+ printerUUID = CFStringCreateWithCString(kCFAllocatorDefault,
+ p->uuid + 9, /* Skip urn:uuid: */
+ kCFStringEncodingUTF8);
+ if (printerUUID)
+ {
+ deviceUUID = CFUUIDCreateFromString(kCFAllocatorDefault, printerUUID);
+ CFRelease(printerUUID);
+
+ if (!deviceDict || !deviceUUID ||
+ !ColorSyncRegisterDevice(kColorSyncPrinterDeviceClass, deviceUUID,
+ deviceDict))
+ error = 1001;
+ }
+ else
+ error = 1001;
if (deviceUUID)
CFRelease(deviceUUID);
# ifdef HAVE_COLORSYNCREGISTERDEVICE
if (ColorSyncUnregisterDevice != NULL)
{
- CFUUIDRef deviceUUID; /* Printer UUID */
+ /*
+ * Because we may have registered the printer profiles using a prior device
+ * ID-based UUID, remove both the old style UUID and current UUID for the
+ * printer.
+ */
- deviceUUID = ColorSyncCreateUUIDFromUInt32(_ppdHashName(p->name));
- /* TODO: Use printer-uuid value */
+ CFStringRef printerUUID; /* Printer UUID */
+ CFUUIDRef deviceUUID; /* Device UUID */
+ deviceUUID = ColorSyncCreateUUIDFromUInt32(_ppdHashName(p->name));
if (deviceUUID)
{
ColorSyncUnregisterDevice(kColorSyncPrinterDeviceClass, deviceUUID);
CFRelease(deviceUUID);
}
+
+ printerUUID = CFStringCreateWithCString(kCFAllocatorDefault, p->uuid + 9,
+ kCFStringEncodingUTF8);
+ if (printerUUID)
+ {
+ deviceUUID = CFUUIDCreateFromString(kCFAllocatorDefault, printerUUID);
+ if (deviceUUID)
+ {
+ ColorSyncUnregisterDevice(kColorSyncPrinterDeviceClass, deviceUUID);
+ CFRelease(deviceUUID);
+ }
+
+ CFRelease(printerUUID);
+ }
}
# else
}
#endif /* __APPLE__ */
+
/*
* 'apply_printer_defaults()' - Apply printer default options to a job.
*/
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND,
- _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
*/
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Job #%d is not held for authentication"),
+ _("Job #%d is not held for authentication."),
jobid);
return;
}
send_http_error(con, HTTP_UNAUTHORIZED, printer);
else
send_ipp_status(con, IPP_NOT_AUTHORIZED,
- _("No authentication information provided"));
+ _("No authentication information provided."));
return;
}
cupsdReleaseJob(job);
+ cupsdAddEvent(CUPSD_EVENT_JOB_STATE, NULL, job, "Job authenticated by user");
+
cupsdLogJob(job, CUPSD_LOG_INFO, "Authenticated by \"%s\".", con->username);
+
+ cupsdCheckJobs();
}
else
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Missing requesting-user-name attribute"));
+ _("Missing requesting-user-name attribute."));
return;
}
}
else
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Missing requesting-user-name attribute"));
+ _("Missing requesting-user-name attribute."));
return;
}
if (strcmp(uri->name, "printer-uri"))
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("The printer-uri attribute is required"));
+ _("The printer-uri attribute is required."));
return;
}
(!strncmp(resource, "/classes/", 9) && resource[9]))
{
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
if (i < job_ids->num_values)
{
- send_ipp_status(con, IPP_NOT_FOUND, _("job-id %d not found."),
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."),
job_ids->values[i].integer);
return;
}
if (i < job_ids->num_values)
{
- send_ipp_status(con, IPP_NOT_FOUND, _("job-id %d not found."),
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."),
job_ids->values[i].integer);
return;
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
jobid = job->id;
else
{
- send_ipp_status(con, IPP_NOT_POSSIBLE, _("No active jobs on %s"),
+ send_ipp_status(con, IPP_NOT_POSSIBLE, _("No active jobs on %s."),
printer->name);
return;
}
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("notify-subscription-id %d no good"), sub_id);
+ _("Subscription #%d does not exist."), sub_id);
return;
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"),
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."),
attr->values[0].integer);
return;
}
fromattr->group_tag != IPP_TAG_ZERO) || !fromattr->name)
continue;
- if (exclude &&
+ if (exclude &&
(cupsArrayFind(exclude, fromattr->name) ||
cupsArrayFind(exclude, "all")))
{
/* Printer icons */
time_t curtime; /* Current time */
int i; /* Looping var */
- ipp_attribute_t *history; /* History collection */
/*
ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
"printer-state-change-time", printer->state_time);
- if (MaxPrinterHistory > 0 && printer->num_history > 0 &&
- cupsArrayFind(ra, "printer-state-history"))
- {
- /*
- * Printer history is only sent if specifically requested, so that
- * older CUPS/IPP clients won't barf on the collection attributes.
- */
-
- history = ippAddCollections(con->response, IPP_TAG_PRINTER,
- "printer-state-history",
- printer->num_history, NULL);
-
- for (i = 0; i < printer->num_history; i ++)
- copy_attrs(history->values[i].collection = ippNew(), printer->history[i],
- NULL, IPP_TAG_ZERO, 0, NULL);
- }
-
if (!ra || cupsArrayFind(ra, "printer-state-message"))
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_TEXT,
"printer-state-message", NULL, printer->state_message);
{
int type; /* printer-type value */
-
/*
* Add the CUPS-specific printer-type attribute...
*/
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
if (!attr)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("No subscription attributes in request"));
+ _("No subscription attributes in request."));
return;
}
resource, sizeof(resource)) < HTTP_URI_OK)
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Bad notify-recipient-uri URI \"%s\""), recipient);
+ _("Bad notify-recipient-uri \"%s\"."), recipient);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_URI_SCHEME);
return;
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
_("notify-recipient-uri URI \"%s\" uses unknown "
- "scheme"), recipient);
+ "scheme."), recipient);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_URI_SCHEME);
return;
if (!strcmp(scheme, "rss") && !check_rss_recipient(recipient))
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("notify-recipient-uri URI \"%s\" is already used"),
+ _("notify-recipient-uri URI \"%s\" is already used."),
recipient);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_ATTRIBUTES);
if (strcmp(pullmethod, "ippget"))
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Bad notify-pull-method \"%s\""), pullmethod);
+ _("Bad notify-pull-method \"%s\"."), pullmethod);
ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_ENUM,
"notify-status-code", IPP_ATTRIBUTES);
return;
strcmp(attr->values[0].string.text, "utf-8"))
{
send_ipp_status(con, IPP_CHARSET,
- _("Character set \"%s\" not supported"),
+ _("Character set \"%s\" not supported."),
attr->values[0].string.text);
return;
}
strcmp(attr->values[0].string.text, DefaultLanguage)))
{
send_ipp_status(con, IPP_CHARSET,
- _("Language \"%s\" not supported"),
+ _("Language \"%s\" not supported."),
attr->values[0].string.text);
return;
}
{
send_ipp_status(con, IPP_REQUEST_VALUE,
_("The notify-user-data value is too large "
- "(%d > 63 octets)"),
+ "(%d > 63 octets)."),
attr->values[0].unknown.length);
return;
}
else
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("notify-events not specified"));
+ _("notify-events not specified."));
return;
}
}
{
if ((job = cupsdFindJob(jobid)) == NULL)
{
- send_ipp_status(con, IPP_NOT_FOUND, _("Job %d not found"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."),
+ jobid);
return;
}
}
}
if (job)
- cupsdLogMessage(CUPSD_LOG_DEBUG, "Added subscription %d for job %d",
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Added subscription #%d for job %d.",
sub->id, job->id);
else if (printer)
cupsdLogMessage(CUPSD_LOG_DEBUG,
- "Added subscription %d for printer \"%s\"",
+ "Added subscription #%d for printer \"%s\".",
sub->id, printer->name);
else
- cupsdLogMessage(CUPSD_LOG_DEBUG, "Added subscription %d for server",
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "Added subscription #%d for server.",
sub->id);
sub->interval = interval;
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
printer->name);
unlink(filename);
- snprintf(filename, sizeof(filename), "%s/%s.ipp4", CacheDir, printer->name);
- unlink(filename);
-
snprintf(filename, sizeof(filename), "%s/%s.png", CacheDir, printer->name);
unlink(filename);
- snprintf(filename, sizeof(filename), "%s/%s.pwg3", CacheDir, printer->name);
+ snprintf(filename, sizeof(filename), "%s/%s.data", CacheDir, printer->name);
unlink(filename);
#ifdef __APPLE__
con->response->request.status.status_code = IPP_OK;
}
else
- send_ipp_status(con, IPP_NOT_FOUND, _("No default printer"));
+ send_ipp_status(con, IPP_NOT_FOUND, _("No default printer."));
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Missing document-number attribute"));
+ _("Missing document-number attribute."));
return;
}
if ((docnum = attr->values[0].integer) < 1 || docnum > job->num_files ||
attr->num_values > 1)
{
- send_ipp_status(con, IPP_NOT_FOUND, _("Document %d not found in job %d."),
- docnum, jobid);
+ send_ipp_status(con, IPP_NOT_FOUND,
+ _("Document #%d does not exist in job #%d."), docnum,
+ jobid);
return;
}
"Unable to open document %d in job %d - %s", docnum, jobid,
strerror(errno));
send_ipp_status(con, IPP_NOT_FOUND,
- _("Unable to open document %d in job %d"), docnum, jobid);
+ _("Unable to open document #%d in job #%d."), docnum,
+ jobid);
return;
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
if (strcmp(uri->name, "printer-uri"))
{
- send_ipp_status(con, IPP_BAD_REQUEST, _("No printer-uri in request"));
+ send_ipp_status(con, IPP_BAD_REQUEST, _("No printer-uri in request."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
else
if (i < job_ids->num_values)
{
- send_ipp_status(con, IPP_NOT_FOUND, _("job-id %d not found."),
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."),
job_ids->values[i].integer);
return;
}
if (!ids)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Missing notify-subscription-ids attribute"));
+ _("Missing notify-subscription-ids attribute."));
return;
}
* Bad subscription ID...
*/
- send_ipp_status(con, IPP_NOT_FOUND,
- _("notify-subscription-id %d no good"),
+ send_ipp_status(con, IPP_NOT_FOUND, _("Subscription #%d does not exist."),
ids->values[i].integer);
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
* Bad subscription ID...
*/
- send_ipp_status(con, IPP_NOT_FOUND,
- _("notify-subscription-id %d no good"), sub_id);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Subscription #%d does not exist."),
+ sub_id);
return;
}
if (!job)
{
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%s does not exist"),
- resource + 6);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."),
+ atoi(resource + 6));
return;
}
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
else if ((attr = ippFindAttribute(con->request, "notify-job-id",
if (!job)
{
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"),
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."),
attr->values[0].integer);
return;
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
*/
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
printer->holding_new_jobs = 1;
cupsdSetPrinterReasons(printer, "+hold-new-jobs");
- cupsdAddPrinterHistory(printer);
if (dtype & CUPS_PRINTER_CLASS)
cupsdLogMessage(CUPSD_LOG_INFO,
*/
send_ipp_status(con, IPP_BAD_REQUEST,
- _("job-printer-uri attribute missing"));
+ _("job-printer-uri attribute missing."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("Job #%d does not exist"), attr->values[0].integer);
+ _("Job #%d does not exist."), attr->values[0].integer);
return;
}
else
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND,
- _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
else
*/
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Job #%d is finished and cannot be altered"),
+ _("Job #%d is finished and cannot be altered."),
job->id);
return;
}
)
{
send_ipp_status(con, IPP_ATTRIBUTES,
- _("Unsupported compression \"%s\""),
+ _("Unsupported compression \"%s\"."),
attr->values[0].string.text);
ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_KEYWORD,
"compression", NULL, attr->values[0].string.text);
if (!con->filename)
{
- send_ipp_status(con, IPP_BAD_REQUEST, _("No file!?"));
+ send_ipp_status(con, IPP_BAD_REQUEST, _("No file in print request."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
type) != 2)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad document-format \"%s\""),
+ _("Bad document-format \"%s\"."),
format->values[0].string.text);
return;
}
if (sscanf(default_format, "%15[^/]/%31[^;]", super, type) != 2)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad document-format \"%s\""),
+ _("Bad document-format \"%s\"."),
default_format);
return;
}
else if (!filetype)
{
send_ipp_status(con, IPP_DOCUMENT_FORMAT,
- _("Unsupported document-format \"%s\""),
+ _("Unsupported document-format \"%s\"."),
format ? format->values[0].string.text :
"application/octet-stream");
cupsdLogMessage(CUPSD_LOG_INFO,
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
strlcpy(printer->state_message, attr->values[0].string.text,
sizeof(printer->state_message));
- cupsdAddPrinterHistory(printer);
-
cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE, printer, NULL,
"No longer accepting jobs.");
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
printer->holding_new_jobs = 0;
cupsdSetPrinterReasons(printer, "-hold-new-jobs");
- cupsdAddPrinterHistory(printer);
if (dtype & CUPS_PRINTER_CLASS)
cupsdLogMessage(CUPSD_LOG_INFO,
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
* Nope - return a "not possible" error...
*/
- send_ipp_status(con, IPP_NOT_POSSIBLE, _("Job #%d is not held"), jobid);
+ send_ipp_status(con, IPP_NOT_POSSIBLE, _("Job #%d is not held."), jobid);
return;
}
* Bad subscription ID...
*/
- send_ipp_status(con, IPP_NOT_FOUND,
- _("notify-subscription-id %d no good"), sub_id);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Subscription #%d does not exist."),
+ sub_id);
return;
}
*/
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Job subscriptions cannot be renewed"));
+ _("Job subscriptions cannot be renewed."));
return;
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
* Nope - return a "not possible" error...
*/
- send_ipp_status(con, IPP_NOT_POSSIBLE, _("Job #%d is not complete"),
+ send_ipp_status(con, IPP_NOT_POSSIBLE, _("Job #%d is not complete."),
jobid);
return;
}
*/
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Job #%d cannot be restarted - no files"), jobid);
+ _("Job #%d cannot be restarted - no files."), jobid);
return;
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
#endif /* HAVE_LIBZ */
)
{
- send_ipp_status(con, IPP_ATTRIBUTES, _("Unsupported compression \"%s\""),
+ send_ipp_status(con, IPP_ATTRIBUTES, _("Unsupported compression \"%s\"."),
attr->values[0].string.text);
ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_KEYWORD,
"compression", NULL, attr->values[0].string.text);
attr->values[0].boolean)
goto last_document;
- send_ipp_status(con, IPP_BAD_REQUEST, _("No file!?"));
+ send_ipp_status(con, IPP_BAD_REQUEST, _("No file in print request."));
return;
}
if (sscanf(format->values[0].string.text, "%15[^/]/%31[^;]",
super, type) != 2)
{
- send_ipp_status(con, IPP_BAD_REQUEST, _("Bad document-format \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad document-format \"%s\"."),
format->values[0].string.text);
return;
}
if (sscanf(default_format, "%15[^/]/%31[^;]", super, type) != 2)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Could not scan type \"%s\""),
- default_format);
+ _("Bad document-format-default \"%s\"."), default_format);
return;
}
}
else if (!filetype)
{
send_ipp_status(con, IPP_DOCUMENT_FORMAT,
- _("Unsupported format \'%s/%s\'"), super, type);
+ _("Unsupported document-format \"%s/%s\"."), super, type);
cupsdLogMessage(CUPSD_LOG_INFO,
"Hint: Do you have the raw file printing rules enabled?");
filetype->type);
send_ipp_status(con, IPP_DOCUMENT_FORMAT,
- _("Unsupported format \'%s\'"), mimetype);
+ _("Unsupported document-format \"%s\"."), mimetype);
ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE,
"document-format", NULL, mimetype);
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
IPP_TAG_INTEGER)) == NULL)
{
send_ipp_status(con, IPP_BAD_REQUEST,
- _("Got a printer-uri attribute but no job-id"));
+ _("Got a printer-uri attribute but no job-id."));
return;
}
* Not a valid URI!
*/
- send_ipp_status(con, IPP_BAD_REQUEST,
- _("Bad job-uri attribute \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad job-uri \"%s\"."),
uri->values[0].string.text);
return;
}
* Nope - return a "not found" error...
*/
- send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist"), jobid);
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist."), jobid);
return;
}
*/
send_ipp_status(con, IPP_NOT_POSSIBLE,
- _("Job #%d is finished and cannot be altered"), jobid);
+ _("Job #%d is finished and cannot be altered."), jobid);
return;
}
if (attr->value_tag != IPP_TAG_INTEGER)
{
- send_ipp_status(con, IPP_REQUEST_VALUE, _("Bad job-priority value"));
+ send_ipp_status(con, IPP_REQUEST_VALUE, _("Bad job-priority value."));
if ((attr2 = copy_attribute(con->response, attr, 0)) != NULL)
attr2->group_tag = IPP_TAG_UNSUPPORTED_GROUP;
if (attr->value_tag != IPP_TAG_ENUM)
{
- send_ipp_status(con, IPP_REQUEST_VALUE, _("Bad job-state value"));
+ send_ipp_status(con, IPP_REQUEST_VALUE, _("Bad job-state value."));
if ((attr2 = copy_attribute(con->response, attr, 0)) != NULL)
attr2->group_tag = IPP_TAG_UNSUPPORTED_GROUP;
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}
)
{
send_ipp_status(con, IPP_ATTRIBUTES,
- _("Unsupported compression \"%s\""),
+ _("Unsupported compression \"%s\"."),
attr->values[0].string.text);
ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_KEYWORD,
"compression", NULL, attr->values[0].string.text);
if (sscanf(format->values[0].string.text, "%15[^/]/%31[^;]",
super, type) != 2)
{
- send_ipp_status(con, IPP_BAD_REQUEST, _("Bad document-format \"%s\""),
+ send_ipp_status(con, IPP_BAD_REQUEST, _("Bad document-format \"%s\"."),
format->values[0].string.text);
return;
}
cupsdLogMessage(CUPSD_LOG_INFO,
"Hint: Do you have the raw file printing rules enabled?");
send_ipp_status(con, IPP_DOCUMENT_FORMAT,
- _("Unsupported document-format \"%s\""),
+ _("Unsupported document-format \"%s\"."),
format->values[0].string.text);
ippAddString(con->response, IPP_TAG_UNSUPPORTED_GROUP, IPP_TAG_MIMETYPE,
"document-format", NULL, format->values[0].string.text);
*/
send_ipp_status(con, IPP_NOT_FOUND,
- _("The printer or class was not found."));
+ _("The printer or class does not exist."));
return;
}