]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ipp.c
License change: Apache License, Version 2.0.
[thirdparty/cups.git] / cups / ipp.c
index 9211ef0eef13d2329efece3a1127114696c7ca26..58f120c0f6b9bd1d4d4047080128603830c43214 100644 (file)
@@ -1,18 +1,10 @@
 /*
- * "$Id$"
- *
  * Internet Printing Protocol functions for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file.  If this file is
- * file is missing or damaged, see the license at "http://www.cups.org/".
- *
- * This file is subject to the Apple OS-Developed Software exception.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
  */
 
 /*
@@ -127,8 +119,7 @@ ippAddBoolean(ipp_t      *ipp,              /* I - IPP message */
   ipp_attribute_t      *attr;          /* New attribute */
 
 
-  DEBUG_printf(("ippAddBoolean(ipp=%p, group=%02x(%s), name=\"%s\", value=%d)",
-                ipp, group, ippTagString(group), name, value));
+  DEBUG_printf(("ippAddBoolean(ipp=%p, group=%02x(%s), name=\"%s\", value=%d)", (void *)ipp, group, ippTagString(group), name, value));
 
  /*
   * Range check input...
@@ -176,9 +167,7 @@ ippAddBooleans(ipp_t      *ipp,             /* I - IPP message */
   _ipp_value_t         *value;         /* Current value */
 
 
-  DEBUG_printf(("ippAddBooleans(ipp=%p, group=%02x(%s), name=\"%s\", "
-                "num_values=%d, values=%p)", ipp, group, ippTagString(group),
-                name, num_values, values));
+  DEBUG_printf(("ippAddBooleans(ipp=%p, group=%02x(%s), name=\"%s\", num_values=%d, values=%p)", (void *)ipp, group, ippTagString(group), name, num_values, (void *)values));
 
  /*
   * Range check input...
@@ -220,7 +209,7 @@ ippAddBooleans(ipp_t      *ipp,             /* I - IPP message */
  * (@code IPP_TAG_OPERATION@), printer (@code IPP_TAG_PRINTER@), subscription
  * (@code IPP_TAG_SUBSCRIPTION@), or unsupported (@code IPP_TAG_UNSUPPORTED_GROUP@).
  *
- * @since CUPS 1.1.19/OS X 10.3@
+ * @since CUPS 1.1.19/macOS 10.3@
  */
 
 ipp_attribute_t *                      /* O - New attribute */
