/*
- * "$Id: ipp.c 10102 2011-11-02 23:52:39Z mike $"
+ * "$Id$"
*
* Internet Printing Protocol functions for CUPS.
*
- * Copyright 2007-2012 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* ippGetGroupTag() - Get the group associated with an attribute.
* ippGetInteger() - Get the integer/enum value for an attribute.
* ippGetName() - Get the attribute name.
+ * ippGetOctetString() - Get an octetString value from an IPP attribute.
* ippGetOperation() - Get the operation ID in an IPP message.
* ippGetRange() - Get a rangeOfInteger value from an attribute.
* ippGetRequestId() - Get the request ID from an IPP message.
* ippSetGroupTag() - Set the group tag of an attribute.
* ippSetInteger() - Set an integer or enum value in an attribute.
* ippSetName() - Set the name of an attribute.
+ * ippSetOctetString() - Set an octetString value in an IPP attribute.
* ippSetOperation() - Set the operation ID in an IPP request message.
* ippSetRange() - Set a rangeOfInteger value in an attribute.
* ippSetRequestId() - Set the request ID in an IPP message.
"name=\"%s\", value=%d)", ipp, group, ippTagString(group),
value_tag, ippTagString(value_tag), name, value));
- value_tag &= IPP_TAG_MASK;
+ value_tag &= IPP_TAG_CUPS_MASK;
/*
* Special-case for legacy usage: map out-of-band attributes to new ippAddOutOfBand
group, ippTagString(group), value_tag, ippTagString(value_tag), name,
num_values, values));
- value_tag &= IPP_TAG_MASK;
+ value_tag &= IPP_TAG_CUPS_MASK;
/*
* Range check input...
"name=\"%s\")", ipp, group, ippTagString(group), value_tag,
ippTagString(value_tag), name));
- value_tag &= IPP_TAG_MASK;
+ value_tag &= IPP_TAG_CUPS_MASK;
/*
* Range check input...
* Range check input...
*/
- temp_tag = (ipp_tag_t)((int)value_tag & IPP_TAG_MASK);
+ temp_tag = (ipp_tag_t)((int)value_tag & IPP_TAG_CUPS_MASK);
#if 0
if (!ipp || !name || group < IPP_TAG_ZERO ||
* See if we need to map charset, language, or locale values...
*/
- if (language && ((int)value_tag & IPP_TAG_COPY) &&
+ if (language && ((int)value_tag & IPP_TAG_CUPS_CONST) &&
strcmp(language, ipp_lang_code(language, code, sizeof(code))))
value_tag = temp_tag; /* Don't do a fast copy */
- else if (value && value_tag == (ipp_tag_t)(IPP_TAG_CHARSET | IPP_TAG_COPY) &&
+ else if (value && value_tag == (ipp_tag_t)(IPP_TAG_CHARSET | IPP_TAG_CUPS_CONST) &&
strcmp(value, ipp_get_code(value, code, sizeof(code))))
value_tag = temp_tag; /* Don't do a fast copy */
- else if (value && value_tag == (ipp_tag_t)(IPP_TAG_LANGUAGE | IPP_TAG_COPY) &&
+ else if (value && value_tag == (ipp_tag_t)(IPP_TAG_LANGUAGE | IPP_TAG_CUPS_CONST) &&
strcmp(value, ipp_lang_code(value, code, sizeof(code))))
value_tag = temp_tag; /* Don't do a fast copy */
* Initialize the attribute data...
*/
- if ((int)value_tag & IPP_TAG_COPY)
+ if ((int)value_tag & IPP_TAG_CUPS_CONST)
{
attr->values[0].string.language = (char *)language;
attr->values[0].string.text = (char *)value;
* needed. The formatted string is truncated as needed to the maximum length of
* the corresponding value type.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
ipp_attribute_t * /* O - New attribute */
* stdarg pointer @code ap@. The formatted string is truncated as needed to the
* maximum length of the corresponding value type.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
ipp_attribute_t * /* O - New attribute */
group == IPP_TAG_END || group >= IPP_TAG_UNSUPPORTED_VALUE ||
(value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG &&
value_tag != IPP_TAG_NAMELANG) || value_tag > IPP_TAG_MIMETYPE ||
- !format || !ap)
+ !format)
return (NULL);
if ((value_tag == IPP_TAG_TEXTLANG || value_tag == IPP_TAG_NAMELANG)
* Range check input...
*/
- temp_tag = (ipp_tag_t)((int)value_tag & IPP_TAG_MASK);
+ temp_tag = (ipp_tag_t)((int)value_tag & IPP_TAG_CUPS_MASK);
#if 0
if (!ipp || !name || group < IPP_TAG_ZERO ||
* See if we need to map charset, language, or locale values...
*/
- if (language && ((int)value_tag & IPP_TAG_COPY) &&
+ if (language && ((int)value_tag & IPP_TAG_CUPS_CONST) &&
strcmp(language, ipp_lang_code(language, code, sizeof(code))))
value_tag = temp_tag; /* Don't do a fast copy */
- else if (values && value_tag == (ipp_tag_t)(IPP_TAG_CHARSET | IPP_TAG_COPY))
+ else if (values && value_tag == (ipp_tag_t)(IPP_TAG_CHARSET | IPP_TAG_CUPS_CONST))
{
for (i = 0; i < num_values; i ++)
if (strcmp(values[i], ipp_get_code(values[i], code, sizeof(code))))
break;
}
}
- else if (values && value_tag == (ipp_tag_t)(IPP_TAG_LANGUAGE | IPP_TAG_COPY))
+ else if (values && value_tag == (ipp_tag_t)(IPP_TAG_LANGUAGE | IPP_TAG_CUPS_CONST))
{
for (i = 0; i < num_values; i ++)
if (strcmp(values[i], ipp_lang_code(values[i], code, sizeof(code))))
{
if (value == attr->values)
{
- if ((int)value_tag & IPP_TAG_COPY)
+ if ((int)value_tag & IPP_TAG_CUPS_CONST)
value->string.language = (char *)language;
else
value->string.language = _cupsStrAlloc(ipp_lang_code(language, code,
if (values)
{
- if ((int)value_tag & IPP_TAG_COPY)
+ if ((int)value_tag & IPP_TAG_CUPS_CONST)
value->string.text = (char *)*values++;
else if (value_tag == IPP_TAG_CHARSET)
value->string.text = _cupsStrAlloc(ipp_get_code(*values++, code, sizeof(code)));
* enum value, or the value falls within one of the rangeOfInteger values for
* the attribute.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
int /* O - 1 on a match, 0 on no match */
* Returns non-zero when the attribute contains a matching charset, keyword,
* language, mimeMediaType, name, text, URI, or URI scheme value.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
int /* O - 1 on a match, 0 on no match */
* Copy it...
*/
- quickcopy = quickcopy ? IPP_TAG_COPY : 0;
+ quickcopy = quickcopy ? IPP_TAG_CUPS_CONST : 0;
- switch (srcattr->value_tag & ~IPP_TAG_COPY)
+ switch (srcattr->value_tag & ~IPP_TAG_CUPS_CONST)
{
case IPP_TAG_ZERO :
dstattr = ippAddSeparator(dst);
i --, srcval ++, dstval ++)
dstval->string.text = srcval->string.text;
}
- else if (srcattr->value_tag & IPP_TAG_COPY)
+ else if (srcattr->value_tag & IPP_TAG_CUPS_CONST)
{
for (i = srcattr->num_values, srcval = srcattr->values,
dstval = dstattr->values;
dstval->string.text = srcval->string.text;
}
}
- else if (srcattr->value_tag & IPP_TAG_COPY)
+ else if (srcattr->value_tag & IPP_TAG_CUPS_CONST)
{
for (i = srcattr->num_values, srcval = srcattr->values,
dstval = dstattr->values;
DEBUG_printf(("4ippFindAttribute: attr=%p, name=\"%s\"", attr,
attr->name));
- value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_MASK);
+ value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_CUPS_MASK);
if (attr->name != NULL && _cups_strcasecmp(attr->name, name) == 0 &&
(value_tag == type || type == IPP_TAG_ZERO ||
}
+/*
+ * 'ippGetOctetString()' - Get an octetString value from an IPP attribute.
+ *
+ * The @code element@ parameter specifies which value to get from 0 to
+ * @link ippGetCount(attr)@ - 1.
+ *
+ * @since CUPS 1.7/OS X 10.9@
+ */
+
+void * /* O - Pointer to octetString data */
+ippGetOctetString(
+ ipp_attribute_t *attr, /* I - IPP attribute */
+ int element, /* I - Value number (0-based) */
+ int *datalen) /* O - Length of octetString data */
+{
+ /*
+ * Range check input...
+ */
+
+ if (!attr || attr->value_tag != IPP_TAG_STRING ||
+ element < 0 || element >= attr->num_values)
+ {
+ if (datalen)
+ *datalen = 0;
+
+ return (NULL);
+ }
+
+ /*
+ * Return the values...
+ */
+
+ if (datalen)
+ *datalen = attr->values[element].unknown.length;
+
+ return (attr->values[element].unknown.data);
+}
+
+
/*
* 'ippGetOperation()' - Get the operation ID in an IPP message.
*
*/
if (!ipp)
- return (IPP_IDLE);
+ return (IPP_STATE_IDLE);
/*
* Return the value...
*/
if (!ipp)
- return (IPP_INTERNAL_ERROR);
+ return (IPP_STATUS_ERROR_INTERNAL);
/*
* Return the value...
* Return the value...
*/
- return (attr->value_tag & IPP_TAG_MASK);
+ return (attr->value_tag & IPP_TAG_CUPS_MASK);
}
ipp_t * /* O - New IPP message */
ippNew(void)
{
- ipp_t *temp; /* New IPP message */
+ ipp_t *temp; /* New IPP message */
+ _cups_globals_t *cg = _cupsGlobals();
+ /* Global data */
DEBUG_puts("ippNew()");
if ((temp = (ipp_t *)calloc(1, sizeof(ipp_t))) != NULL)
{
/*
- * Default to IPP 2.0...
+ * Set default version - usually 2.0...
*/
- temp->request.any.version[0] = 2;
- temp->request.any.version[1] = 0;
+ if (cg->server_version == 0)
+ _cupsSetDefaults();
+
+ temp->request.any.version[0] = cg->server_version / 10;
+ temp->request.any.version[1] = cg->server_version % 10;
temp->use = 1;
}
* "utf-8" and a value derived from the current locale are substituted,
* respectively.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
ipp_t * /* O - IPP response message */
http, ipp, CUPS_LLCAST (http ? http->data_remaining : -1)));
if (!http)
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
DEBUG_printf(("2ippRead: http->state=%d, http->used=%d", http->state,
http->used));
DEBUG_printf(("ippReadIO(src=%p, cb=%p, blocking=%d, parent=%p, ipp=%p)",
src, cb, blocking, parent, ipp));
- DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp ? ipp->state : IPP_ERROR));
+ DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp ? ipp->state : IPP_STATE_ERROR));
if (!src || !ipp)
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
if ((buffer = (unsigned char *)_cupsBufferGet(IPP_BUF_SIZE)) == NULL)
{
DEBUG_puts("1ippReadIO: Unable to get read buffer.");
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
switch (ipp->state)
{
- case IPP_IDLE :
+ case IPP_STATE_IDLE :
ipp->state ++; /* Avoid common problem... */
- case IPP_HEADER :
+ case IPP_STATE_HEADER :
if (parent == NULL)
{
/*
{
DEBUG_puts("1ippReadIO: Unable to read header.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
/*
ipp->request.any.request_id));
}
- ipp->state = IPP_ATTRIBUTE;
+ ipp->state = IPP_STATE_ATTRIBUTE;
ipp->current = NULL;
ipp->curtag = IPP_TAG_ZERO;
ipp->prev = ipp->last;
if (!blocking)
break;
- case IPP_ATTRIBUTE :
+ case IPP_STATE_ATTRIBUTE :
for (;;)
{
if ((*cb)(src, buffer, 1) < 1)
{
DEBUG_puts("1ippReadIO: Callback returned EOF/error");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
DEBUG_printf(("2ippReadIO: ipp->current=%p, ipp->prev=%p",
{
DEBUG_puts("1ippReadIO: Callback returned EOF/error");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
tag = (ipp_tag_t)((((((buffer[0] << 8) | buffer[1]) << 8) |
buffer[2]) << 8) | buffer[3]);
- if (tag & IPP_TAG_COPY)
+ if (tag & IPP_TAG_CUPS_CONST)
{
/*
* Fail if the high bit is set in the tag...
*/
- _cupsSetError(IPP_INTERNAL_ERROR, _("IPP extension tag larger than 0x7FFFFFFF."), 1);
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP extension tag larger than 0x7FFFFFFF."), 1);
DEBUG_printf(("1ippReadIO: bad tag 0x%x.", tag));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
}
DEBUG_puts("2ippReadIO: IPP_TAG_END.");
- ipp->state = IPP_DATA;
+ ipp->state = IPP_STATE_DATA;
break;
}
else if (tag < IPP_TAG_UNSUPPORTED_VALUE)
{
DEBUG_puts("1ippReadIO: unable to read name length.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
n = (buffer[0] << 8) | buffer[1];
if (n >= IPP_BUF_SIZE)
{
- _cupsSetError(IPP_INTERNAL_ERROR, _("IPP name larger than 32767 bytes."), 1);
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP name larger than 32767 bytes."), 1);
DEBUG_printf(("1ippReadIO: bad name length %d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
DEBUG_printf(("2ippReadIO: name length=%d", n));
if (ipp->current == NULL)
{
- _cupsSetError(IPP_INTERNAL_ERROR, _("IPP attribute has no name."), 1);
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP attribute has no name."), 1);
DEBUG_puts("1ippReadIO: Attribute without name and no current.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
attr = ipp->current;
- value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_MASK);
+ value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_CUPS_MASK);
/*
* Make sure we aren't adding a new value of a different
(tag < IPP_TAG_TEXT || tag > IPP_TAG_MIMETYPE) &&
tag != IPP_TAG_NOVALUE)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP 1setOf attribute with incompatible value "
"tags."), 1);
DEBUG_printf(("1ippReadIO: 1setOf value tag %x(%s) != %x(%s)",
value_tag, ippTagString(value_tag), tag,
ippTagString(tag)));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if (value_tag != tag)
if (tag != IPP_TAG_INTEGER && tag != IPP_TAG_RANGE)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP 1setOf attribute with incompatible value "
"tags."), 1);
DEBUG_printf(("1ippReadIO: 1setOf value tag %x(%s) != %x(%s)",
value_tag, ippTagString(value_tag), tag,
ippTagString(tag)));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if (value_tag == IPP_TAG_INTEGER && tag == IPP_TAG_RANGE)
}
else if (value_tag != tag)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP 1setOf attribute with incompatible value "
"tags."), 1);
DEBUG_printf(("1ippReadIO: value tag %x(%s) != %x(%s)",
value_tag, ippTagString(value_tag), tag,
ippTagString(tag)));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
/*
if ((value = ipp_set_value(ipp, &attr, attr->num_values)) == NULL)
{
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
}
else if (tag == IPP_TAG_MEMBERNAME)
if (n)
{
- _cupsSetError(IPP_INTERNAL_ERROR, _("IPP member name is not empty."), 1);
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP member name is not empty."), 1);
DEBUG_puts("1ippReadIO: member name not empty.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if (ipp->current)
attr = ipp->current = ipp_add_attr(ipp, NULL, ipp->curtag, IPP_TAG_ZERO, 1);
if (!attr)
{
- _cupsSetHTTPError(HTTP_ERROR);
+ _cupsSetHTTPError(HTTP_STATUS_ERROR);
DEBUG_puts("1ippReadIO: unable to allocate attribute.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
DEBUG_printf(("2ippReadIO: membername, ipp->current=%p, ipp->prev=%p",
{
DEBUG_puts("1ippReadIO: unable to read name.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
buffer[n] = '\0';
if ((attr = ipp->current = ipp_add_attr(ipp, (char *)buffer, ipp->curtag, tag,
1)) == NULL)
{
- _cupsSetHTTPError(HTTP_ERROR);
+ _cupsSetHTTPError(HTTP_STATUS_ERROR);
DEBUG_puts("1ippReadIO: unable to allocate attribute.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
DEBUG_printf(("2ippReadIO: name=\"%s\", ipp->current=%p, "
{
DEBUG_puts("1ippReadIO: unable to read value length.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
n = (buffer[0] << 8) | buffer[1];
if (n >= IPP_BUF_SIZE)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP value larger than 32767 bytes."), 1);
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
switch (tag)
if (n != 4)
{
if (tag == IPP_TAG_INTEGER)
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP integer value not 4 bytes."), 1);
else
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP enum value not 4 bytes."), 1);
DEBUG_printf(("1ippReadIO: bad integer value length %d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((*cb)(src, buffer, 4) < 4)
{
DEBUG_puts("1ippReadIO: Unable to read integer value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
n = (((((buffer[0] << 8) | buffer[1]) << 8) | buffer[2]) << 8) |
case IPP_TAG_BOOLEAN :
if (n != 1)
{
- _cupsSetError(IPP_INTERNAL_ERROR, _("IPP boolean value not 1 byte."),
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP boolean value not 1 byte."),
1);
DEBUG_printf(("1ippReadIO: bad boolean value length %d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((*cb)(src, buffer, 1) < 1)
{
DEBUG_puts("1ippReadIO: Unable to read boolean value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
value->boolean = buffer[0];
{
DEBUG_puts("1ippReadIO: unable to read string value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
}
case IPP_TAG_DATE :
if (n != 11)
{
- _cupsSetError(IPP_INTERNAL_ERROR, _("IPP date value not 11 bytes."), 1);
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP date value not 11 bytes."), 1);
DEBUG_printf(("1ippReadIO: bad date value length %d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((*cb)(src, value->date, 11) < 11)
{
DEBUG_puts("1ippReadIO: Unable to read date value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
break;
case IPP_TAG_RESOLUTION :
if (n != 9)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP resolution value not 9 bytes."), 1);
DEBUG_printf(("1ippReadIO: bad resolution value length %d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((*cb)(src, buffer, 9) < 9)
{
DEBUG_puts("1ippReadIO: Unable to read resolution value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
value->resolution.xres =
case IPP_TAG_RANGE :
if (n != 8)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP rangeOfInteger value not 8 bytes."), 1);
DEBUG_printf(("1ippReadIO: bad rangeOfInteger value length "
"%d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((*cb)(src, buffer, 8) < 8)
{
DEBUG_puts("1ippReadIO: Unable to read range value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
value->range.lower =
if (n < 4)
{
if (tag == IPP_TAG_TEXTLANG)
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP textWithLanguage value less than "
"minimum 4 bytes."), 1);
else
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP nameWithLanguage value less than "
"minimum 4 bytes."), 1);
DEBUG_printf(("1ippReadIO: bad stringWithLanguage value "
"length %d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((*cb)(src, buffer, n) < n)
DEBUG_puts("1ippReadIO: Unable to read string w/language "
"value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) ||
n >= sizeof(string))
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP language length overflows value."), 1);
DEBUG_printf(("1ippReadIO: bad language value length %d.",
n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
else if (n >= IPP_MAX_LANGUAGE)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP language length too large."), 1);
DEBUG_printf(("1ippReadIO: bad language value length %d.",
n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
memcpy(string, bufptr + 2, n);
if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP string length overflows value."), 1);
DEBUG_printf(("1ippReadIO: bad string value length %d.", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr[2 + n] = '\0';
if (n > 0)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP begCollection value not 0 bytes."), 1);
DEBUG_puts("1ippReadIO: begCollection tag with value length "
"> 0.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
- if (ippReadIO(src, cb, 1, ipp, value->collection) == IPP_ERROR)
+ if (ippReadIO(src, cb, 1, ipp, value->collection) == IPP_STATE_ERROR)
{
DEBUG_puts("1ippReadIO: Unable to read collection value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
break;
if (n > 0)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP endCollection value not 0 bytes."), 1);
DEBUG_puts("1ippReadIO: endCollection tag with value length "
"> 0.");
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
DEBUG_puts("1ippReadIO: endCollection tag...");
- return (ipp->state = IPP_DATA);
+ return (ipp->state = IPP_STATE_DATA);
case IPP_TAG_MEMBERNAME :
/*
if (!attr)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP memberName with no attribute."), 1);
DEBUG_puts("1ippReadIO: Member name without attribute.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
else if (n == 0)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP memberName value is empty."), 1);
DEBUG_puts("1ippReadIO: Empty member name value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
else if ((*cb)(src, buffer, n) < n)
{
DEBUG_puts("1ippReadIO: Unable to read member name value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
buffer[n] = '\0';
default : /* Other unsupported values */
if (tag == IPP_TAG_STRING && n > IPP_MAX_LENGTH)
{
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP octetString length too large."), 1);
DEBUG_printf(("1ippReadIO: bad octetString value length %d.",
n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
value->unknown.length = n;
{
if ((value->unknown.data = malloc(n)) == NULL)
{
- _cupsSetHTTPError(HTTP_ERROR);
+ _cupsSetHTTPError(HTTP_STATUS_ERROR);
DEBUG_puts("1ippReadIO: Unable to allocate value");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((*cb)(src, value->unknown.data, n) < n)
{
DEBUG_puts("1ippReadIO: Unable to read unsupported value.");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
}
else
}
break;
- case IPP_DATA :
+ case IPP_STATE_DATA :
break;
default :
*/
int /* O - 1 on success, 0 on failure */
-ippSetBoolean(ipp_t *ipp, /* IO - IPP message */
+ippSetBoolean(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
int boolvalue)/* I - Boolean value */
int /* O - 1 on success, 0 on failure */
ippSetCollection(
- ipp_t *ipp, /* IO - IPP message */
+ ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
ipp_t *colvalue) /* I - Collection value */
*/
int /* O - 1 on success, 0 on failure */
-ippSetDate(ipp_t *ipp, /* IO - IPP message */
+ippSetDate(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
const ipp_uchar_t *datevalue)/* I - Date value */
int /* O - 1 on success, 0 on failure */
ippSetGroupTag(
- ipp_t *ipp, /* IO - IPP message */
+ ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - Attribute */
ipp_tag_t group_tag) /* I - Group tag */
{
*/
int /* O - 1 on success, 0 on failure */
-ippSetInteger(ipp_t *ipp, /* IO - IPP message */
+ippSetInteger(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
int intvalue) /* I - Integer/enum value */
*/
int /* O - 1 on success, 0 on failure */
-ippSetName(ipp_t *ipp, /* IO - IPP message */
+ippSetName(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
const char *name) /* I - Attribute name */
{
}
+/*
+ * 'ippSetOctetString()' - Set an octetString value in an IPP attribute.
+ *
+ * The @code ipp@ parameter refers to an IPP message previously created using
+ * the @link ippNew@, @link ippNewRequest@, or @link ippNewResponse@ functions.
+ *
+ * The @code attr@ parameter may be modified as a result of setting the value.
+ *
+ * The @code element@ parameter specifies which value to set from 0 to
+ * @link ippGetCount(attr)@.
+ *
+ * @since CUPS 1.7/OS X 10.9@
+ */
+
+int /* O - 1 on success, 0 on failure */
+ippSetOctetString(
+ ipp_t *ipp, /* I - IPP message */
+ ipp_attribute_t **attr, /* IO - IPP attribute */
+ int element, /* I - Value number (0-based) */
+ const void *data, /* I - Pointer to octetString data */
+ int datalen) /* I - Length of octetString data */
+{
+ _ipp_value_t *value; /* Current value */
+
+
+ /*
+ * Range check input...
+ */
+
+ if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_STRING ||
+ element < 0 || element > (*attr)->num_values ||
+ datalen < 0 || datalen > IPP_MAX_LENGTH)
+ return (0);
+
+ /*
+ * Set the value and return...
+ */
+
+ if ((value = ipp_set_value(ipp, attr, element)) != NULL)
+ {
+ if ((int)((*attr)->value_tag) & IPP_TAG_CUPS_CONST)
+ {
+ /*
+ * Just copy the pointer...
+ */
+
+ value->unknown.data = (void *)data;
+ value->unknown.length = datalen;
+ }
+ else
+ {
+ /*
+ * Copy the data...
+ */
+
+ if (value->unknown.data)
+ {
+ /*
+ * Free previous data...
+ */
+
+ free(value->unknown.data);
+
+ value->unknown.data = NULL;
+ value->unknown.length = 0;
+ }
+
+ if (datalen > 0)
+ {
+ void *temp; /* Temporary data pointer */
+
+ if ((temp = malloc(datalen)) != NULL)
+ {
+ memcpy(temp, data, datalen);
+
+ value->unknown.data = temp;
+ value->unknown.length = datalen;
+ }
+ else
+ return (0);
+ }
+ }
+ }
+
+ return (value != NULL);
+}
+
+
/*
* 'ippSetOperation()' - Set the operation ID in an IPP request message.
*
*/
int /* O - 1 on success, 0 on failure */
-ippSetRange(ipp_t *ipp, /* IO - IPP message */
+ippSetRange(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
int lowervalue, /* I - Lower bound for range */
int /* O - 1 on success, 0 on failure */
ippSetResolution(
- ipp_t *ipp, /* IO - IPP message */
+ ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
ipp_res_t unitsvalue, /* I - Resolution units */
*/
int /* O - 1 on success, 0 on failure */
-ippSetString(ipp_t *ipp, /* IO - IPP message */
+ippSetString(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
const char *strvalue) /* I - String value */
if (element > 0)
value->string.language = (*attr)->values[0].string.language;
- if ((int)((*attr)->value_tag) & IPP_TAG_COPY)
+ if ((int)((*attr)->value_tag) & IPP_TAG_CUPS_CONST)
value->string.text = (char *)strvalue;
else if ((temp = _cupsStrAlloc(strvalue)) != NULL)
{
* needed. The formatted string is truncated as needed to the maximum length of
* the corresponding value type.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
int /* O - 1 on success, 0 on failure */
-ippSetStringf(ipp_t *ipp, /* IO - IPP message */
+ippSetStringf(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
const char *format, /* I - Printf-style format string */
* needed. The formatted string is truncated as needed to the maximum length of
* the corresponding value type.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
int /* O - 1 on success, 0 on failure */
-ippSetStringfv(ipp_t *ipp, /* IO - IPP message */
+ippSetStringfv(ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
int element, /* I - Value number (0-based) */
const char *format, /* I - Printf-style format string */
if (!ipp || !attr || !*attr ||
(value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG &&
value_tag != IPP_TAG_NAMELANG) || value_tag > IPP_TAG_MIMETYPE ||
- !format || !ap)
+ !format)
return (0);
/*
int /* O - 1 on success, 0 on failure */
ippSetValueTag(
- ipp_t *ipp, /* IO - IPP message */
+ ipp_t *ipp, /* I - IPP message */
ipp_attribute_t **attr, /* IO - IPP attribute */
ipp_tag_t value_tag) /* I - Value tag */
{
* Otherwise implement changes as needed...
*/
- temp_tag = (ipp_tag_t)((int)((*attr)->value_tag) & IPP_TAG_MASK);
+ temp_tag = (ipp_tag_t)((int)((*attr)->value_tag) & IPP_TAG_CUPS_MASK);
switch (value_tag)
{
temp_tag != IPP_TAG_MIMETYPE)
return (0);
- (*attr)->value_tag = (ipp_tag_t)(IPP_TAG_NAME | ((*attr)->value_tag & IPP_TAG_COPY));
+ (*attr)->value_tag = (ipp_tag_t)(IPP_TAG_NAME | ((*attr)->value_tag & IPP_TAG_CUPS_CONST));
break;
case IPP_TAG_NAMELANG :
i --, value ++)
value->string.language = (*attr)->values[0].string.language;
- if ((int)(*attr)->value_tag & IPP_TAG_COPY)
+ if ((int)(*attr)->value_tag & IPP_TAG_CUPS_CONST)
{
/*
* Make copies of all values...
* value tag. 1 is returned if the attribute is valid, 0 otherwise. On
* failure, cupsLastErrorString() is set to a human-readable message.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
int /* O - 1 if valid, 0 otherwise */
hostname, sizeof(hostname),
&port, resource, sizeof(resource));
- if (uri_status < HTTP_URI_OK)
+ if (uri_status < HTTP_URI_STATUS_OK)
{
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
_("\"%s\": Bad URI value \"%s\" - %s "
"(RFC 2911 section 4.1.5)."), attr->name,
attr->values[i].string.text,
uri_status_strings[uri_status -
- HTTP_URI_OVERFLOW]);
+ HTTP_URI_STATUS_OVERFLOW]);
return (0);
}
* attribute. Like @link ippValidateAttribute@, cupsLastErrorString() is set
* to a human-readable message on failure.
*
- * @since CUPS 1.7@
+ * @since CUPS 1.7/OS X 10.9@
*/
int /* O - 1 if valid, 0 otherwise */
DEBUG_printf(("ippWrite(http=%p, ipp=%p)", http, ipp));
if (!http)
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
return (ippWriteIO(http, (ipp_iocb_t)httpWrite2, http->blocking, NULL, ipp));
}
{
DEBUG_printf(("ippWriteFile(fd=%d, ipp=%p)", fd, ipp));
- ipp->state = IPP_IDLE;
+ ipp->state = IPP_STATE_IDLE;
return (ippWriteIO(&fd, (ipp_iocb_t)ipp_write_file, 1, NULL, ipp));
}
dst, cb, blocking, parent, ipp));
if (!dst || !ipp)
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
if ((buffer = (unsigned char *)_cupsBufferGet(IPP_BUF_SIZE)) == NULL)
{
DEBUG_puts("1ippWriteIO: Unable to get write buffer");
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
switch (ipp->state)
{
- case IPP_IDLE :
+ case IPP_STATE_IDLE :
ipp->state ++; /* Avoid common problem... */
- case IPP_HEADER :
+ case IPP_STATE_HEADER :
if (parent == NULL)
{
/*
{
DEBUG_puts("1ippWriteIO: Could not write IPP header...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
}
* in the request/response, with no current group.
*/
- ipp->state = IPP_ATTRIBUTE;
+ ipp->state = IPP_STATE_ATTRIBUTE;
ipp->current = ipp->attrs;
ipp->curtag = IPP_TAG_ZERO;
if (!blocking)
break;
- case IPP_ATTRIBUTE :
+ case IPP_STATE_ATTRIBUTE :
while (ipp->current != NULL)
{
/*
{
DEBUG_printf(("1ippWriteIO: Attribute name too long (%d)", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
/*
{
DEBUG_printf(("1ippWriteIO: Attribute name too long (%d)", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
/*
* Now write the attribute value(s)...
*/
- switch (attr->value_tag & ~IPP_TAG_COPY)
+ switch (attr->value_tag & ~IPP_TAG_CUPS_CONST)
{
case IPP_TAG_UNSUPPORTED_VALUE :
case IPP_TAG_DEFAULT :
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
{
DEBUG_printf(("1ippWriteIO: String too long (%d)", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
DEBUG_printf(("2ippWriteIO: writing string=%d,\"%s\"", n,
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_printf(("1ippWriteIO: text/nameWithLanguage value "
"too long (%d)", n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((int)(IPP_BUF_SIZE - (bufptr - buffer)) < (n + 2))
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
* Then write the collection attribute...
*/
- value->collection->state = IPP_IDLE;
+ value->collection->state = IPP_STATE_IDLE;
if (ippWriteIO(dst, cb, 1, ipp,
- value->collection) == IPP_ERROR)
+ value->collection) == IPP_STATE_ERROR)
{
DEBUG_puts("1ippWriteIO: Unable to write collection value");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
}
break;
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
DEBUG_printf(("1ippWriteIO: Data length too long (%d)",
n));
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
if ((int)(IPP_BUF_SIZE - (bufptr - buffer)) < (n + 2))
DEBUG_puts("1ippWriteIO: Could not write IPP "
"attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
bufptr = buffer;
{
DEBUG_puts("1ippWriteIO: Could not write IPP attribute...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
DEBUG_printf(("2ippWriteIO: wrote %d bytes",
}
/*
- * If blocking is disabled, stop here...
+ * If blocking is disabled and we aren't at the end of the attribute
+ * list, stop here...
*/
- if (!blocking)
+ if (!blocking && ipp->current)
break;
}
{
DEBUG_puts("1ippWriteIO: Could not write IPP end-tag...");
_cupsBufferRelease((char *)buffer);
- return (IPP_ERROR);
+ return (IPP_STATE_ERROR);
}
- ipp->state = IPP_DATA;
+ ipp->state = IPP_STATE_DATA;
}
break;
- case IPP_DATA :
+ case IPP_STATE_DATA :
break;
default :
DEBUG_printf(("4ipp_free_values(attr=%p, element=%d, count=%d)", attr,
element, count));
- if (!(attr->value_tag & IPP_TAG_COPY))
+ if (!(attr->value_tag & IPP_TAG_CUPS_CONST))
{
/*
* Free values as needed...
if (collection)
bytes += 5; /* Add membername overhead */
- switch (attr->value_tag & ~IPP_TAG_COPY)
+ switch (attr->value_tag & ~IPP_TAG_CUPS_CONST)
{
case IPP_TAG_UNSUPPORTED_VALUE :
case IPP_TAG_DEFAULT :
DEBUG_printf(("9ipp_read_http: tbytes=%d, http->state=%d", tbytes,
http->state));
- if (http->state == HTTP_WAITING)
+ if (http->state == HTTP_STATE_WAITING)
break;
if (http->used == 0 && !http->blocking)
if ((temp = realloc(temp, sizeof(ipp_attribute_t) +
(alloc_values - 1) * sizeof(_ipp_value_t))) == NULL)
{
- _cupsSetHTTPError(HTTP_ERROR);
+ _cupsSetHTTPError(HTTP_STATUS_ERROR);
DEBUG_puts("4ipp_set_value: Unable to resize attribute.");
return (NULL);
}
*/
*attr = temp;
- _cupsSetError(IPP_INTERNAL_ERROR,
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
_("IPP attribute is not a member of the message."), 1);
DEBUG_puts("4ipp_set_value: Unable to find attribute in message.");
return (NULL);
/*
- * End of "$Id: ipp.c 10102 2011-11-02 23:52:39Z mike $".
+ * End of "$Id$".
*/