]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 26 Mar 2003 20:31:57 +0000 (20:31 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 26 Mar 2003 20:31:57 +0000 (20:31 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3525 7a7537e8-13f0-0310-91df-b6672ffda945

cups/ipp.c
cups/testipp.c

index 1cca402adc289b0a7edafdbbef5fee04d61d361c..c6372a6205bfeea1d5a21c030e6cfd5713ecf90c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.55.2.32 2003/03/26 20:20:18 mike Exp $"
+ * "$Id: ipp.c,v 1.55.2.33 2003/03/26 20:31:56 mike Exp $"
  *
  *   Internet Printing Protocol support functions for the Common UNIX
  *   Printing System (CUPS).
@@ -2351,12 +2351,15 @@ ipp_length(ipp_t *ipp,                          /* I - IPP request or collection */
   }
 
  /*
-  * Finally, add 1 byte for the "end of attributes/collection" tag and return...
+  * Finally, add 1 byte for the "end of attributes" tag and return...
   */
 
-  DEBUG_printf(("bytes = %d\n", bytes + 1));
+  if (!collection)
+    bytes ++;
 
-  return (bytes + 1);
+  DEBUG_printf(("bytes = %d\n", bytes));
+
+  return (bytes);
 }
 
 
@@ -2474,5 +2477,5 @@ ipp_write_file(int         *fd,                   /* I - File descriptor */
 
 
 /*
- * End of "$Id: ipp.c,v 1.55.2.32 2003/03/26 20:20:18 mike Exp $".
+ * End of "$Id: ipp.c,v 1.55.2.33 2003/03/26 20:31:56 mike Exp $".
  */
index 3fe5780f6e29fed54af9690bc88662895faf156f..9bb90c464859b8070330b0114653bc85813accc7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testipp.c,v 1.1.2.1 2003/03/21 18:07:34 mike Exp $"
+ * "$Id: testipp.c,v 1.1.2.2 2003/03/26 20:31:57 mike Exp $"
  *
  *   IPP test program for the Common UNIX Printing System (CUPS).
  *
@@ -89,6 +89,7 @@ main(int  argc,                       /* I - Number of command-line arguments */
   ipp_t                *col;           /* Collection */
   ipp_t                *request;       /* Request */
   ipp_state_t  state;          /* State */
+  int          length;         /* Length of data */
 
 
   request = ippNew();
@@ -101,6 +102,11 @@ main(int  argc,                    /* I - Number of command-line arguments */
   ippAddString(col, IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-color", NULL, "blue");
   ippAddCollection(request, IPP_TAG_JOB, "media-col", col);
 
+  length = ippLength(request);
+  if (length != sizeof(collection))
+    printf("ERROR ippLength didn't compute the correct length (%d instead of %d bytes!)\n",
+           length, sizeof(collection));
+
   wused = 0;
   while ((state = ippWriteIO(wbuffer, write_cb, 1, NULL, request)) != IPP_DATA)
     if (state == IPP_ERROR)
@@ -212,5 +218,5 @@ write_cb(void        *data,
 
 
 /*
- * End of "$Id: testipp.c,v 1.1.2.1 2003/03/21 18:07:34 mike Exp $".
+ * End of "$Id: testipp.c,v 1.1.2.2 2003/03/26 20:31:57 mike Exp $".
  */