@@ -232,8 +221,7 @@ ippAddCollection(ipp_t      *ipp,   /* I - IPP message */
   ipp_attribute_t      *attr;          /* New attribute */
 
 
-  DEBUG_printf(("ippAddCollection(ipp=%p, group=%02x(%s), name=\"%s\", "
-                "value=%p)", ipp, group, ippTagString(group), name, value));
+  DEBUG_printf(("ippAddCollection(ipp=%p, group=%02x(%s), name=\"%s\", value=%p)", (void *)ipp, group, ippTagString(group), name, (void *)value));
 
  /*
   * Range check input...
@@ -271,7 +259,7 @@ ippAddCollection(ipp_t      *ipp,   /* I - IPP message */
  * (@code IPP_TAG_OPERATION@), printer (@code IPP_TAG_PRINTER@), subscription
  * (@code IPP_TAG_SUBSCRIPTION@), or unsupported (@code IPP_TAG_UNSUPPORTED_GROUP@).
  *
- * @since CUPS 1.1.19/OS X 10.3@
+ * @since CUPS 1.1.19/macOS 10.3@
  */
 
 ipp_attribute_t *                      /* O - New attribute */
@@ -287,9 +275,7 @@ ippAddCollections(
   _ipp_value_t         *value;         /* Current value */
 
 
-  DEBUG_printf(("ippAddCollections(ipp=%p, group=%02x(%s), name=\"%s\", "
-                "num_values=%d, values=%p)", ipp, group, ippTagString(group),
-                name, num_values, values));
+  DEBUG_printf(("ippAddCollections(ipp=%p, group=%02x(%s), name=\"%s\", num_values=%d, values=%p)", (void *)ipp, group, ippTagString(group), name, num_values, (void *)values));
 
  /*
   * Range check input...
@@ -324,7 +310,7 @@ ippAddCollections(
 
 
 /*
- * 'ippAddDate()' - Add a date attribute to an IPP message.
+ * 'ippAddDate()' - Add a dateTime attribute to an IPP message.
  *
  * The @code ipp@ parameter refers to an IPP message previously created using
  * the @link ippNew@, @link ippNewRequest@, or  @link ippNewResponse@ functions.
@@ -345,8 +331,7 @@ ippAddDate(ipp_t             *ipp,  /* I - IPP message */
   ipp_attribute_t      *attr;          /* New attribute */
 
 
-  DEBUG_printf(("ippAddDate(ipp=%p, group=%02x(%s), name=\"%s\", value=%p)",
-                ipp, group, ippTagString(group), name, value));
+  DEBUG_printf(("ippAddDate(ipp=%p, group=%02x(%s), name=\"%s\", value=%p)", (void *)ipp, group, ippTagString(group), name, (void *)value));
 
  /*
   * Range check input...
@@ -395,9 +380,7 @@ ippAddInteger(ipp_t      *ipp,              /* I - IPP message */
   ipp_attribute_t      *attr;          /* New attribute */
 
 
-  DEBUG_printf(("ippAddInteger(ipp=%p, group=%02x(%s), type=%02x(%s), "
-                "name=\"%s\", value=%d)", ipp, group, ippTagString(group),
-               value_tag, ippTagString(value_tag), name, value));
+  DEBUG_printf(("ippAddInteger(ipp=%p, group=%02x(%s), type=%02x(%s), name=\"%s\", value=%d)", (void *)ipp, group, ippTagString(group), value_tag, ippTagString(value_tag), name, value));
 
   value_tag &= IPP_TAG_CUPS_MASK;
 
@@ -466,10 +449,7 @@ ippAddIntegers(ipp_t      *ipp,            /* I - IPP message */
   _ipp_value_t         *value;         /* Current value */
 
 
-  DEBUG_printf(("ippAddIntegers(ipp=%p, group=%02x(%s), type=%02x(%s), "
-                "name=\"%s\", num_values=%d, values=%p)", ipp,
-               group, ippTagString(group), value_tag, ippTagString(value_tag), name,
-               num_values, values));
+  DEBUG_printf(("ippAddIntegers(ipp=%p, group=%02x(%s), type=%02x(%s), name=\"%s\", num_values=%d, values=%p)", (void *)ipp, group, ippTagString(group), value_tag, ippTagString(value_tag), name, num_values, (void *)values));
 
   value_tag &= IPP_TAG_CUPS_MASK;
 
@@ -521,7 +501,7 @@ ippAddIntegers(ipp_t      *ipp,             /* I - IPP message */
  * (@code IPP_TAG_OPERATION@), printer (@code IPP_TAG_PRINTER@), subscription
  * (@code IPP_TAG_SUBSCRIPTION@), or unsupported (@code IPP_TAG_UNSUPPORTED_GROUP@).
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 ipp_attribute_t        *                       /* O - New attribute */
@@ -585,7 +565,7 @@ ippAddOctetString(ipp_t      *ipp,  /* I - IPP message */
  * (@code IPP_TAG_NOTSETTABLE@), delete-attribute (@code IPP_TAG_DELETEATTR@), and
  * admin-define (@code IPP_TAG_ADMINDEFINE@).
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_attribute_t        *                       /* O - New attribute */
@@ -594,9 +574,7 @@ ippAddOutOfBand(ipp_t      *ipp,    /* I - IPP message */
                 ipp_tag_t  value_tag,  /* I - Type of attribute */
                const char *name)       /* I - Name of attribute */
 {
-  DEBUG_printf(("ippAddOutOfBand(ipp=%p, group=%02x(%s), value_tag=%02x(%s), "
-                "name=\"%s\")", ipp, group, ippTagString(group), value_tag,
-                ippTagString(value_tag), name));
+  DEBUG_printf(("ippAddOutOfBand(ipp=%p, group=%02x(%s), value_tag=%02x(%s), name=\"%s\")", (void *)ipp, group, ippTagString(group), value_tag, ippTagString(value_tag), name));
 
   value_tag &= IPP_TAG_CUPS_MASK;
 
@@ -648,9 +626,7 @@ ippAddRange(ipp_t      *ipp,                /* I - IPP message */
   ipp_attribute_t      *attr;          /* New attribute */
 
 
-  DEBUG_printf(("ippAddRange(ipp=%p, group=%02x(%s), name=\"%s\", lower=%d, "
-                "upper=%d)", ipp, group, ippTagString(group), name, lower,
-               upper));
+  DEBUG_printf(("ippAddRange(ipp=%p, group=%02x(%s), name=\"%s\", lower=%d, upper=%d)", (void *)ipp, group, ippTagString(group), name, lower, upper));
 
  /*
   * Range check input...
@@ -700,9 +676,7 @@ ippAddRanges(ipp_t      *ipp,               /* I - IPP message */
   _ipp_value_t         *value;         /* Current value */
 
 
-  DEBUG_printf(("ippAddRanges(ipp=%p, group=%02x(%s), name=\"%s\", "
-                "num_values=%d, lower=%p, upper=%p)", ipp, group,
-               ippTagString(group), name, num_values, lower, upper));
+  DEBUG_printf(("ippAddRanges(ipp=%p, group=%02x(%s), name=\"%s\", num_values=%d, lower=%p, upper=%p)", (void *)ipp, group, ippTagString(group), name, num_values, (void *)lower, (void *)upper));
 
  /*
   * Range check input...
@@ -759,8 +733,7 @@ ippAddResolution(ipp_t      *ipp,   /* I - IPP message */
   ipp_attribute_t      *attr;          /* New attribute */
 
 
-  DEBUG_printf(("ippAddResolution(ipp=%p, group=%02x(%s), name=\"%s\", "
-                "units=%d, xres=%d, yres=%d)", ipp, group,
+  DEBUG_printf(("ippAddResolution(ipp=%p, group=%02x(%s), name=\"%s\", units=%d, xres=%d, yres=%d)", (void *)ipp, group,
                ippTagString(group), name, units, xres, yres));
 
  /*
@@ -815,9 +788,7 @@ ippAddResolutions(ipp_t      *ipp,  /* I - IPP message */
   _ipp_value_t         *value;         /* Current value */
 
 
-  DEBUG_printf(("ippAddResolutions(ipp=%p, group=%02x(%s), name=\"%s\", "
-                "num_value=%d, units=%d, xres=%p, yres=%p)", ipp, group,
-               ippTagString(group), name, num_values, units, xres, yres));
+  DEBUG_printf(("ippAddResolutions(ipp=%p, group=%02x(%s), name=\"%s\", num_value=%d, units=%d, xres=%p, yres=%p)", (void *)ipp, group, ippTagString(group), name, num_values, units, (void *)xres, (void *)yres));
 
  /*
   * Range check input...
@@ -862,7 +833,7 @@ ippAddResolutions(ipp_t      *ipp,  /* I - IPP message */
 ipp_attribute_t *                      /* O - New attribute */
 ippAddSeparator(ipp_t *ipp)            /* I - IPP message */
 {
-  DEBUG_printf(("ippAddSeparator(ipp=%p)", ipp));
+  DEBUG_printf(("ippAddSeparator(ipp=%p)", (void *)ipp));
 
  /*
   * Range check input...
@@ -916,10 +887,7 @@ ippAddString(ipp_t      *ipp,              /* I - IPP message */
                                        /* Charset/language code buffer */
 
 
-  DEBUG_printf(("ippAddString(ipp=%p, group=%02x(%s), value_tag=%02x(%s), "
-                "name=\"%s\", language=\"%s\", value=\"%s\")", ipp,
-               group, ippTagString(group), value_tag, ippTagString(value_tag), name,
-               language, value));
+  DEBUG_printf(("ippAddString(ipp=%p, group=%02x(%s), value_tag=%02x(%s), name=\"%s\", language=\"%s\", value=\"%s\")", (void *)ipp, group, ippTagString(group), value_tag, ippTagString(value_tag), name, language, value));
 
  /*
   * Range check input...
@@ -1025,7 +993,7 @@ ippAddString(ipp_t      *ipp,              /* I - IPP message */
  * needed.  The formatted string is truncated as needed to the maximum length of
  * the corresponding value type.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 ipp_attribute_t *                      /* O - New attribute */
@@ -1078,7 +1046,7 @@ ippAddStringf(ipp_t      *ipp,            /* I - IPP message */
  * stdarg pointer @code ap@.  The formatted string is truncated as needed to the
  * maximum length of the corresponding value type.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 ipp_attribute_t *                      /* O - New attribute */
@@ -1251,10 +1219,7 @@ ippAddStrings(
   char                 code[32];       /* Language/charset value buffer */
 
 
-  DEBUG_printf(("ippAddStrings(ipp=%p, group=%02x(%s), value_tag=%02x(%s), "
-                "name=\"%s\", num_values=%d, language=\"%s\", values=%p)", ipp,
-               group, ippTagString(group), value_tag, ippTagString(value_tag), name,
-               num_values, language, values));
+  DEBUG_printf(("ippAddStrings(ipp=%p, group=%02x(%s), value_tag=%02x(%s), name=\"%s\", num_values=%d, language=\"%s\", values=%p)", (void *)ipp, group, ippTagString(group), value_tag, ippTagString(value_tag), name, num_values, language, (void *)values));
 
  /*
   * Range check input...
@@ -1360,7 +1325,7 @@ ippAddStrings(
  * enum value, or the value falls within one of the rangeOfInteger values for
  * the attribute.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 int                                    /* O - 1 on a match, 0 on no match */
@@ -1409,9 +1374,9 @@ ippContainsInteger(
  *                         specified string value.
  *
  * Returns non-zero when the attribute contains a matching charset, keyword,
- * language, mimeMediaType, name, text, URI, or URI scheme value.
+ * naturalLanguage, mimeMediaType, name, text, uri, or uriScheme value.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 int                                    /* O - 1 on a match, 0 on no match */
@@ -1423,7 +1388,7 @@ ippContainsString(
   _ipp_value_t *avalue;                /* Current attribute value */
 
 
-  DEBUG_printf(("ippContainsString(attr=%p, value=\"%s\")", attr, value));
+  DEBUG_printf(("ippContainsString(attr=%p, value=\"%s\")", (void *)attr, value));
 
  /*
   * Range check input...
@@ -1448,13 +1413,27 @@ ippContainsString(
     case IPP_TAG_CHARSET :
     case IPP_TAG_KEYWORD :
     case IPP_TAG_LANGUAGE :
+    case IPP_TAG_URI :
+    case IPP_TAG_URISCHEME :
+       for (i = attr->num_values, avalue = attr->values;
+            i > 0;
+            i --, avalue ++)
+       {
+         DEBUG_printf(("1ippContainsString: value[%d]=\"%s\"",
+                       attr->num_values - i, avalue->string.text));
+
+         if (!strcmp(value, avalue->string.text))
+         {
+           DEBUG_puts("1ippContainsString: Returning 1 (match)");
+           return (1);
+         }
+        }
+
     case IPP_TAG_MIMETYPE :
     case IPP_TAG_NAME :
     case IPP_TAG_NAMELANG :
     case IPP_TAG_TEXT :
     case IPP_TAG_TEXTLANG :
-    case IPP_TAG_URI :
-    case IPP_TAG_URISCHEME :
        for (i = attr->num_values, avalue = attr->values;
             i > 0;
             i --, avalue ++)
@@ -1462,7 +1441,7 @@ ippContainsString(
          DEBUG_printf(("1ippContainsString: value[%d]=\"%s\"",
                        attr->num_values - i, avalue->string.text));
 
-         if (!strcmp(value, avalue->string.text))
+         if (!_cups_strcasecmp(value, avalue->string.text))
          {
            DEBUG_puts("1ippContainsString: Returning 1 (match)");
            return (1);
@@ -1487,7 +1466,7 @@ ippContainsString(
  * created - this should only be done as long as the original source IPP message will
  * not be freed for the life of the destination.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 
@@ -1503,8 +1482,7 @@ ippCopyAttribute(
                        *dstval;        /* Destination value */
 
 
-  DEBUG_printf(("ippCopyAttribute(dst=%p, srcattr=%p, quickcopy=%d)", dst, srcattr,
-                quickcopy));
+  DEBUG_printf(("ippCopyAttribute(dst=%p, srcattr=%p, quickcopy=%d)", (void *)dst, (void *)srcattr, quickcopy));
 
  /*
   * Range check input...
@@ -1525,6 +1503,16 @@ ippCopyAttribute(
         dstattr = ippAddSeparator(dst);
        break;
 
+    case IPP_TAG_UNSUPPORTED_VALUE :
+    case IPP_TAG_DEFAULT :
+    case IPP_TAG_UNKNOWN :
+    case IPP_TAG_NOVALUE :
+    case IPP_TAG_NOTSETTABLE :
+    case IPP_TAG_DELETEATTR :
+    case IPP_TAG_ADMINDEFINE :
+        dstattr = ippAddOutOfBand(dst, srcattr->group_tag, srcattr->value_tag & ~IPP_TAG_CUPS_CONST, srcattr->name);
+        break;
+
     case IPP_TAG_INTEGER :
     case IPP_TAG_ENUM :
         dstattr = ippAddIntegers(dst, srcattr->group_tag, srcattr->value_tag,
@@ -1738,7 +1726,7 @@ ippCopyAttribute(
  * 0 to skip it. The function may also choose to do a partial copy of the source attribute
  * itself.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - 1 on success, 0 on error */
@@ -1752,8 +1740,7 @@ ippCopyAttributes(
   ipp_attribute_t      *srcattr;       /* Source attribute */
 
 
-  DEBUG_printf(("ippCopyAttributes(dst=%p, src=%p, quickcopy=%d, cb=%p, context=%p)",
-                dst, src, quickcopy, cb, context));
+  DEBUG_printf(("ippCopyAttributes(dst=%p, src=%p, quickcopy=%d, cb=%p, context=%p)", (void *)dst, (void *)src, quickcopy, (void *)cb, context));
 
  /*
   * Range check input...
@@ -1776,12 +1763,12 @@ ippCopyAttributes(
 
 
 /*
- * 'ippDateToTime()' - Convert from RFC 1903 Date/Time format to UNIX time
- *                     in seconds.
+ * 'ippDateToTime()' - Convert from RFC 2579 Date/Time format to time in
+ *                     seconds.
  */
 
 time_t                                 /* O - UNIX time value */
-ippDateToTime(const ipp_uchar_t *date) /* I - RFC 1903 date info */
+ippDateToTime(const ipp_uchar_t *date) /* I - RFC 2579 date info */
 {
   struct tm    unixdate;               /* UNIX date/time info */
   time_t       t;                      /* Computed time */
@@ -1793,7 +1780,7 @@ ippDateToTime(const ipp_uchar_t *date)    /* I - RFC 1903 date info */
   memset(&unixdate, 0, sizeof(unixdate));
 
  /*
-  * RFC-1903 date/time format is:
+  * RFC-2579 date/time format is:
   *
   *    Byte(s)  Description
   *    -------  -----------
@@ -1838,19 +1825,26 @@ ippDelete(ipp_t *ipp)                   /* I - IPP message */
                        *next;          /* Next attribute */
 
 
-  DEBUG_printf(("ippDelete(ipp=%p)", ipp));
+  DEBUG_printf(("ippDelete(ipp=%p)", (void *)ipp));
 
   if (!ipp)
     return;
 
   ipp->use --;
   if (ipp->use > 0)
+  {
+    DEBUG_printf(("4debug_retain: %p IPP message (use=%d)", (void *)ipp, ipp->use));
     return;
+  }
+
+  DEBUG_printf(("4debug_free: %p IPP message", (void *)ipp));
 
   for (attr = ipp->attrs; attr != NULL; attr = next)
   {
     next = attr->next;
 
+    DEBUG_printf(("4debug_free: %p %s %s%s (%d values)", (void *)attr, attr->name, attr->num_values > 1 ? "1setOf " : "", ippTagString(attr->value_tag), attr->num_values));
+
     ipp_free_values(attr, 0, attr->num_values);
 
     if (attr->name)
@@ -1866,7 +1860,7 @@ ippDelete(ipp_t *ipp)                     /* I - IPP message */
 /*
  * 'ippDeleteAttribute()' - Delete a single attribute in an IPP message.
  *
- * @since CUPS 1.1.19/OS X 10.3@
+ * @since CUPS 1.1.19/macOS 10.3@
  */
 
 void
@@ -1878,8 +1872,7 @@ ippDeleteAttribute(
                        *prev;          /* Previous attribute */
 
 
-  DEBUG_printf(("ippDeleteAttribute(ipp=%p, attr=%p(%s))", ipp, attr,
-                attr ? attr->name : "(null)"));
+  DEBUG_printf(("ippDeleteAttribute(ipp=%p, attr=%p(%s))", (void *)ipp, (void *)attr, attr ? attr->name : "(null)"));
 
  /*
   * Range check input...
@@ -1888,6 +1881,8 @@ ippDeleteAttribute(
   if (!attr)
     return;
 
+  DEBUG_printf(("4debug_free: %p %s %s%s (%d values)", (void *)attr, attr->name, attr->num_values > 1 ? "1setOf " : "", ippTagString(attr->value_tag), attr->num_values));
+
  /*
   * Find the attribute in the list...
   */
@@ -1941,7 +1936,7 @@ ippDeleteAttribute(
  *
  * Deleting all values in an attribute deletes the attribute.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -1994,8 +1989,7 @@ ippFindAttribute(ipp_t      *ipp, /* I - IPP message */
                  const char *name,     /* I - Name of attribute */
                 ipp_tag_t  type)       /* I - Type of attribute */
 {
-  DEBUG_printf(("2ippFindAttribute(ipp=%p, name=\"%s\", type=%02x(%s))", ipp,
-                name, type, ippTagString(type)));
+  DEBUG_printf(("2ippFindAttribute(ipp=%p, name=\"%s\", type=%02x(%s))", (void *)ipp, name, type, ippTagString(type)));
 
   if (!ipp || !name)
     return (NULL);
@@ -2032,11 +2026,10 @@ ippFindNextAttribute(ipp_t      *ipp,   /* I - IPP message */
                        *childattr;     /* Child attribute */
   ipp_tag_t            value_tag;      /* Value tag */
   char                 parent[1024],   /* Parent attribute name */
-                       *child;         /* Child attribute name */
+                       *child = NULL;  /* Child attribute name */
 
 
-  DEBUG_printf(("2ippFindNextAttribute(ipp=%p, name=\"%s\", type=%02x(%s))",
-                ipp, name, type, ippTagString(type)));
+  DEBUG_printf(("2ippFindNextAttribute(ipp=%p, name=\"%s\", type=%02x(%s))", (void *)ipp, name, type, ippTagString(type)));
 
   if (!ipp || !name)
     return (NULL);
@@ -2107,8 +2100,7 @@ ippFindNextAttribute(ipp_t      *ipp,     /* I - IPP message */
 
   for (; attr != NULL; ipp->prev = attr, attr = attr->next)
   {
-    DEBUG_printf(("4ippFindAttribute: attr=%p, name=\"%s\"", attr,
-                  attr->name));
+    DEBUG_printf(("4ippFindAttribute: attr=%p, name=\"%s\"", (void *)attr, attr->name));
 
     value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_CUPS_MASK);
 
@@ -2148,7 +2140,7 @@ ippFindNextAttribute(ipp_t      *ipp,     /* I - IPP message */
 /*
  * 'ippFirstAttribute()' - Return the first attribute in the message.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_attribute_t        *                       /* O - First attribute or @code NULL@ if none */
@@ -2173,9 +2165,9 @@ ippFirstAttribute(ipp_t *ipp)             /* I - IPP message */
  * 'ippGetBoolean()' - Get a boolean value for an attribute.
  *
  * The @code element@ parameter specifies which value to get from 0 to
- * @link ippGetCount(attr)@ - 1.
+ * @code ippGetCount(attr)@ - 1.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - Boolean value or 0 on error */
@@ -2202,9 +2194,9 @@ ippGetBoolean(ipp_attribute_t *attr,      /* I - IPP attribute */
  * 'ippGetCollection()' - Get a collection value for an attribute.
  *
  * The @code element@ parameter specifies which value to get from 0 to
- * @link ippGetCount(attr)@ - 1.
+ * @code ippGetCount(attr)@ - 1.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_t *                                        /* O - Collection value or @code NULL@ on error */
@@ -2231,7 +2223,7 @@ ippGetCollection(
 /*
  * 'ippGetCount()' - Get the number of values in an attribute.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - Number of values or 0 on error */
@@ -2253,15 +2245,15 @@ ippGetCount(ipp_attribute_t *attr)      /* I - IPP attribute */
 
 
 /*
- * 'ippGetDate()' - Get a date value for an attribute.
+ * 'ippGetDate()' - Get a dateTime value for an attribute.
  *
  * The @code element@ parameter specifies which value to get from 0 to
- * @link ippGetCount(attr)@ - 1.
+ * @code ippGetCount(attr)@ - 1.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
-const ipp_uchar_t *                    /* O - Date value or @code NULL@ */
+const ipp_uchar_t *                    /* O - dateTime value or @code NULL@ */
 ippGetDate(ipp_attribute_t *attr,      /* I - IPP attribute */
            int             element)    /* I - Value number (0-based) */
 {
@@ -2284,7 +2276,7 @@ ippGetDate(ipp_attribute_t *attr, /* I - IPP attribute */
 /*
  * 'ippGetGroupTag()' - Get the group associated with an attribute.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_tag_t                              /* O - Group tag or @code IPP_TAG_ZERO@ on error */
@@ -2309,9 +2301,9 @@ ippGetGroupTag(ipp_attribute_t *attr)     /* I - IPP attribute */
  * 'ippGetInteger()' - Get the integer/enum value for an attribute.
  *
  * The @code element@ parameter specifies which value to get from 0 to
- * @link ippGetCount(attr)@ - 1.
+ * @code ippGetCount(attr)@ - 1.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - Value or 0 on error */
@@ -2337,7 +2329,7 @@ ippGetInteger(ipp_attribute_t *attr,      /* I - IPP attribute */
 /*
  * 'ippGetName()' - Get the attribute name.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 const char *                           /* O - Attribute name or @code NULL@ for separators */
@@ -2362,9 +2354,9 @@ ippGetName(ipp_attribute_t *attr) /* I - IPP attribute */
  * '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.
+ * @code ippGetCount(attr)@ - 1.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 void *                                 /* O - Pointer to octetString data */
@@ -2400,7 +2392,7 @@ ippGetOctetString(
 /*
  * 'ippGetOperation()' - Get the operation ID in an IPP message.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_op_t                               /* O - Operation ID or 0 on error */
@@ -2425,9 +2417,9 @@ ippGetOperation(ipp_t *ipp)               /* I - IPP request message */
  * 'ippGetRange()' - Get a rangeOfInteger value from an attribute.
  *
  * The @code element@ parameter specifies which value to get from 0 to
- * @link ippGetCount(attr)@ - 1.
+ * @code ippGetCount(attr)@ - 1.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - Lower value of range or 0 */
@@ -2462,7 +2454,7 @@ ippGetRange(ipp_attribute_t *attr,        /* I - IPP attribute */
 /*
  * 'ippGetRequestId()' - Get the request ID from an IPP message.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - Request ID or 0 on error */
@@ -2487,9 +2479,9 @@ ippGetRequestId(ipp_t *ipp)               /* I - IPP message */
  * 'ippGetResolution()' - Get a resolution value for an attribute.
  *
  * The @code element@ parameter specifies which value to get from 0 to
- * @link ippGetCount(attr)@ - 1.
+ * @code ippGetCount(attr)@ - 1.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - Horizontal/cross feed resolution or 0 */
@@ -2532,7 +2524,7 @@ ippGetResolution(
 /*
  * 'ippGetState()' - Get the IPP message state.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_state_t                            /* O - IPP message state value */
@@ -2556,7 +2548,7 @@ ippGetState(ipp_t *ipp)                   /* I - IPP message */
 /*
  * 'ippGetStatusCode()' - Get the status code from an IPP response or event message.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_status_t                           /* O - Status code in IPP message */
@@ -2581,9 +2573,9 @@ ippGetStatusCode(ipp_t *ipp)              /* I - IPP response or event message */
  * 'ippGetString()' - Get the string and optionally the language code for an attribute.
  *
  * The @code element@ parameter specifies which value to get from 0 to
- * @link ippGetCount(attr)@ - 1.
+ * @code ippGetCount(attr)@ - 1.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 const char *
@@ -2591,13 +2583,16 @@ ippGetString(ipp_attribute_t *attr,     /* I - IPP attribute */
              int             element,  /* I - Value number (0-based) */
             const char      **language)/* O - Language code (@code NULL@ for don't care) */
 {
+  ipp_tag_t    tag;                    /* Value tag */
+
+
  /*
   * Range check input...
   */
 
-  if (!attr || element < 0 || element >= attr->num_values ||
-      (attr->value_tag != IPP_TAG_TEXTLANG && attr->value_tag != IPP_TAG_NAMELANG &&
-       (attr->value_tag < IPP_TAG_TEXT || attr->value_tag > IPP_TAG_MIMETYPE)))
+  tag = ippGetValueTag(attr);
+
+  if (!attr || element < 0 || element >= attr->num_values || (tag != IPP_TAG_TEXTLANG && tag != IPP_TAG_NAMELANG && (tag < IPP_TAG_TEXT || tag > IPP_TAG_MIMETYPE)))
     return (NULL);
 
  /*
@@ -2614,7 +2609,7 @@ ippGetString(ipp_attribute_t *attr,       /* I - IPP attribute */
 /*
  * 'ippGetValueTag()' - Get the value tag for an attribute.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_tag_t                              /* O - Value tag or @code IPP_TAG_ZERO@ on error */
@@ -2638,12 +2633,12 @@ ippGetValueTag(ipp_attribute_t *attr)   /* I - IPP attribute */
 /*
  * 'ippGetVersion()' - Get the major and minor version number from an IPP message.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - Major version number or 0 on error */
 ippGetVersion(ipp_t *ipp,              /* I - IPP message */
-              int   *minor)            /* O - Minor version number or @code NULL@ */
+              int   *minor)            /* O - Minor version number or @code NULL@ for don't care */
 {
  /*
   * Range check input...
@@ -2682,7 +2677,7 @@ ippLength(ipp_t *ipp)                     /* I - IPP message */
 /*
  * 'ippNextAttribute()' - Return the next attribute in the message.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 ipp_attribute_t *                      /* O - Next attribute or @code NULL@ if none */
@@ -2723,6 +2718,8 @@ ippNew(void)
     * Set default version - usually 2.0...
     */
 
+    DEBUG_printf(("4debug_alloc: %p IPP message", (void *)temp));
+
     if (cg->server_version == 0)
       _cupsSetDefaults();
 
@@ -2731,7 +2728,7 @@ ippNew(void)
     temp->use                    = 1;
   }
 
-  DEBUG_printf(("1ippNew: Returning %p", temp));
+  DEBUG_printf(("1ippNew: Returning %p", (void *)temp));
 
   return (temp);
 }
@@ -2740,11 +2737,11 @@ ippNew(void)
 /*
  *  'ippNewRequest()' - Allocate a new IPP request message.
  *
- * The new request message is initialized with the attributes-charset and
- * attributes-natural-language attributes added. The
- * attributes-natural-language value is derived from the current locale.
+ * The new request message is initialized with the "attributes-charset" and
+ * "attributes-natural-language" attributes added. The
+ * "attributes-natural-language" value is derived from the current locale.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 ipp_t *                                        /* O - IPP request message */
@@ -2804,14 +2801,14 @@ ippNewRequest(ipp_op_t op)              /* I - Operation code */
 /*
  * 'ippNewResponse()' - Allocate a new IPP response message.
  *
- * The new response message is initialized with the same version-number,
- * request-id, attributes-charset, and attributes-natural-language as the
- * provided request message.  If the attributes-charset or
- * attributes-natural-language attributes are missing from the request,
- * "utf-8" and a value derived from the current locale are substituted,
+ * The new response message is initialized with the same "version-number",
+ * "request-id", "attributes-charset", and "attributes-natural-language" as the
+ * provided request message.  If the "attributes-charset" or
+ * "attributes-natural-language" attributes are missing from the request,
+ * 'utf-8' and a value derived from the current locale are substituted,
  * respectively.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 ipp_t *                                        /* O - IPP response message */
@@ -2917,14 +2914,12 @@ ipp_state_t                             /* O - Current state */
 ippRead(http_t *http,                  /* I - HTTP connection */
         ipp_t  *ipp)                   /* I - IPP data */
 {
-  DEBUG_printf(("ippRead(http=%p, ipp=%p), data_remaining=" CUPS_LLFMT,
-                http, ipp, CUPS_LLCAST (http ? http->data_remaining : -1)));
+  DEBUG_printf(("ippRead(http=%p, ipp=%p), data_remaining=" CUPS_LLFMT, (void *)http, (void *)ipp, CUPS_LLCAST (http ? http->data_remaining : -1)));
 
   if (!http)
     return (IPP_STATE_ERROR);
 
-  DEBUG_printf(("2ippRead: http->state=%d, http->used=%d", http->state,
-                http->used));
+  DEBUG_printf(("2ippRead: http->state=%d, http->used=%d", http->state, http->used));
 
   return (ippReadIO(http, (ipp_iocb_t)ipp_read_http, http->blocking, NULL,
                     ipp));
@@ -2934,14 +2929,14 @@ ippRead(http_t *http,                   /* I - HTTP connection */
 /*
  * 'ippReadFile()' - Read data for an IPP message from a file.
  *
- * @since CUPS 1.1.19/OS X 10.3@
+ * @since CUPS 1.1.19/macOS 10.3@
  */
 
 ipp_state_t                            /* O - Current state */
 ippReadFile(int   fd,                  /* I - HTTP data */
             ipp_t *ipp)                        /* I - IPP data */
 {
-  DEBUG_printf(("ippReadFile(fd=%d, ipp=%p)", fd, ipp));
+  DEBUG_printf(("ippReadFile(fd=%d, ipp=%p)", fd, (void *)ipp));
 
   return (ippReadIO(&fd, (ipp_iocb_t)ipp_read_file, 1, NULL, ipp));
 }
@@ -2950,7 +2945,7 @@ ippReadFile(int   fd,                     /* I - HTTP data */
 /*
  * 'ippReadIO()' - Read data for an IPP message.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 ipp_state_t                            /* O - Current state */
@@ -2971,8 +2966,7 @@ ippReadIO(void       *src,                /* I - Data source */
   _ipp_value_t         *value;         /* Current value */
 
 
-  DEBUG_printf(("ippReadIO(src=%p, cb=%p, blocking=%d, parent=%p, ipp=%p)",
-                src, cb, blocking, parent, ipp));
+  DEBUG_printf(("ippReadIO(src=%p, cb=%p, blocking=%d, parent=%p, ipp=%p)", (void *)src, (void *)cb, blocking, (void *)parent, (void *)ipp));
   DEBUG_printf(("2ippReadIO: ipp->state=%d", ipp ? ipp->state : IPP_STATE_ERROR));
 
   if (!src || !ipp)
@@ -3042,8 +3036,7 @@ ippReadIO(void       *src,                /* I - Data source */
            return (IPP_STATE_ERROR);
          }
 
-         DEBUG_printf(("2ippReadIO: ipp->current=%p, ipp->prev=%p",
-                       ipp->current, ipp->prev));
+         DEBUG_printf(("2ippReadIO: ipp->current=%p, ipp->prev=%p", (void *)ipp->current, (void *)ipp->prev));
 
         /*
          * Read this attribute...
@@ -3103,8 +3096,7 @@ ippReadIO(void       *src,                /* I - Data source */
 
            ipp->curtag  = tag;
            ipp->current = NULL;
-           DEBUG_printf(("2ippReadIO: group tag=%x(%s), ipp->prev=%p", tag,
-                         ippTagString(tag), ipp->prev));
+           DEBUG_printf(("2ippReadIO: group tag=%x(%s), ipp->prev=%p", tag, ippTagString(tag), (void *)ipp->prev));
            continue;
          }
 
@@ -3275,8 +3267,7 @@ ippReadIO(void       *src,                /* I - Data source */
              return (IPP_STATE_ERROR);
            }
 
-           DEBUG_printf(("2ippReadIO: membername, ipp->current=%p, ipp->prev=%p",
-                         ipp->current, ipp->prev));
+           DEBUG_printf(("2ippReadIO: membername, ipp->current=%p, ipp->prev=%p", (void *)ipp->current, (void *)ipp->prev));
 
            value = attr->values;
          }
@@ -3307,8 +3298,7 @@ ippReadIO(void       *src,                /* I - Data source */
              return (IPP_STATE_ERROR);
            }
 
-           DEBUG_printf(("2ippReadIO: name=\"%s\", ipp->current=%p, "
-                         "ipp->prev=%p", buffer, ipp->current, ipp->prev));
+           DEBUG_printf(("2ippReadIO: name=\"%s\", ipp->current=%p, ipp->prev=%p", buffer, (void *)ipp->current, (void *)ipp->prev));
 
            value = attr->values;
          }
@@ -3731,9 +3721,9 @@ ippReadIO(void       *src,                /* I - Data source */
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -3773,9 +3763,9 @@ ippSetBoolean(ipp_t           *ipp,       /* I  - IPP message */
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -3814,7 +3804,7 @@ ippSetCollection(
 
 
 /*
- * 'ippSetDate()' - Set a date value in an attribute.
+ * 'ippSetDate()' - Set a dateTime value in an attribute.
  *
  * The @code ipp@ parameter refers to an IPP message previously created using
  * the @link ippNew@, @link ippNewRequest@, or  @link ippNewResponse@ functions.
@@ -3822,16 +3812,16 @@ ippSetCollection(
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
 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 */
+           const ipp_uchar_t *datevalue)/* I  - dateTime value */
 {
   _ipp_value_t *value;                 /* Current value */
 
@@ -3869,7 +3859,7 @@ ippSetDate(ipp_t             *ipp,        /* I  - IPP message */
  * (@code IPP_TAG_OPERATION@), printer (@code IPP_TAG_PRINTER@), subscription
  * (@code IPP_TAG_SUBSCRIPTION@), or unsupported (@code IPP_TAG_UNSUPPORTED_GROUP@).
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -3879,7 +3869,7 @@ ippSetGroupTag(
     ipp_tag_t       group_tag)         /* I  - Group tag */
 {
  /*
-  * Range check input - group tag must be 0x01 to 0x0F, per RFC 2911...
+  * Range check input - group tag must be 0x01 to 0x0F, per RFC 8011...
   */
 
   if (!ipp || !attr || !*attr ||
@@ -3906,9 +3896,9 @@ ippSetGroupTag(
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -3948,7 +3938,7 @@ ippSetInteger(ipp_t           *ipp,       /* I  - IPP message */
  *
  * The @code attr@ parameter may be modified as a result of setting the value.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -3991,9 +3981,9 @@ ippSetName(ipp_t           *ipp,  /* I  - IPP message */
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -4076,7 +4066,7 @@ ippSetOctetString(
  * The @code ipp@ parameter refers to an IPP message previously created using
  * the @link ippNew@, @link ippNewRequest@, or  @link ippNewResponse@ functions.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -4109,9 +4099,9 @@ ippSetOperation(ipp_t    *ipp,            /* I - IPP request message */
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -4154,7 +4144,7 @@ ippSetRange(ipp_t           *ipp, /* I  - IPP message */
  *
  * The @code request_id@ parameter must be greater than 0.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -4189,9 +4179,9 @@ ippSetRequestId(ipp_t *ipp,               /* I - IPP message */
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -4233,7 +4223,7 @@ ippSetResolution(
 /*
  * 'ippSetState()' - Set the current state of the IPP message.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -4264,7 +4254,7 @@ ippSetState(ipp_t       *ipp,             /* I - IPP message */
  * The @code ipp@ parameter refers to an IPP message previously created using
  * the @link ippNew@, @link ippNewRequest@, or  @link ippNewResponse@ functions.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -4297,9 +4287,9 @@ ippSetStatusCode(ipp_t        *ipp,       /* I - IPP response or event message */
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -4359,14 +4349,14 @@ ippSetString(ipp_t           *ipp,      /* I  - IPP message */
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
  * The @code format@ parameter uses formatting characters compatible with the
  * printf family of standard functions.  Additional arguments follow it as
  * needed.  The formatted string is truncated as needed to the maximum length of
  * the corresponding value type.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -4397,14 +4387,14 @@ ippSetStringf(ipp_t           *ipp,     /* I  - IPP message */
  * 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)@.
+ * @code ippGetCount(attr)@.
  *
  * The @code format@ parameter uses formatting characters compatible with the
  * printf family of standard functions.  Additional arguments follow it as
  * needed.  The formatted string is truncated as needed to the maximum length of
  * the corresponding value type.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -4556,7 +4546,7 @@ ippSetStringfv(ipp_t           *ipp,      /* I  - IPP message */
  * code in the "attributes-natural-language" attribute or, if not present, the language
  * code for the current locale.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
@@ -4713,7 +4703,7 @@ ippSetValueTag(
  *
  * The valid version numbers are currently 1.0, 1.1, 2.0, 2.1, and 2.2.
  *
- * @since CUPS 1.6/OS X 10.8@
+ * @since CUPS 1.6/macOS 10.8@
  */
 
 int                                    /* O - 1 on success, 0 on failure */
@@ -4740,19 +4730,19 @@ ippSetVersion(ipp_t *ipp,               /* I - IPP message */
 
 
 /*
- * 'ippTimeToDate()' - Convert from UNIX time to RFC 1903 format.
+ * 'ippTimeToDate()' - Convert from time in seconds to RFC 2579 format.
  */
 
-const ipp_uchar_t *                    /* O - RFC-1903 date/time data */
-ippTimeToDate(time_t t)                        /* I - UNIX time value */
+const ipp_uchar_t *                    /* O - RFC-2579 date/time data */
+ippTimeToDate(time_t t)                        /* I - Time in seconds */
 {
   struct tm    *unixdate;              /* UNIX unixdate/time info */
   ipp_uchar_t  *date = _cupsGlobals()->ipp_date;
-                                       /* RFC-1903 date/time data */
+                                       /* RFC-2579 date/time data */
 
 
  /*
-  * RFC-1903 date/time format is:
+  * RFC-2579 date/time format is:
   *
   *    Byte(s)  Description
   *    -------  -----------
@@ -4792,9 +4782,9 @@ ippTimeToDate(time_t t)                   /* I - UNIX time value */
  *
  * This function validates the contents of an attribute based on the name and
  * value tag.  1 is returned if the attribute is valid, 0 otherwise.  On
- * failure, cupsLastErrorString() is set to a human-readable message.
+ * failure, @link cupsLastErrorString@ is set to a human-readable message.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 int                                    /* O - 1 if valid, 0 otherwise */
@@ -4848,7 +4838,7 @@ ippValidateAttribute(
   {
     ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                   _("\"%s\": Bad attribute name - invalid character "
-                   "(RFC 2911 section 4.1.3)."), attr->name);
+                   "(RFC 8011 section 5.1.4)."), attr->name);
     return (0);
   }
 
@@ -4856,7 +4846,7 @@ ippValidateAttribute(
   {
     ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                   _("\"%s\": Bad attribute name - bad length %d "
-                   "(RFC 2911 section 4.1.3)."), attr->name,
+                   "(RFC 8011 section 5.1.4)."), attr->name,
                  (int)(ptr - attr->name));
     return (0);
   }
@@ -4874,7 +4864,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                           _("\"%s\": Bad boolen value %d "
-                           "(RFC 2911 section 4.1.11)."), attr->name,
+                           "(RFC 8011 section 5.1.21)."), attr->name,
                          attr->values[i].boolean);
            return (0);
          }
@@ -4888,7 +4878,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad enum value %d - out of range "
-                           "(RFC 2911 section 4.1.4)."), attr->name,
+                           "(RFC 8011 section 5.1.5)."), attr->name,
                            attr->values[i].integer);
             return (0);
          }
@@ -4902,7 +4892,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad octetString value - bad length %d "
-                           "(RFC 2911 section 4.1.10)."), attr->name,
+                           "(RFC 8011 section 5.1.20)."), attr->name,
                            attr->values[i].unknown.length);
            return (0);
          }
@@ -4918,7 +4908,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime month %u "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[2]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[2]);
            return (0);
          }
 
@@ -4926,7 +4916,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime day %u "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[3]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[3]);
            return (0);
          }
 
@@ -4934,7 +4924,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime hours %u "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[4]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[4]);
            return (0);
          }
 
@@ -4942,7 +4932,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime minutes %u "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[5]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[5]);
            return (0);
          }
 
@@ -4950,7 +4940,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime seconds %u "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[6]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[6]);
            return (0);
          }
 
@@ -4958,7 +4948,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime deciseconds %u "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[7]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[7]);
            return (0);
          }
 
@@ -4966,7 +4956,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime UTC sign '%c' "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[8]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[8]);
            return (0);
          }
 
@@ -4974,7 +4964,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime UTC hours %u "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[9]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[9]);
            return (0);
          }
 
@@ -4982,7 +4972,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad dateTime UTC minutes %u "
-                           "(RFC 2911 section 4.1.14)."), attr->name, date[10]);
+                           "(RFC 8011 section 5.1.15)."), attr->name, date[10]);
            return (0);
          }
        }
@@ -4996,7 +4986,7 @@ ippValidateAttribute(
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad resolution value %dx%d%s - cross "
                            "feed resolution must be positive "
-                           "(RFC 2911 section 4.1.15)."), attr->name,
+                           "(RFC 8011 section 5.1.16)."), attr->name,
                          attr->values[i].resolution.xres,
                          attr->values[i].resolution.yres,
                          attr->values[i].resolution.units ==
@@ -5011,7 +5001,7 @@ ippValidateAttribute(
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad resolution value %dx%d%s - feed "
                            "resolution must be positive "
-                           "(RFC 2911 section 4.1.15)."), attr->name,
+                           "(RFC 8011 section 5.1.16)."), attr->name,
                          attr->values[i].resolution.xres,
                          attr->values[i].resolution.yres,
                          attr->values[i].resolution.units ==
@@ -5026,7 +5016,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad resolution value %dx%d%s - bad "
-                           "units value (RFC 2911 section 4.1.15)."),
+                           "units value (RFC 8011 section 5.1.16)."),
                          attr->name, attr->values[i].resolution.xres,
                          attr->values[i].resolution.yres,
                          attr->values[i].resolution.units ==
@@ -5045,7 +5035,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad rangeOfInteger value %d-%d - lower "
-                           "greater than upper (RFC 2911 section 4.1.13)."),
+                           "greater than upper (RFC 8011 section 5.1.14)."),
                          attr->name, attr->values[i].range.lower,
                          attr->values[i].range.upper);
            return (0);
@@ -5107,7 +5097,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad text value \"%s\" - bad UTF-8 "
-                           "sequence (RFC 2911 section 4.1.1)."), attr->name,
+                           "sequence (RFC 8011 section 5.1.2)."), attr->name,
                          attr->values[i].string.text);
            return (0);
          }
@@ -5116,7 +5106,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad text value \"%s\" - bad length %d "
-                           "(RFC 2911 section 4.1.1)."), attr->name,
+                           "(RFC 8011 section 5.1.2)."), attr->name,
                          attr->values[i].string.text,
                          (int)(ptr - attr->values[i].string.text));
            return (0);
@@ -5165,7 +5155,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad name value \"%s\" - bad UTF-8 "
-                           "sequence (RFC 2911 section 4.1.2)."), attr->name,
+                           "sequence (RFC 8011 section 5.1.3)."), attr->name,
                          attr->values[i].string.text);
            return (0);
          }
@@ -5174,7 +5164,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad name value \"%s\" - bad length %d "
-                           "(RFC 2911 section 4.1.2)."), attr->name,
+                           "(RFC 8011 section 5.1.3)."), attr->name,
                          attr->values[i].string.text,
                          (int)(ptr - attr->values[i].string.text));
            return (0);
@@ -5194,7 +5184,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad keyword value \"%s\" - invalid "
-                           "character (RFC 2911 section 4.1.3)."),
+                           "character (RFC 8011 section 5.1.4)."),
                          attr->name, attr->values[i].string.text);
            return (0);
          }
