#
-# "$Id: Makefile,v 1.53.2.22 2003/03/12 20:40:10 mike Exp $"
+# "$Id: Makefile,v 1.53.2.23 2003/03/20 02:45:47 mike Exp $"
#
# API library Makefile for the Common UNIX Printing System (CUPS).
#
http-support.o ipp.o ipp-support.o langprintf.o language.o \
mark.o md5.o md5passwd.o normalize.o options.o page.o ppd.o \
snprintf.o string.o tempfile.o transcode.o usersys.o util.o
-OBJS = $(LIBOBJS) testhttp.o testi18n.o testlang.o
+OBJS = $(LIBOBJS) testhttp.o testi18n.o testipp.o testlang.o
#
#
TARGETS = $(LIBCUPS) libcups.a \
- testhttp testi18n testlang
+ testhttp testi18n testipp testlang
#
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a $(NETLIBS) $(SSLLIBS) $(COMMONLIBS)
+#
+# testipp (dependency on static CUPS library is intentional)
+#
+
+testipp: testipp.o libcups.a
+ echo Linking $@...
+ $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a $(NETLIBS) $(SSLLIBS) $(COMMONLIBS)
+
+
#
# testi18n (dependency on static CUPS library is intentional)
#
#
-# End of "$Id: Makefile,v 1.53.2.22 2003/03/12 20:40:10 mike Exp $".
+# End of "$Id: Makefile,v 1.53.2.23 2003/03/20 02:45:47 mike Exp $".
#
/*
- * "$Id: ipp.c,v 1.55.2.30 2003/03/14 22:14:32 mike Exp $"
+ * "$Id: ipp.c,v 1.55.2.31 2003/03/20 02:45:48 mike Exp $"
*
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
DEBUG_printf(("ippReadIO: name length = %d\n", n));
- if (n == 0)
+ if (n == 0 && tag != IPP_TAG_MEMBERNAME)
{
/*
* More values for current attribute...
* type...
*/
- if (attr->value_tag == IPP_TAG_STRING ||
- (attr->value_tag >= IPP_TAG_TEXTLANG &&
- attr->value_tag <= IPP_TAG_MIMETYPE))
+ if (attr->value_tag == IPP_TAG_ZERO)
+ {
+ attr->value_tag = tag;
+ }
+ else if (attr->value_tag == IPP_TAG_STRING ||
+ (attr->value_tag >= IPP_TAG_TEXTLANG &&
+ attr->value_tag <= IPP_TAG_MIMETYPE))
{
/*
* String values can sometimes come across in different
return (IPP_ERROR);
}
else if (attr->value_tag != tag &&
- attr->value_tag != IPP_TAG_MEMBERNAME &&
tag != IPP_TAG_END_COLLECTION)
return (IPP_ERROR);
* Finally, reallocate the attribute array as needed...
*/
- if ((attr->num_values % IPP_MAX_VALUES) == 0)
+ if ((attr->num_values % IPP_MAX_VALUES) == 0 &&
+ attr->num_values > 0)
{
ipp_attribute_t *temp, /* Pointer to new buffer */
*ptr; /* Pointer in attribute list */
attr = ipp->current = ipp->last = temp;
}
}
+ else if (tag == IPP_TAG_MEMBERNAME)
+ {
+ /*
+ * Name must be length 0!
+ */
+
+ if (n)
+ {
+ DEBUG_puts("ippReadIO: member name not empty!");
+ return (IPP_ERROR);
+ }
+
+ attr = ipp->current = _ipp_add_attr(ipp, IPP_MAX_VALUES);
+
+ attr->group_tag = ipp->curtag;
+ attr->value_tag = IPP_TAG_ZERO;
+ attr->num_values = 0;
+ }
else
{
/*
if (n > 0)
return (IPP_ERROR);
- ipp->state = IPP_DATA;
- break;
+ return (ipp->state = IPP_DATA);
case IPP_TAG_MEMBERNAME :
/*
* we need to carry over...
*/
- free(attr->name);
- attr->name = calloc(n + 1, 1);
- attr->num_values --;
+ attr->name = calloc(n + 1, 1);
if ((*cb)(src, (ipp_uchar_t *)attr->name, n) < n)
return (IPP_ERROR);
DEBUG_puts("ippWrite: writing name = 0, \'\'\n");
*bufptr++ = IPP_TAG_MEMBERNAME;
+ *bufptr++ = 0;
+ *bufptr++ = 0;
*bufptr++ = n >> 8;
*bufptr++ = n;
memcpy(bufptr, attr->name, n);
/*
- * End of "$Id: ipp.c,v 1.55.2.30 2003/03/14 22:14:32 mike Exp $".
+ * End of "$Id: ipp.c,v 1.55.2.31 2003/03/20 02:45:48 mike Exp $".
*/