]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ipp.c
Import CUPS v2.0.2
[thirdparty/cups.git] / cups / ipp.c
index cc5eebcf89b80e859ffae25dce211521a290e9ed..6ef17ecd7685a5014a44ffcee53e448379a5e36b 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: ipp.c 12093 2014-08-19 12:10:17Z msweet $"
+ * "$Id: ipp.c 12469 2015-02-01 04:51:08Z msweet $"
  *
  * Internet Printing Protocol functions for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -2032,7 +2032,7 @@ 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))",
@@ -6675,7 +6675,7 @@ ipp_length(ipp_t *ipp,                    /* I - IPP message or collection */
     DEBUG_printf(("5ipp_length: attr->name=\"%s\", attr->num_values=%d, "
                   "bytes=" CUPS_LLFMT, attr->name, attr->num_values, CUPS_LLCAST bytes));
 
-    if (attr->value_tag < IPP_TAG_EXTENSION)
+    if ((attr->value_tag & ~IPP_TAG_CUPS_CONST) < IPP_TAG_EXTENSION)
       bytes += (size_t)attr->num_values;/* Value tag for each value */
     else
       bytes += (size_t)(5 * attr->num_values);
@@ -6830,6 +6830,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)
     {
@@ -7046,5 +7062,5 @@ ipp_write_file(int         *fd,           /* I - File descriptor */
 
 
 /*
- * End of "$Id: ipp.c 12093 2014-08-19 12:10:17Z msweet $".
+ * End of "$Id: ipp.c 12469 2015-02-01 04:51:08Z msweet $".
  */