@@ -5203,7 +5193,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad keyword value \"%s\" - bad "
-                           "length %d (RFC 2911 section 4.1.3)."),
+                           "length %d (RFC 8011 section 5.1.4)."),
                          attr->name, attr->values[i].string.text,
                          (int)(ptr - attr->values[i].string.text));
            return (0);
@@ -5225,7 +5215,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad URI value \"%s\" - %s "
-                           "(RFC 2911 section 4.1.5)."), attr->name,
+                           "(RFC 8011 section 5.1.6)."), attr->name,
                          attr->values[i].string.text,
                          uri_status_strings[uri_status -
                                             HTTP_URI_STATUS_OVERFLOW]);
@@ -5236,7 +5226,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad URI value \"%s\" - bad length %d "
-                           "(RFC 2911 section 4.1.5)."), attr->name,
+                           "(RFC 8011 section 5.1.6)."), attr->name,
                          attr->values[i].string.text,
                          (int)strlen(attr->values[i].string.text));
          }
@@ -5259,7 +5249,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad uriScheme value \"%s\" - bad "
-                           "characters (RFC 2911 section 4.1.6)."),
+                           "characters (RFC 8011 section 5.1.7)."),
                          attr->name, attr->values[i].string.text);
            return (0);
          }
@@ -5268,7 +5258,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad uriScheme value \"%s\" - bad "
-                           "length %d (RFC 2911 section 4.1.6)."),
+                           "length %d (RFC 8011 section 5.1.7)."),
                          attr->name, attr->values[i].string.text,
                          (int)(ptr - attr->values[i].string.text));
            return (0);
