From: msweet
Date: Wed, 27 Aug 2008 22:04:19 +0000 (+0000)
Subject: Merge changes from CUPS 1.4svn-r7874.
X-Git-Tag: release-1.6.3~147
X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=commitdiff_plain;h=5f64df29828e9ca71164342efd357e9debfb6e44
Merge changes from CUPS 1.4svn-r7874.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@924 a1ca3aef-8c08-0410-bb20-df032aa958be
---
diff --git a/CHANGES-1.3.txt b/CHANGES-1.3.txt
index ced5b20d7..d126cfac9 100644
--- a/CHANGES-1.3.txt
+++ b/CHANGES-1.3.txt
@@ -3,6 +3,12 @@ CHANGES-1.3.txt
CHANGES IN CUPS V1.3.9
+ - Documentation updates (STR #2904)
+ - The scheduler required Kerberos authentication for
+ all operations on remote Kerberized printers instead
+ of just for the operations that needed it.
+ - The socket backend could wait indefinitely for back-
+ channel data with some devices.
- PJL panel messages were not reset correctly on older
printers (STR #2909)
- cupsfilter used the wrong default path (STR #2908)
diff --git a/Makedefs.in b/Makedefs.in
index b34c7ae0e..f213a3f38 100644
--- a/Makedefs.in
+++ b/Makedefs.in
@@ -152,6 +152,8 @@ PHPDIR = @PHPDIR@
PHPOPTIONS = @PHPOPTIONS@ -I../.. `$(PHPCONFIG) --includes`
SSLFLAGS = @SSLFLAGS@
SSLLIBS = @SSLLIBS@
+UNITTESTS = @UNITTESTS@
+
#
# Separate 32/64-bit library support...
diff --git a/Makefile b/Makefile
index 9354f05ca..7be3bac59 100644
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,8 @@ all:
echo Using ARCHFLAGS="$(ARCHFLAGS)"
echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+ echo Using CC="$(CC)"
+ echo Using CXX="$(CC)"
echo Using DSOFLAGS="$(DSOFLAGS)"
echo Using LDFLAGS="$(LDFLAGS)"
echo Using LIBS="$(LIBS)"
@@ -51,6 +53,8 @@ libs:
echo Using ARCHFLAGS="$(ARCHFLAGS)"
echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+ echo Using CC="$(CC)"
+ echo Using CXX="$(CC)"
echo Using DSOFLAGS="$(DSOFLAGS)"
echo Using LDFLAGS="$(LDFLAGS)"
echo Using LIBS="$(LIBS)"
@@ -60,6 +64,25 @@ libs:
done
+#
+# Make unit test targets...
+#
+
+unittests:
+ echo Using ARCHFLAGS="$(ARCHFLAGS)"
+ echo Using ALL_CFLAGS="$(ALL_CFLAGS)"
+ echo Using ALL_CXXFLAGS="$(ALL_CXXFLAGS)"
+ echo Using CC="$(CC)"
+ echo Using CXX="$(CC)"
+ echo Using DSOFLAGS="$(DSOFLAGS)"
+ echo Using LDFLAGS="$(LDFLAGS)"
+ echo Using LIBS="$(LIBS)"
+ for dir in $(DIRS); do\
+ echo Making all in $$dir... ;\
+ (cd $$dir ; $(MAKE) $(MFLAGS) unittests) || exit 1;\
+ done
+
+
#
# Remove object and target files...
#
diff --git a/backend/Makefile b/backend/Makefile
index a2d4b1ed0..bb9d0f8dc 100644
--- a/backend/Makefile
+++ b/backend/Makefile
@@ -40,6 +40,13 @@ all: $(TARGETS)
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#
diff --git a/backend/socket.c b/backend/socket.c
index 4e2dac146..70a089195 100644
--- a/backend/socket.c
+++ b/backend/socket.c
@@ -72,7 +72,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
sep; /* Option separator */
int print_fd; /* Print file */
int copies; /* Number of copies to print */
- time_t start_time; /* Time of first connect */
+ time_t start_time, /* Time of first connect */
+ wait_time; /* Time to wait before shutting down socket */
int recoverable; /* Recoverable error shown? */
int contimeout; /* Connection timeout */
int waiteof; /* Wait for end-of-file? */
@@ -412,10 +413,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
/*
- * Get any pending back-channel data...
+ * Wait up to 5 seconds to get any pending back-channel data...
*/
- while (wait_bc(device_fd, 5) > 0);
+ wait_time = time(NULL) + 5;
+ while (wait_time >= time(NULL))
+ if (wait_bc(device_fd, 1) <= 0)
+ break;
if (waiteof)
{
diff --git a/berkeley/Makefile b/berkeley/Makefile
index 7852f245f..996858d38 100644
--- a/berkeley/Makefile
+++ b/berkeley/Makefile
@@ -15,6 +15,7 @@
include ../Makedefs
+
TARGETS = lpc lpq lpr lprm
OBJS = lpc.o lpq.o lpr.o lprm.o
@@ -33,6 +34,13 @@ all: $(TARGETS)
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all object files...
#
diff --git a/cgi-bin/Makefile b/cgi-bin/Makefile
index 3ddc6cd65..0d538c0d7 100644
--- a/cgi-bin/Makefile
+++ b/cgi-bin/Makefile
@@ -48,14 +48,16 @@ LIBTARGETS = \
$(LIBCUPSCGI) \
$(LIB32CUPSCGI) \
$(LIB32CUPSCGI) \
+ websearch
+
+UNITTARGETS = \
testcgi \
testhi \
- websearch
+ testtemplate
TARGETS = \
$(LIBTARGETS) \
- $(CGIS) \
- testtemplate
+ $(CGIS)
#
@@ -69,7 +71,14 @@ all: $(TARGETS)
# Make library targets...
#
-libs: $(LIBTARGETS)
+libs: $(LIBTARGETS) $(UNITTESTS)
+
+
+#
+# Make unit tests...
+#
+
+unittests: $(UNITTARGETS)
#
@@ -77,7 +86,7 @@ libs: $(LIBTARGETS)
#
clean:
- $(RM) $(OBJS) $(TARGETS)
+ $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
$(RM) libcupscgi.so libcupscgi.sl libcupscgi.dylib
$(RM) -r 32bit 64bit
diff --git a/conf/Makefile b/conf/Makefile
index 8d4ffbf2f..acd7eacba 100644
--- a/conf/Makefile
+++ b/conf/Makefile
@@ -37,6 +37,13 @@ all:
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4
index 8d30df79c..2781e18ba 100644
--- a/config-scripts/cups-compiler.m4
+++ b/config-scripts/cups-compiler.m4
@@ -22,15 +22,29 @@ AC_SUBST(OPTIM)
AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ])
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no])
+AC_ARG_ENABLE(debug_printfs, [ --enable-debug-printfs turn on debug printfs, default=no])
+AC_ARG_ENABLE(unit_tests, [ --enable-unit-tests turn on unit tests, default=no])
dnl For debugging, keep symbols, otherwise strip them...
if test x$enable_debug = xyes; then
OPTIM="-g"
- CFLAGS="$CFLAGS -DDEBUG"
else
INSTALL_STRIP="-s"
fi
+dnl Debug printfs can slow things down, so provide a separate option for that
+if test x$enable_debug_printf = xyes; then
+ CFLAGS="$CFLAGS -DDEBUG"
+fi
+
+dnl Unit tests take up time during a compile...
+if test x$enable_unit_tests = xyes; then
+ UNITTESTS="unittests"
+else
+ UNITTESTS=""
+fi
+AC_SUBST(UNITTESTS)
+
dnl Setup general architecture flags...
AC_ARG_WITH(archflags, [ --with-archflags="flags"
set default architecture flags ])
diff --git a/cups/Makefile b/cups/Makefile
index 584276a16..752edd1a9 100644
--- a/cups/Makefile
+++ b/cups/Makefile
@@ -115,22 +115,24 @@ LIBTARGETS = \
$(LIBCUPS) \
$(LIB32CUPS) \
$(LIB64CUPS) \
- libcups.a \
+ libcups.a
+
+UNITTARGETS = \
+ testadmin \
testarray \
+ testconflicts \
+ testcups \
testfile \
testhttp \
testi18n \
testipp \
testlang \
testoptions \
- testppd
+ testppd \
+ testsnmp
TARGETS = \
- $(LIBTARGETS) \
- testadmin \
- testconflicts \
- testcups \
- testsnmp
+ $(LIBTARGETS)
#
@@ -147,12 +149,19 @@ all: $(TARGETS)
libs: $(LIBTARGETS)
+#
+# Make unit tests...
+#
+
+unittests: $(UNITTARGETS)
+
+
#
# Remove object and target files...
#
clean:
- $(RM) $(OBJS) $(TARGETS)
+ $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
$(RM) libcups.so libcups.sl libcups.dylib
$(RM) -r 32bit 64bit
diff --git a/cups/globals.c b/cups/globals.c
index d104f1b50..14d5f7842 100644
--- a/cups/globals.c
+++ b/cups/globals.c
@@ -155,7 +155,7 @@ globals_destructor(void *value) /* I - Data to free */
cupsFileClose(cg->stdio_files[i]);
if (cg->last_status_message)
- free(cg->last_status_message);
+ _cupsStrFree(cg->last_status_message);
cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings);
diff --git a/cups/http-addr.c b/cups/http-addr.c
index b16961886..0bc71f6fa 100644
--- a/cups/http-addr.c
+++ b/cups/http-addr.c
@@ -249,12 +249,13 @@ httpAddrLookup(
int /* O - Port number */
_httpAddrPort(http_addr_t *addr) /* I - Address */
{
+ if (!addr)
+ return (ippPort());
#ifdef AF_INET6
- if (addr->addr.sa_family == AF_INET6)
+ else if (addr->addr.sa_family == AF_INET6)
return (ntohs(addr->ipv6.sin6_port));
- else
#endif /* AF_INET6 */
- if (addr->addr.sa_family == AF_INET)
+ else if (addr->addr.sa_family == AF_INET)
return (ntohs(addr->ipv4.sin_port));
else
return (ippPort());
diff --git a/data/Makefile b/data/Makefile
index 48dd1db55..9e8378b28 100644
--- a/data/Makefile
+++ b/data/Makefile
@@ -99,6 +99,13 @@ all:
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Clean all config and object files...
#
diff --git a/doc/Makefile b/doc/Makefile
index 9d24b2844..4c461f75f 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -132,6 +132,13 @@ all:
libs:
+#
+# Make unit tests...
+#
+
+unittests:
+
+
#
# Remove all generated files...
#
diff --git a/doc/help/spec-command.html b/doc/help/spec-command.html
index 7abb3adea..3e48f9f18 100644
--- a/doc/help/spec-command.html
+++ b/doc/help/spec-command.html
@@ -17,20 +17,10 @@
Copyright 1997-2006 by Easy Software Products.
These coded instructions, statements, and computer programs are the
- property of Easy Software Products 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 missing or damaged please contact Easy Software Products
- at:
-
- Attn: CUPS Licensing Information
- Easy Software Products
- 44141 Airport View Drive, Suite 204
- Hollywood, Maryland 20636 USA
-
- Voice: (301) 373-9600
- EMail: cups-info@cups.org
- WWW: http://www.cups.org
+ 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/".
-->
diff --git a/doc/help/spec-ipp.html b/doc/help/spec-ipp.html
index 63a5fe5a6..74df07290 100644
--- a/doc/help/spec-ipp.html
+++ b/doc/help/spec-ipp.html
@@ -15,20 +15,10 @@
Copyright 1997-2007 by Easy Software Products.
These coded instructions, statements, and computer programs are the
- property of Easy Software Products 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 missing or damaged please contact Easy Software Products
- at:
-
- Attn: CUPS Licensing Information
- Easy Software Products
- 44141 Airport View Drive, Suite 204
- Hollywood, Maryland 20636 USA
-
- Voice: (301) 373-9600
- EMail: cups-info@cups.org
- WWW: http://www.cups.org
+ 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/".
-->
diff --git a/doc/help/spec-postscript.html b/doc/help/spec-postscript.html
index 7e9f9a802..1bb3cd67a 100644
--- a/doc/help/spec-postscript.html
+++ b/doc/help/spec-postscript.html
@@ -12,23 +12,14 @@
CUPS PostScript file specification for the Common UNIX Printing System (CUPS).
+ Copyright 2007-2008 by Apple Inc.
Copyright 2006 by Easy Software Products.
These coded instructions, statements, and computer programs are the
- property of Easy Software Products 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 missing or damaged please contact Easy Software Products
- at:
-
- Attn: CUPS Licensing Information
- Easy Software Products
- 44141 Airport View Drive, Suite 204
- Hollywood, Maryland 20636 USA
-
- Voice: (301) 373-9600
- EMail: cups-info@cups.org
- WWW: http://www.cups.org
+ 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/".
-->
@@ -46,16 +37,16 @@ output will work reliably.
defacto-standard print job file format/language for UNIX-based
applications, it is slowly being phased out in favor of Adobe's
Portable Document Format ("PDF") which offers many advantages
-over PostScript. MacOS X uses PDF as the primary print job file
-format, and we expect Linux to soon follow. Both PostScript and
+over PostScript. Mac OS X uses PDF as the primary print job file
+format and Linux is making the transition. Both PostScript and
PDF are complex formats, and we highly recommend using high-level
-toolkits whenever possible.
+toolkits whenever possible to create your print jobs.
Anatomy of a PostScript File
PostScript files are ASCII text files starting with a header
line (%!PS-Adobe-3.0) followed by a combination of
-comment lines starting with two percent signs (%%) and
+comment lines starting with the percent sign (%) and
PostScript code lines. The lines themselves should not exceed 255
characters to conform to the DSC. The following short PostScript
file produces a box with a smiley face in it:
@@ -66,7 +57,13 @@ file produces a box with a smiley face in it:
%%Pages: 1
%%LanguageLevel: 2
%%EndComments
+%%BeginSetup
+% this is where fonts would be embedded
+%%EndSetup
%%Page: (1) 1
+%%BeginPageSetup
+% this is where page-specific features would be specified
+%%EndPageSetup
% Draw a black box around the page
0 setgray
1 setlinewidth
@@ -98,23 +95,52 @@ width="445" height="570" alt="Sample PostScript File Output">
-Embedding Printer Options
+
+There are two main strategies for embedding printer options in PostScript
+files. The first is to list CUPS options using the %cupsJobTicket
+comment:
-Embedding Fonts and Text
+
+%!PS-Adobe-3.0
+%cupsJobTicket: media=A4 sides=two-sided-long-edge
+%cupsJobTicket: PrinterOption=foo PrinterOption2=bar
+...
+%%EndComments
+
+
+CUPS options apply to the entire job. To apply options to individual pages,
+use the %%IncludeFeature
comment instead:
+
+
+%%Page: label 123
+%%BeginPageSetup
+%%IncludeFeature: *PageSize A4
+%%IncludeFeature: *PrinterOption Foo
+%%IncludeFeature: *PrinterOption2 Bar
+%%EndPageSetup
+...
+
-Embedding Images
+
+Always embed the fonts used by your print job, and for best performance
+embed the fonts and character encodings in the setup section of the PostScript
+file. Type 1 and Type 3 fonts are supported by all PostScript printers, while
+Type 42 (TrueType) and CID fonts are supported by most level 2 and all level 3
+PostScript printers. Binary font files should always be converted to the
+corresponding ASCII (hex) encoding to avoid problems when printing over
+interfaces that do not support binary PostScript.
-Note: While some printers support arbitrary
-binary data in PostScript files, we do not recommend this
-practice because it does not work with all printers or
-interfaces. In most cases, the Base-85 encoding and compression
-filters can be used to embed images with very little, if any,
-increase in data size.
+
+The image
operator should be used to embed images in PostScript
+files. Always use ASCII hex or Base-85 encoding for the image data to avoid
+problems when printing over interfaces that do not support binary PostScript.
+In most cases, the Base-85 encoding and compression filters can be used to
+embed images with very little, if any, increase in data size.