#ifdef HAVE_DNSSD
const char *subtype = "_print"; /* Bonjour service subtype */
#endif /* HAVE_DNSSD */
- int port = 8631, /* Port number (0 = auto) TODO: FIX */
+ int port = 8631, /* Port number (0 = auto) */
duplex = 0, /* Duplex mode */
ppm = 10, /* Pages per minute for mono */
ppm_color = 0, /* Pages per minute for color */
{
case IPP_JSTATE_PENDING :
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
NULL, "none");
break;
case IPP_JSTATE_HELD :
if (job->fd >= 0)
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
- NULL, "job-incoming");
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+ "job-state-reasons", NULL, "job-incoming");
else if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_ZERO))
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
- NULL, "job-hold-until-specified");
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+ "job-state-reasons", NULL, "job-hold-until-specified");
else
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
- NULL, "job-data-insufficient");
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+ "job-state-reasons", NULL, "job-data-insufficient");
break;
case IPP_JSTATE_PROCESSING :
if (job->cancel)
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
- NULL, "processing-to-stop-point");
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+ "job-state-reasons", NULL, "processing-to-stop-point");
else
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
- NULL, "job-printing");
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+ "job-state-reasons", NULL, "job-printing");
break;
case IPP_JSTATE_STOPPED :
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
NULL, "job-stopped");
break;
case IPP_JSTATE_CANCELED :
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
NULL, "job-canceled-by-user");
break;
case IPP_JSTATE_ABORTED :
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
NULL, "aborted-by-system");
break;
case IPP_JSTATE_COMPLETED :
ippAddString(client->response, IPP_TAG_JOB,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "job-state-reasons",
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST, "job-state-reasons",
NULL, "job-completed-successfully");
break;
}
IPP_TAG_NAME)) != NULL)
ippSetName(job->attrs, &attr, "job-originating-user-name");
else
- attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME | IPP_TAG_CUPS_COPY,
+ attr = ippAddString(job->attrs, IPP_TAG_JOB,
+ IPP_TAG_NAME | IPP_TAG_CUPS_CONST,
"job-originating-user-name", NULL, "anonymous");
if (attr)
printer->attrs = ippNew();
/* charset-configured */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_CHARSET | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_CHARSET | IPP_TAG_CUPS_CONST,
"charset-configured", NULL, "utf-8");
/* charset-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_CHARSET | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_CHARSET | IPP_TAG_CUPS_CONST,
"charset-supported", sizeof(charsets) / sizeof(charsets[0]),
NULL, charsets);
ppm_color > 0);
/* compression-supported */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"compression-supported", NULL, "none");
/* copies-default */
"finishings-supported", IPP_FINISHINGS_NONE);
/* generated-natural-language-supported */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_LANGUAGE | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_LANGUAGE | IPP_TAG_CUPS_CONST,
"generated-natural-language-supported", NULL, "en");
/* ipp-versions-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"ipp-versions-supported",
sizeof(versions) / sizeof(versions[0]), NULL, versions);
"job-accounting-user-id-supported", 1);
/* job-creation-attributes-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"job-creation-attributes-supported",
sizeof(job_creation) / sizeof(job_creation[0]),
NULL, job_creation);
"job-priority-supported", 100);
/* job-sheets-default */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_NAME | IPP_TAG_CUPS_CONST,
"job-sheets-default", NULL, "none");
/* job-sheets-supported */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_NAME | IPP_TAG_CUPS_CONST,
"job-sheets-supported", NULL, "none");
/* media-bottom-margin-supported */
ippDelete(media_col_default);
/* media-col-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"media-col-supported",
(int)(sizeof(media_col_supported) /
sizeof(media_col_supported[0])), NULL,
media_col_supported);
/* media-default */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"media-default", NULL, media_supported[0]);
/* media-left-margin-supported */
media_xxx_margin_supported);
/* media-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"media-supported",
(int)(sizeof(media_supported) / sizeof(media_supported[0])),
NULL, media_supported);
media_xxx_margin_supported);
/* media-type-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"media-type-supported",
(int)(sizeof(media_type_supported) /
sizeof(media_type_supported[0])),
NULL, media_type_supported);
/* multiple-document-handling-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"multiple-document-handling-supported",
sizeof(multiple_document_handling) /
sizeof(multiple_document_handling[0]), NULL,
"multiple-document-jobs-supported", 0);
/* natural-language-configured */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_LANGUAGE | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_LANGUAGE | IPP_TAG_CUPS_CONST,
"natural-language-configured", NULL, "en");
/* number-up-default */
"orientation-requested-supported", 4, orients);
/* output-bin-default */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"output-bin-default", NULL, "face-down");
/* output-bin-supported */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"output-bin-supported", NULL, "face-down");
/* pages-per-minute */
"pages-per-minute-color", ppm_color);
/* pdl-override-supported */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"pdl-override-supported", NULL, "attempted");
/* print-quality-default */
/* reference-uri-scheme-supported */
ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
- IPP_TAG_URISCHEME | IPP_TAG_CUPS_COPY,
+ IPP_TAG_URISCHEME | IPP_TAG_CUPS_CONST,
"reference-uri-schemes-supported",
(int)(sizeof(reference_uri_schemes_supported) /
sizeof(reference_uri_schemes_supported[0])),
NULL, reference_uri_schemes_supported);
/* sides-default */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"sides-default", NULL, "one-sided");
/* sides-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"sides-supported", duplex ? 3 : 1, NULL, sides_supported);
/* uri-authentication-supported */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"uri-authentication-supported", NULL, "none");
/* uri-security-supported */
- ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddString(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"uri-security-supported", NULL, "none");
/* which-jobs-supported */
- ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY,
+ ippAddStrings(printer->attrs, IPP_TAG_PRINTER,
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
"which-jobs-supported",
sizeof(which_jobs) / sizeof(which_jobs[0]), NULL, which_jobs);
if ((job = create_job(client)) == NULL)
{
- respond_ipp(client, IPP_STATUS_ERROR_BUSY, "Currently printing another job.");
+ respond_ipp(client, IPP_STATUS_ERROR_BUSY,
+ "Currently printing another job.");
return;
}
(job_comparison == 0 && job->state != job_state) ||
(job_comparison > 0 && job->state < job_state) ||
job->id < first_job_id ||
- (username && job->username && _cups_strcasecmp(username, job->username)))
+ (username && job->username &&
+ _cups_strcasecmp(username, job->username)))
continue;
if (count > 0)
_cupsRWLockRead(&(printer->rwlock));
copy_attributes(client->response, printer->attrs, ra, IPP_TAG_ZERO,
- IPP_TAG_CUPS_COPY);
+ IPP_TAG_CUPS_CONST);
if (!ra || cupsArrayFind(ra, "printer-state"))
ippAddInteger(client->response, IPP_TAG_PRINTER, IPP_TAG_ENUM,
{
if (printer->state_reasons == _IPP_PSTATE_NONE)
ippAddString(client->response, IPP_TAG_PRINTER,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "printer-state-reasons",
- NULL, "none");
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+ "printer-state-reasons", NULL, "none");
else
{
int num_reasons = 0;/* Number of reasons */
reasons[num_reasons ++] = "toner-low-report";
ippAddStrings(client->response, IPP_TAG_PRINTER,
- IPP_TAG_KEYWORD | IPP_TAG_CUPS_COPY, "printer-state-reasons",
- num_reasons, NULL, reasons);
+ IPP_TAG_KEYWORD | IPP_TAG_CUPS_CONST,
+ "printer-state-reasons", num_reasons, NULL, reasons);
}
}
if ((job = create_job(client)) == NULL)
{
- respond_ipp(client, IPP_STATUS_ERROR_BUSY, "Currently printing another job.");
+ respond_ipp(client, IPP_STATUS_ERROR_BUSY,
+ "Currently printing another job.");
return;
}
unlink(filename);
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to read print file.");
+ respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+ "Unable to read print file.");
return;
}
unlink(filename);
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to write print file: %s",
- strerror(error));
+ respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+ "Unable to write print file: %s", strerror(error));
return;
}
if (ippGetCount(uri) != 1)
{
- respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Too many document-uri values.");
+ respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST,
+ "Too many document-uri values.");
return;
}
#endif /* HAVE_SSL */
strcmp(scheme, "http"))
{
- respond_ipp(client, IPP_STATUS_ERROR_URI_SCHEME, "URI scheme \"%s\" not supported.",
- scheme);
+ respond_ipp(client, IPP_STATUS_ERROR_URI_SCHEME,
+ "URI scheme \"%s\" not supported.", scheme);
return;
}
if (!strcmp(scheme, "file") && access(resource, R_OK))
{
- respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to access URI: %s",
- strerror(errno));
+ respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+ "Unable to access URI: %s", strerror(errno));
return;
}
if ((job = create_job(client)) == NULL)
{
- respond_ipp(client, IPP_STATUS_ERROR_BUSY, "Currently printing another job.");
+ respond_ipp(client, IPP_STATUS_ERROR_BUSY,
+ "Currently printing another job.");
return;
}
{
if ((infile = open(resource, O_RDONLY)) < 0)
{
- respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to access URI: %s",
- strerror(errno));
+ respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+ "Unable to access URI: %s", strerror(errno));
return;
}
#endif /* HAVE_SSL */
encryption = HTTP_ENCRYPTION_IF_REQUESTED;
- if ((http = httpConnectEncrypt(hostname, port, encryption)) == NULL)
+ if ((http = httpConnect2(hostname, port, NULL, AF_UNSPEC, encryption,
+ 1, 30000, NULL)) == NULL)
{
respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
"Unable to connect to %s: %s", hostname,
httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en");
if (httpGet(http, resource))
{
- respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to GET URI: %s",
- strerror(errno));
+ respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+ "Unable to GET URI: %s", strerror(errno));
job->state = IPP_JSTATE_ABORTED;
if (status != HTTP_STATUS_OK)
{
- respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to GET URI: %s",
- httpStatus(status));
+ respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+ "Unable to GET URI: %s", httpStatus(status));
job->state = IPP_JSTATE_ABORTED;
unlink(filename);
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to write print file: %s",
- strerror(error));
+ respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+ "Unable to write print file: %s", strerror(error));
return;
}
if (job->state > IPP_JSTATE_HELD)
{
- respond_ipp(client, IPP_STATUS_ERROR_NOT_POSSIBLE, "Job is not in a pending state.");
+ respond_ipp(client, IPP_STATUS_ERROR_NOT_POSSIBLE,
+ "Job is not in a pending state.");
httpFlush(client->http);
return;
}
unlink(filename);
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to read print file.");
+ respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+ "Unable to read print file.");
return;
}
unlink(filename);
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to write print file: %s",
- strerror(error));
+ respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+ "Unable to write print file: %s", strerror(error));
return;
}
if (job->state > IPP_JSTATE_HELD)
{
- respond_ipp(client, IPP_STATUS_ERROR_NOT_POSSIBLE, "Job is not in a pending state.");
+ respond_ipp(client, IPP_STATUS_ERROR_NOT_POSSIBLE,
+ "Job is not in a pending state.");
httpFlush(client->http);
return;
}
if (ippGetCount(uri) != 1)
{
- respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Too many document-uri values.");
+ respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST,
+ "Too many document-uri values.");
return;
}
#endif /* HAVE_SSL */
strcmp(scheme, "http"))
{
- respond_ipp(client, IPP_STATUS_ERROR_URI_SCHEME, "URI scheme \"%s\" not supported.",
- scheme);
+ respond_ipp(client, IPP_STATUS_ERROR_URI_SCHEME,
+ "URI scheme \"%s\" not supported.", scheme);
return;
}
if (!strcmp(scheme, "file") && access(resource, R_OK))
{
- respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to access URI: %s",
- strerror(errno));
+ respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+ "Unable to access URI: %s", strerror(errno));
return;
}
{
if ((infile = open(resource, O_RDONLY)) < 0)
{
- respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to access URI: %s",
- strerror(errno));
+ respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+ "Unable to access URI: %s", strerror(errno));
return;
}
#endif /* HAVE_SSL */
encryption = HTTP_ENCRYPTION_IF_REQUESTED;
- if ((http = httpConnectEncrypt(hostname, port, encryption)) == NULL)
+ if ((http = httpConnect2(hostname, port, NULL, AF_UNSPEC, encryption,
+ 1, 30000, NULL)) == NULL)
{
respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
"Unable to connect to %s: %s", hostname,
httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en");
if (httpGet(http, resource))
{
- respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to GET URI: %s",
- strerror(errno));
+ respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+ "Unable to GET URI: %s", strerror(errno));
job->state = IPP_JSTATE_ABORTED;
if (status != HTTP_STATUS_OK)
{
- respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS, "Unable to GET URI: %s",
- httpStatus(status));
+ respond_ipp(client, IPP_STATUS_ERROR_DOCUMENT_ACCESS,
+ "Unable to GET URI: %s", httpStatus(status));
job->state = IPP_JSTATE_ABORTED;
unlink(filename);
- respond_ipp(client, IPP_STATUS_ERROR_INTERNAL, "Unable to write print file: %s",
- strerror(error));
+ respond_ipp(client, IPP_STATUS_ERROR_INTERNAL,
+ "Unable to write print file: %s", strerror(error));
return;
}
if (!stat(client->printer->icon, &fileinfo) &&
(fd = open(client->printer->icon, O_RDONLY)) >= 0)
{
- if (!respond_http(client, HTTP_STATUS_OK, "image/png", fileinfo.st_size))
+ if (!respond_http(client, HTTP_STATUS_OK, "image/png",
+ fileinfo.st_size))
{
close(fd);
return (0);
respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Bad request-id %d.",
ippGetRequestId(client->request));
else if (!ippFirstAttribute(client->request))
- respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "No attributes in request.");
+ respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST,
+ "No attributes in request.");
else
{
/*
* for all operations.
*/
- respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Missing required attributes.");
+ respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST,
+ "Missing required attributes.");
}
else if (strcmp(ippGetString(uri, 0, NULL), client->printer->uri) &&
strncmp(ippGetString(uri, 0, NULL), client->printer->uri,
client->printer->urilen))
{
- respond_ipp(client, IPP_STATUS_ERROR_NOT_FOUND, "%s %s not found.", ippGetName(uri),
- ippGetString(uri, 0, NULL));
+ respond_ipp(client, IPP_STATUS_ERROR_NOT_FOUND, "%s %s not found.",
+ ippGetName(uri), ippGetString(uri, 0, NULL));
}
else
{
httpClearFields(client->http);
- if (code == HTTP_STATUS_METHOD_NOT_ALLOWED || client->operation == HTTP_STATE_OPTIONS)
+ if (code == HTTP_STATUS_METHOD_NOT_ALLOWED ||
+ client->operation == HTTP_STATE_OPTIONS)
httpSetField(client->http, HTTP_FIELD_ALLOW, "GET, HEAD, OPTIONS, POST");
if (type)
ipp_attribute_t *temp; /* Copy of attribute */
- respond_ipp(client, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, "Unsupported %s %s%s value.",
- ippGetName(attr), ippGetCount(attr) > 1 ? "1setOf " : "",
+ respond_ipp(client, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES,
+ "Unsupported %s %s%s value.", ippGetName(attr),
+ ippGetCount(attr) > 1 ? "1setOf " : "",
ippTagString(ippGetValueTag(attr)));
temp = ippCopyAttribute(client->response, attr, 0);
{
if (!status)
{
- puts(CUPS_SVERSION " - Copyright 2010-2012 by Apple Inc. All rights reserved.");
+ puts(CUPS_SVERSION " - Copyright 2010-2012 by Apple Inc. All rights "
+ "reserved.");
puts("");
}