@@ -5288,7 +5278,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad charset value \"%s\" - bad "
-                           "characters (RFC 2911 section 4.1.7)."),
+                           "characters (RFC 8011 section 5.1.8)."),
                          attr->name, attr->values[i].string.text);
            return (0);
          }
@@ -5297,7 +5287,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad charset value \"%s\" - bad "
-                           "length %d (RFC 2911 section 4.1.7)."),
+                           "length %d (RFC 8011 section 5.1.8)."),
                          attr->name, attr->values[i].string.text,
                          (int)(ptr - attr->values[i].string.text));
            return (0);
@@ -5343,7 +5333,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad naturalLanguage value \"%s\" - bad "
-                           "characters (RFC 2911 section 4.1.8)."),
+                           "characters (RFC 8011 section 5.1.9)."),
                          attr->name, attr->values[i].string.text);
            regfree(&re);
            return (0);
@@ -5353,7 +5343,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad naturalLanguage value \"%s\" - bad "
-                           "length %d (RFC 2911 section 4.1.8)."),
+                           "length %d (RFC 8011 section 5.1.9)."),
                          attr->name, attr->values[i].string.text,
                          (int)strlen(attr->values[i].string.text));
            regfree(&re);
@@ -5397,7 +5387,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad mimeMediaType value \"%s\" - bad "
-                           "characters (RFC 2911 section 4.1.9)."),
+                           "characters (RFC 8011 section 5.1.10)."),
                          attr->name, attr->values[i].string.text);
            regfree(&re);
            return (0);
@@ -5407,7 +5397,7 @@ ippValidateAttribute(
          {
            ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST,
                          _("\"%s\": Bad mimeMediaType value \"%s\" - bad "
-                           "length %d (RFC 2911 section 4.1.9)."),
+                           "length %d (RFC 8011 section 5.1.10)."),
                          attr->name, attr->values[i].string.text,
                          (int)strlen(attr->values[i].string.text));
            regfree(&re);
@@ -5430,10 +5420,10 @@ ippValidateAttribute(
  * 'ippValidateAttributes()' - Validate all attributes in an IPP message.
  *
  * This function validates the contents of the IPP message, including each
- * attribute.  Like @link ippValidateAttribute@, cupsLastErrorString() is set
- * to a human-readable message on failure.
+ * attribute.  Like @link ippValidateAttribute@, @link cupsLastErrorString@ is
+ * set to a human-readable message on failure.
  *
- * @since CUPS 1.7/OS X 10.9@
+ * @since CUPS 1.7/macOS 10.9@
  */
 
 int                                    /* O - 1 if valid, 0 otherwise */
@@ -5461,7 +5451,7 @@ ipp_state_t                               /* O - Current state */
 ippWrite(http_t *http,                 /* I - HTTP connection */
          ipp_t  *ipp)                  /* I - IPP data */
 {
-  DEBUG_printf(("ippWrite(http=%p, ipp=%p)", http, ipp));
+  DEBUG_printf(("ippWrite(http=%p, ipp=%p)", (void *)http, (void *)ipp));
 
   if (!http)
     return (IPP_STATE_ERROR);
@@ -5473,14 +5463,14 @@ ippWrite(http_t *http,                  /* I - HTTP connection */
 /*
  * 'ippWriteFile()' - Write data for an IPP message to a file.
  *
- * @since CUPS 1.1.19/OS X 10.3@
+ * @since CUPS 1.1.19/macOS 10.3@
  */
 
 ipp_state_t                            /* O - Current state */
 ippWriteFile(int   fd,                 /* I - HTTP data */
              ipp_t *ipp)               /* I - IPP data */
 {
-  DEBUG_printf(("ippWriteFile(fd=%d, ipp=%p)", fd, ipp));
+  DEBUG_printf(("ippWriteFile(fd=%d, ipp=%p)", fd, (void *)ipp));
 
   ipp->state = IPP_STATE_IDLE;
 
@@ -5491,7 +5481,7 @@ ippWriteFile(int   fd,                    /* I - HTTP data */
 /*
  * 'ippWriteIO()' - Write data for an IPP message.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 ipp_state_t                            /* O - Current state */
@@ -5509,8 +5499,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
   _ipp_value_t         *value;         /* Current value */
 
 
-  DEBUG_printf(("ippWriteIO(dst=%p, cb=%p, blocking=%d, parent=%p, ipp=%p)",
-                dst, cb, blocking, parent, ipp));
+  DEBUG_printf(("ippWriteIO(dst=%p, cb=%p, blocking=%d, parent=%p, ipp=%p)", (void *)dst, (void *)cb, blocking, (void *)parent, (void *)ipp));
 
   if (!dst || !ipp)
     return (IPP_STATE_ERROR);
@@ -5572,7 +5561,7 @@ ippWriteIO(void       *dst,               /* I - Destination */
        ipp->current = ipp->attrs;
        ipp->curtag  = IPP_TAG_ZERO;
 
-       DEBUG_printf(("1ippWriteIO: ipp->current=%p", ipp->current));
+       DEBUG_printf(("1ippWriteIO: ipp->current=%p", (void *)ipp->current));
 
        /*
         * If blocking is disabled, stop here...
@@ -6401,8 +6390,7 @@ ipp_add_attr(ipp_t      *ipp,             /* I - IPP message */
   ipp_attribute_t      *attr;          /* New attribute */
 
 
-  DEBUG_printf(("4ipp_add_attr(ipp=%p, name=\"%s\", group_tag=0x%x, value_tag=0x%x, "
-                "num_values=%d)", ipp, name, group_tag, value_tag, num_values));
+  DEBUG_printf(("4ipp_add_attr(ipp=%p, name=\"%s\", group_tag=0x%x, value_tag=0x%x, num_values=%d)", (void *)ipp, name, group_tag, value_tag, num_values));
 
  /*
   * Range check input...
@@ -6429,6 +6417,8 @@ ipp_add_attr(ipp_t      *ipp,             /* I - IPP message */
     * Initialize attribute...
     */
 
+    DEBUG_printf(("4debug_alloc: %p %s %s%s (%d values)", (void *)attr, name, num_values > 1 ? "1setOf " : "", ippTagString(value_tag), num_values));
+
     if (name)
       attr->name = _cupsStrAlloc(name);
 
@@ -6449,7 +6439,7 @@ ipp_add_attr(ipp_t      *ipp,             /* I - IPP message */
     ipp->last = ipp->current = attr;
   }
 
-  DEBUG_printf(("5ipp_add_attr: Returning %p", attr));
+  DEBUG_printf(("5ipp_add_attr: Returning %p", (void *)attr));
 
   return (attr);
 }
@@ -6468,8 +6458,7 @@ ipp_free_values(ipp_attribute_t *attr,    /* I - Attribute to free values from */
   _ipp_value_t *value;                 /* Current value */
 
 
-  DEBUG_printf(("4ipp_free_values(attr=%p, element=%d, count=%d)", attr,
-                element, count));
+  DEBUG_printf(("4ipp_free_values(attr=%p, element=%d, count=%d)", (void *)attr, element, count));
 
   if (!(attr->value_tag & IPP_TAG_CUPS_CONST))
   {
@@ -6638,7 +6627,7 @@ ipp_length(ipp_t *ipp,                    /* I - IPP message or collection */
   _ipp_value_t         *value;         /* Current value */
 
 
-  DEBUG_printf(("3ipp_length(ipp=%p, collection=%d)", ipp, collection));
+  DEBUG_printf(("3ipp_length(ipp=%p, collection=%d)", (void *)ipp, collection));
 
   if (!ipp)
   {
@@ -6798,8 +6787,7 @@ ipp_read_http(http_t      *http,  /* I - Client connection */
                bytes;                  /* Bytes read this pass */
 
 
-  DEBUG_printf(("7ipp_read_http(http=%p, buffer=%p, length=%d)",
-                http, buffer, (int)length));
+  DEBUG_printf(("7ipp_read_http(http=%p, buffer=%p, length=%d)", (void *)http, (void *)buffer, (int)length));
 
  /*
   * Loop until all bytes are read...
@@ -6830,6 +6818,22 @@ ipp_read_http(http_t      *http, /* I - Client connection */
        break;
       }
     }
+    else if (http->used == 0 && http->timeout_value > 0)
+    {
+     /*
+      * Wait up to timeout seconds for more data on blocking sockets...
+      */
+
+      if (!httpWait(http, (int)(1000 * http->timeout_value)))
+      {
+       /*
+       * Signal no data...
+       */
+
+       bytes = -1;
+       break;
+      }
+    }
 
     if ((bytes = httpRead2(http, (char *)buffer, length - (size_t)tbytes)) < 0)
     {
@@ -6971,6 +6975,9 @@ ipp_set_value(ipp_t           *ipp,       /* IO - IPP message */
     * Reset pointers in the list...
     */
 
+    DEBUG_printf(("4debug_free: %p %s", (void *)*attr, temp->name));
+    DEBUG_printf(("4debug_alloc: %p %s %s%s (%d)", (void *)temp, temp->name, temp->num_values > 1 ? "1setOf " : "", ippTagString(temp->value_tag), temp->num_values));
+
     if (ipp->current == *attr && ipp->prev)
     {
      /*
@@ -7043,8 +7050,3 @@ ipp_write_file(int         *fd,           /* I - File descriptor */
   return (write(*fd, buffer, length));
 #endif /* WIN32 */
 }
-
-
-/*
- * End of "$Id$".
- */