From 07725fee410af68be5081d9b1af3536eff5326b8 Mon Sep 17 00:00:00 2001
From: jlovell AllowUser
<Class name> ... - ErrorPolicy cancel-job + ErrorPolicy abort-job </Class>@@ -181,7 +181,7 @@ error policy:
cancel-job
- Cancel the job and proceed
+ abort-job
- Abort the job and proceed
with the next job in the queueretry-job
- Retry the job after waiting
diff --git a/doc/help/ref-printers-conf.html b/doc/help/ref-printers-conf.html
index 1cb72a2f0..c8a459f8b 100644
--- a/doc/help/ref-printers-conf.html
+++ b/doc/help/ref-printers-conf.html
@@ -169,7 +169,7 @@ section.
<Printer name> ... - ErrorPolicy cancel-job + ErrorPolicy abort-job </Printer>@@ -188,7 +188,7 @@ error policy:
cancel-job
- Cancel the job and proceed
+ abort-job
- Abort the job and proceed
with the next job in the queueretry-job
- Retry the job after waiting
diff --git a/filter/Dependencies b/filter/Dependencies
index 5a2cd2313..fa2b859a3 100644
--- a/filter/Dependencies
+++ b/filter/Dependencies
@@ -90,7 +90,7 @@ interpret.o: ../cups/ipp.h ../cups/http.h ../cups/md5.h ../cups/ppd.h
interpret.o: ../cups/array.h ../cups/file.h ../cups/language.h
raster.o: raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
raster.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-raster.o: ../cups/string.h ../config.h
+raster.o: ../cups/debug.h ../cups/string.h ../config.h
form-main.o: form.h common.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
form-main.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
form-main.o: ../cups/language.h ../cups/language.h ../cups/string.h
@@ -118,9 +118,9 @@ pstops.o: common.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
pstops.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
pstops.o: ../cups/language.h ../cups/string.h ../config.h ../cups/file.h
pstops.o: ../cups/array.h
-raster.o: raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
-raster.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-raster.o: ../cups/string.h ../config.h
+rasterbench.o: raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
+rasterbench.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
+rasterbench.o: ../cups/language.h
rastertoepson.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
rastertoepson.o: ../cups/ppd.h ../cups/array.h ../cups/file.h
rastertoepson.o: ../cups/language.h ../cups/ppd.h ../cups/string.h
@@ -237,7 +237,7 @@ interpret.32.o: interpret.c ../cups/ipp.h ../cups/http.h ../cups/md5.h ../cups/
interpret.32.o: interpret.c ../cups/array.h ../cups/file.h ../cups/language.h
raster.32.o: raster.c raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
raster.32.o: raster.c ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-raster.32.o: raster.c ../cups/string.h ../config.h
+raster.32.o: raster.c ../cups/debug.h ../cups/string.h ../config.h
form-main.32.o: form-main.c form.h common.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
form-main.32.o: form-main.c ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
form-main.32.o: form-main.c ../cups/language.h ../cups/language.h ../cups/string.h
@@ -265,9 +265,9 @@ pstops.32.o: pstops.c common.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../c
pstops.32.o: pstops.c ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
pstops.32.o: pstops.c ../cups/language.h ../cups/string.h ../config.h ../cups/file.h
pstops.32.o: pstops.c ../cups/array.h
-raster.32.o: raster.c raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
-raster.32.o: raster.c ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-raster.32.o: raster.c ../cups/string.h ../config.h
+rasterbench.32.o: rasterbench.c raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
+rasterbench.32.o: rasterbench.c ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
+rasterbench.32.o: rasterbench.c ../cups/language.h
rastertoepson.32.o: rastertoepson.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
rastertoepson.32.o: rastertoepson.c ../cups/ppd.h ../cups/array.h ../cups/file.h
rastertoepson.32.o: rastertoepson.c ../cups/language.h ../cups/ppd.h ../cups/string.h
@@ -384,7 +384,7 @@ interpret.64.o: interpret.c ../cups/ipp.h ../cups/http.h ../cups/md5.h ../cups/
interpret.64.o: interpret.c ../cups/array.h ../cups/file.h ../cups/language.h
raster.64.o: raster.c raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
raster.64.o: raster.c ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-raster.64.o: raster.c ../cups/string.h ../config.h
+raster.64.o: raster.c ../cups/debug.h ../cups/string.h ../config.h
form-main.64.o: form-main.c form.h common.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
form-main.64.o: form-main.c ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
form-main.64.o: form-main.c ../cups/language.h ../cups/language.h ../cups/string.h
@@ -412,9 +412,9 @@ pstops.64.o: pstops.c common.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../c
pstops.64.o: pstops.c ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
pstops.64.o: pstops.c ../cups/language.h ../cups/string.h ../config.h ../cups/file.h
pstops.64.o: pstops.c ../cups/array.h
-raster.64.o: raster.c raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
-raster.64.o: raster.c ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-raster.64.o: raster.c ../cups/string.h ../config.h
+rasterbench.64.o: rasterbench.c raster.h ../cups/cups.h ../cups/ipp.h ../cups/http.h
+rasterbench.64.o: rasterbench.c ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h
+rasterbench.64.o: rasterbench.c ../cups/language.h
rastertoepson.64.o: rastertoepson.c ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
rastertoepson.64.o: rastertoepson.c ../cups/ppd.h ../cups/array.h ../cups/file.h
rastertoepson.64.o: rastertoepson.c ../cups/language.h ../cups/ppd.h ../cups/string.h
diff --git a/filter/interpret.c b/filter/interpret.c
index 3e7b47be1..50190b4f1 100644
--- a/filter/interpret.c
+++ b/filter/interpret.c
@@ -1,5 +1,5 @@
/*
- * "$Id: interpret.c 5513 2006-05-11 18:07:25Z mike $"
+ * "$Id: interpret.c 5926 2006-09-05 20:45:47Z mike $"
*
* PPD command interpreter for the Common UNIX Printing System (CUPS).
*
@@ -200,6 +200,9 @@ cupsRasterInterpretPPD(
top = size->top;
strlcpy(h->cupsPageSizeName, size->name, sizeof(h->cupsPageSizeName));
+
+ h->cupsPageSize[0] = size->width;
+ h->cupsPageSize[1] = size->length;
}
else
{
@@ -608,5 +611,5 @@ exec_code(
/*
- * End of "$Id: interpret.c 5513 2006-05-11 18:07:25Z mike $".
+ * End of "$Id: interpret.c 5926 2006-09-05 20:45:47Z mike $".
*/
diff --git a/man/classes.conf.man b/man/classes.conf.man
index eb38be57c..4df347ade 100644
--- a/man/classes.conf.man
+++ b/man/classes.conf.man
@@ -1,5 +1,5 @@
.\"
-.\" "$Id: classes.conf.man 5099 2006-02-13 02:46:10Z mike $"
+.\" "$Id: classes.conf.man 5970 2006-09-19 20:11:08Z mike $"
.\"
.\" classes.conf man page for the Common UNIX Printing System (CUPS).
.\"
@@ -56,7 +56,7 @@ DenyUser [ user @group ... ]
.br
Prevents specific users and groups from printing to the printer.
.TP 5
-ErrorPolicy cancel-job
+ErrorPolicy abort-job
.TP 5
ErrorPolicy retry-job
.TP 5
@@ -123,5 +123,5 @@ http://localhost:631/help
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
-.\" End of "$Id: classes.conf.man 5099 2006-02-13 02:46:10Z mike $".
+.\" End of "$Id: classes.conf.man 5970 2006-09-19 20:11:08Z mike $".
.\"
diff --git a/man/lpadmin.man b/man/lpadmin.man
index 6bb24c3b3..82677fcb6 100644
--- a/man/lpadmin.man
+++ b/man/lpadmin.man
@@ -1,5 +1,5 @@
.\"
-.\" "$Id: lpadmin.man 5736 2006-07-13 19:59:36Z mike $"
+.\" "$Id: lpadmin.man 5970 2006-09-19 20:11:08Z mike $"
.\"
.\" lpadmin man page for the Common UNIX Printing System (CUPS).
.\"
@@ -127,7 +127,7 @@ Sets the binary communications program to use when printing,
.br
Sets the error policy to be used when the printer backend is
unable to send the job to the printer. The name must be one of
-"cancel-job", "retry-job" or "stop-printer". The default error
+"abort-job", "retry-job" or "stop-printer". The default error
policy is "stop-printer".
.TP 5
-o printer-is-shared=true/false
@@ -205,5 +205,5 @@ http://localhost:631/help
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
-.\" End of "$Id: lpadmin.man 5736 2006-07-13 19:59:36Z mike $".
+.\" End of "$Id: lpadmin.man 5970 2006-09-19 20:11:08Z mike $".
.\"
diff --git a/man/printers.conf.man b/man/printers.conf.man
index 45dedb85a..0a0469247 100644
--- a/man/printers.conf.man
+++ b/man/printers.conf.man
@@ -1,5 +1,5 @@
.\"
-.\" "$Id: printers.conf.man 5099 2006-02-13 02:46:10Z mike $"
+.\" "$Id: printers.conf.man 5970 2006-09-19 20:11:08Z mike $"
.\"
.\" printers.conf man page for the Common UNIX Printing System (CUPS).
.\"
@@ -60,7 +60,7 @@ DeviceURI uri
.br
Specifies the device URI for a printer.
.TP 5
-ErrorPolicy cancel-job
+ErrorPolicy abort-job
.TP 5
ErrorPolicy retry-job
.TP 5
@@ -127,5 +127,5 @@ http://localhost:631/help
.SH COPYRIGHT
Copyright 1997-2006 by Easy Software Products, All Rights Reserved.
.\"
-.\" End of "$Id: printers.conf.man 5099 2006-02-13 02:46:10Z mike $".
+.\" End of "$Id: printers.conf.man 5970 2006-09-19 20:11:08Z mike $".
.\"
diff --git a/notifier/Dependencies b/notifier/Dependencies
index 6867d6207..4ee88b776 100644
--- a/notifier/Dependencies
+++ b/notifier/Dependencies
@@ -2,7 +2,7 @@
mailto.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
mailto.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
-mailto.o: ../cups/i18n.h ../cups/string.h ../config.h
+mailto.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h
testnotify.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
testnotify.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
testnotify.o: ../cups/language.h ../cups/string.h ../config.h
diff --git a/packaging/cups.list.in b/packaging/cups.list.in
index 6101446d1..b40ec0f22 100644
--- a/packaging/cups.list.in
+++ b/packaging/cups.list.in
@@ -1,5 +1,5 @@
#
-# "$Id: cups.list.in 5900 2006-08-28 19:26:39Z mike $"
+# "$Id: cups.list.in 5964 2006-09-19 16:27:29Z mike $"
#
# ESP Package Manager (EPM) file list for the Common UNIX Printing
# System (CUPS).
@@ -29,7 +29,12 @@
%vendor Easy Software Products
%license LICENSE.txt
%readme packaging/cups.readme
+%format rpm
+# Red Hat and their epochs...
+%version 1:@CUPS_VERSION@
+%format !rpm
%version @CUPS_VERSION@
+%format all
%description The Common UNIX Printing System provides a portable printing
%description layer for UNIX(r) operating systems. It has been developed by
%description Easy Software Products to promote a standard printing solution
@@ -364,8 +369,10 @@ f 0644 root sys $DATADIR/banners/standard data/standard
f 0644 root sys $DATADIR/banners/topsecret data/topsecret
f 0644 root sys $DATADIR/banners/unclassified data/unclassified
+d 0755 root sys $DATADIR/charmaps -
+f 0644 root sys $DATADIR/charmaps data/*.txt
+
d 0755 root sys $DATADIR/charsets -
-f 0644 root sys $DATADIR/charsets data/*.txt
f 0644 root sys $DATADIR/charsets/windows-874 data/windows-874
f 0644 root sys $DATADIR/charsets/windows-1250 data/windows-1250
f 0644 root sys $DATADIR/charsets/windows-1251 data/windows-1251
@@ -443,7 +450,12 @@ c 0644 root sys $PAMDIR/cups conf/@PAMFILE@
# Developer files
f 0755 root sys $BINDIR/cups-config cups-config
d 0755 root sys $INCLUDEDIR/cups -
+f 0644 root sys $INCLUDEDIR/cups/adminutil.h cups/adminutil.h
+f 0644 root sys $INCLUDEDIR/cups/array.h cups/array.h
+f 0644 root sys $INCLUDEDIR/cups/backend.h cups/backend.h
f 0644 root sys $INCLUDEDIR/cups/cups.h cups/cups.h
+f 0644 root sys $INCLUDEDIR/cups/dir.h cups/dir.h
+f 0644 root sys $INCLUDEDIR/cups/file.h cups/file.h
f 0644 root sys $INCLUDEDIR/cups/http.h cups/http.h
f 0644 root sys $INCLUDEDIR/cups/image.h filter/image.h
f 0644 root sys $INCLUDEDIR/cups/ipp.h cups/ipp.h
@@ -451,6 +463,7 @@ f 0644 root sys $INCLUDEDIR/cups/language.h cups/language.h
f 0644 root sys $INCLUDEDIR/cups/md5.h cups/md5.h
f 0644 root sys $INCLUDEDIR/cups/ppd.h cups/ppd.h
f 0644 root sys $INCLUDEDIR/cups/raster.h filter/raster.h
+f 0644 root sys $INCLUDEDIR/cups/transcode.h cups/transcode.h
%if INSTALLSTATIC
f 0644 root sys $LIBDIR/libcups.a cups/libcups.a
@@ -589,5 +602,5 @@ f 0644 root sys $XINETD/cups-lpd init/cups-lpd
%subpackage
#
-# End of "$Id: cups.list.in 5900 2006-08-28 19:26:39Z mike $".
+# End of "$Id: cups.list.in 5964 2006-09-19 16:27:29Z mike $".
#
diff --git a/pdftops/Dependencies b/pdftops/Dependencies
index 350408b56..a36824a85 100644
--- a/pdftops/Dependencies
+++ b/pdftops/Dependencies
@@ -91,51 +91,6 @@ PSTokenizer.o: ../config.h PSTokenizer.h gtypes.h
SecurityHandler.o: ../config.h GString.h PDFDoc.h XRef.h gtypes.h Object.h
SecurityHandler.o: gmem.h Array.h Dict.h Stream.h Catalog.h Page.h Decrypt.h
SecurityHandler.o: Error.h GlobalParams.h CharTypes.h SecurityHandler.h
-SplashBitmap.o: ../config.h gmem.h SplashErrorCodes.h SplashBitmap.h
-SplashBitmap.o: SplashTypes.h gtypes.h
-SplashClip.o: ../config.h gmem.h SplashErrorCodes.h SplashMath.h
-SplashClip.o: SplashTypes.h gtypes.h SplashPath.h SplashXPath.h
-SplashClip.o: SplashXPathScanner.h SplashClip.h
-Splash.o: ../config.h gmem.h SplashErrorCodes.h SplashMath.h SplashTypes.h
-Splash.o: gtypes.h SplashBitmap.h SplashState.h SplashPath.h SplashXPath.h
-Splash.o: SplashXPathScanner.h SplashPattern.h SplashScreen.h SplashFont.h
-Splash.o: SplashGlyphBitmap.h Splash.h SplashClip.h
-SplashFont.o: ../config.h gmem.h SplashMath.h SplashTypes.h gtypes.h
-SplashFont.o: SplashGlyphBitmap.h SplashFontFile.h SplashFont.h
-SplashFontEngine.o: ../config.h gmem.h GString.h SplashT1FontEngine.h
-SplashFontEngine.o: SplashFTFontEngine.h SplashFontFile.h gtypes.h
-SplashFontEngine.o: SplashTypes.h SplashFontFileID.h SplashFont.h
-SplashFontEngine.o: SplashFontEngine.h
-SplashFontFile.o: ../config.h GString.h SplashFontFile.h gtypes.h
-SplashFontFile.o: SplashTypes.h SplashFontFileID.h
-SplashFontFileID.o: ../config.h SplashFontFileID.h gtypes.h
-SplashFTFont.o: ../config.h
-SplashFTFontEngine.o: ../config.h
-SplashFTFontFile.o: ../config.h
-SplashOutputDev.o: ../config.h gfile.h gtypes.h GlobalParams.h CharTypes.h
-SplashOutputDev.o: Error.h Object.h gmem.h GString.h Array.h Dict.h Stream.h
-SplashOutputDev.o: GfxFont.h Link.h CharCodeToUnicode.h FontEncodingTables.h
-SplashOutputDev.o: FoFiTrueType.h FoFiBase.h SplashBitmap.h SplashTypes.h
-SplashOutputDev.o: SplashGlyphBitmap.h SplashPattern.h SplashScreen.h
-SplashOutputDev.o: SplashPath.h SplashState.h SplashErrorCodes.h
-SplashOutputDev.o: SplashFontEngine.h SplashFont.h SplashFontFile.h
-SplashOutputDev.o: SplashFontFileID.h Splash.h SplashClip.h SplashOutputDev.h
-SplashOutputDev.o: OutputDev.h GfxState.h Function.h
-SplashPath.o: ../config.h gmem.h SplashErrorCodes.h SplashPath.h
-SplashPath.o: SplashTypes.h gtypes.h
-SplashPattern.o: ../config.h SplashMath.h SplashTypes.h gtypes.h
-SplashPattern.o: SplashScreen.h SplashPattern.h
-SplashScreen.o: ../config.h gmem.h SplashMath.h SplashTypes.h gtypes.h
-SplashScreen.o: SplashScreen.h
-SplashState.o: ../config.h gmem.h SplashPattern.h SplashTypes.h gtypes.h
-SplashState.o: SplashScreen.h SplashClip.h SplashState.h
-SplashT1Font.o: ../config.h
-SplashT1FontEngine.o: ../config.h
-SplashT1FontFile.o: ../config.h
-SplashXPath.o: ../config.h gmem.h SplashMath.h SplashTypes.h gtypes.h
-SplashXPath.o: SplashPath.h SplashXPath.h
-SplashXPathScanner.o: ../config.h gmem.h SplashMath.h SplashTypes.h gtypes.h
-SplashXPathScanner.o: SplashXPath.h SplashXPathScanner.h
Stream.o: ../config.h gmem.h gfile.h gtypes.h Error.h Object.h GString.h
Stream.o: Array.h Dict.h Stream.h Lexer.h Decrypt.h GfxState.h Function.h
Stream.o: JBIG2Stream.h JPXStream.h Stream-CCITT.h
diff --git a/scheduler/Dependencies b/scheduler/Dependencies
index d54993e2a..e90107a76 100644
--- a/scheduler/Dependencies
+++ b/scheduler/Dependencies
@@ -204,6 +204,9 @@ testmime.o: ../cups/file.h ../cups/dir.h
testspeed.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
testspeed.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
testspeed.o: ../cups/language.h ../cups/debug.h
+testsub.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
+testsub.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
+testsub.o: ../cups/debug.h ../cups/string.h ../config.h
util.o: util.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h
util.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h
util.o: ../cups/file.h ../cups/string.h ../config.h
diff --git a/scheduler/Makefile b/scheduler/Makefile
index 58d362114..2eb297051 100644
--- a/scheduler/Makefile
+++ b/scheduler/Makefile
@@ -1,5 +1,5 @@
#
-# "$Id: Makefile 5868 2006-08-23 19:39:39Z mike $"
+# "$Id: Makefile 5940 2006-09-11 18:30:09Z mike $"
#
# Scheduler Makefile for the Common UNIX Printing System (CUPS).
#
@@ -62,6 +62,7 @@ OBJS = \
testlpd.o \
testmime.o \
testspeed.o \
+ testsub.o \
util.o
TARGETS = \
cupsd \
@@ -73,7 +74,8 @@ TARGETS = \
testdirsvc \
testlpd \
testmime \
- testspeed
+ testspeed \
+ testsub
#
@@ -282,6 +284,16 @@ testspeed: testspeed.o ../cups/libcups.a
$(COMMONLIBS) $(LIBZ) $(SSLLIBS)
+#
+# Make the test program, "testsub".
+#
+
+testsub: testsub.o ../cups/libcups.a
+ echo Linking $@...
+ $(CC) $(LDFLAGS) -o testsub testsub.o ../cups/libcups.a \
+ $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
+
+
#
# Dependencies...
#
@@ -290,5 +302,5 @@ include Dependencies
#
-# End of "$Id: Makefile 5868 2006-08-23 19:39:39Z mike $".
+# End of "$Id: Makefile 5940 2006-09-11 18:30:09Z mike $".
#
diff --git a/scheduler/auth.c b/scheduler/auth.c
index a1a10406b..41fd65f87 100644
--- a/scheduler/auth.c
+++ b/scheduler/auth.c
@@ -1,5 +1,5 @@
/*
- * "$Id: auth.c 5840 2006-08-17 14:55:30Z mike $"
+ * "$Id: auth.c 5948 2006-09-12 13:58:39Z mike $"
*
* Authorization routines for the Common UNIX Printing System (CUPS).
*
@@ -482,13 +482,13 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
strlcpy(data.username, username, sizeof(data.username));
strlcpy(data.password, password, sizeof(data.password));
-# ifdef __sun
+# if defined(__sun) || defined(__hpux)
pamdata.conv = (int (*)(int, struct pam_message **,
struct pam_response **,
void *))pam_func;
# else
pamdata.conv = pam_func;
-# endif /* __sun */
+# endif /* __sun || __hpux */
pamdata.appdata_ptr = &data;
# ifdef __hpux
@@ -2170,5 +2170,5 @@ to64(char *s, /* O - Output string */
/*
- * End of "$Id: auth.c 5840 2006-08-17 14:55:30Z mike $".
+ * End of "$Id: auth.c 5948 2006-09-12 13:58:39Z mike $".
*/
diff --git a/scheduler/banners.c b/scheduler/banners.c
index d83540c87..f78a1077d 100644
--- a/scheduler/banners.c
+++ b/scheduler/banners.c
@@ -1,5 +1,5 @@
/*
- * "$Id: banners.c 5305 2006-03-18 03:05:12Z mike $"
+ * "$Id: banners.c 5948 2006-09-12 13:58:39Z mike $"
*
* Banner routines for the Common UNIX Printing System (CUPS).
*
@@ -195,7 +195,7 @@ compare_banners(
* 'free_banners()' - Free all banners.
*/
-void
+static void
free_banners(void)
{
cupsd_banner_t *temp; /* Current banner */
@@ -215,5 +215,5 @@ free_banners(void)
/*
- * End of "$Id: banners.c 5305 2006-03-18 03:05:12Z mike $".
+ * End of "$Id: banners.c 5948 2006-09-12 13:58:39Z mike $".
*/
diff --git a/scheduler/client.c b/scheduler/client.c
index d5d1851a3..762421f2d 100644
--- a/scheduler/client.c
+++ b/scheduler/client.c
@@ -1,5 +1,5 @@
/*
- * "$Id: client.c 5898 2006-08-28 18:54:10Z mike $"
+ * "$Id: client.c 5972 2006-09-19 20:44:07Z mike $"
*
* Client routines for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -678,12 +678,14 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */
* 'cupsdFlushHeader()' - Flush the header fields to the client.
*/
-void
+int /* I - Bytes written or -1 on error */
cupsdFlushHeader(cupsd_client_t *con) /* I - Client to flush to */
{
- httpFlushWrite(HTTP(con));
+ int bytes = httpFlushWrite(HTTP(con));
con->http.data_encoding = HTTP_ENCODE_LENGTH;
+
+ return (bytes);
}
@@ -1038,7 +1040,9 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
httpPrintf(HTTP(con), "Upgrade: TLS/1.0,HTTP/1.1\r\n");
httpPrintf(HTTP(con), "Content-Length: 0\r\n");
httpPrintf(HTTP(con), "\r\n");
- cupsdFlushHeader(con);
+
+ if (cupsdFlushHeader(con) < 0)
+ return (cupsdCloseClient(con));
encrypt_client(con);
#else
@@ -1053,7 +1057,9 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
httpPrintf(HTTP(con), "Allow: GET, HEAD, OPTIONS, POST, PUT\r\n");
httpPrintf(HTTP(con), "Content-Length: 0\r\n");
httpPrintf(HTTP(con), "\r\n");
- cupsdFlushHeader(con);
+
+ if (cupsdFlushHeader(con) < 0)
+ return (cupsdCloseClient(con));
}
else if (!is_path_absolute(con->uri))
{
@@ -1081,7 +1087,9 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
httpPrintf(HTTP(con), "Upgrade: TLS/1.0,HTTP/1.1\r\n");
httpPrintf(HTTP(con), "Content-Length: 0\r\n");
httpPrintf(HTTP(con), "\r\n");
- cupsdFlushHeader(con);
+
+ if (cupsdFlushHeader(con) < 0)
+ return (cupsdCloseClient(con));
encrypt_client(con);
#else
@@ -1122,7 +1130,9 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
httpPrintf(HTTP(con), "Content-Length: 0\r\n");
httpPrintf(HTTP(con), "\r\n");
- cupsdFlushHeader(con);
+
+ if (cupsdFlushHeader(con) < 0)
+ return (cupsdCloseClient(con));
}
}
@@ -1556,7 +1566,8 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
if (httpPrintf(HTTP(con), "\r\n") < 0)
return (cupsdCloseClient(con));
- cupsdFlushHeader(con);
+ if (cupsdFlushHeader(con) < 0)
+ return (cupsdCloseClient(con));
cupsdLogRequest(con, HTTP_OK);
}
@@ -1621,7 +1632,8 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
if (httpPrintf(HTTP(con), "\r\n") < 0)
return (cupsdCloseClient(con));
- cupsdFlushHeader(con);
+ if (cupsdFlushHeader(con) < 0)
+ return (cupsdCloseClient(con));
con->http.state = HTTP_WAITING;
break;
@@ -2096,7 +2108,8 @@ cupsdSendError(cupsd_client_t *con, /* I - Connection */
else if (httpPrintf(HTTP(con), "\r\n") < 0)
return (0);
- cupsdFlushHeader(con);
+ if (cupsdFlushHeader(con) < 0)
+ return (0);
con->http.state = HTTP_WAITING;
@@ -2117,29 +2130,23 @@ cupsdSendHeader(cupsd_client_t *con, /* I - Client to send to */
* Send the HTTP status header...
*/
- httpFlushWrite(HTTP(con));
-
- con->http.data_encoding = HTTP_ENCODE_FIELDS;
-
- if (httpPrintf(HTTP(con), "HTTP/%d.%d %d %s\r\n", con->http.version / 100,
- con->http.version % 100, code, httpStatus(code)) < 0)
- return (0);
-
if (code == HTTP_CONTINUE)
{
/*
* 100-continue doesn't send any headers...
*/
- if (httpPrintf(HTTP(con), "\r\n") < 0)
- return (0);
- else
- {
- cupsdFlushHeader(con);
- return (1);
- }
+ return (httpPrintf(HTTP(con), "HTTP/%d.%d 100 Continue\r\n\r\n",
+ con->http.version / 100, con->http.version % 100) > 0);
}
+ httpFlushWrite(HTTP(con));
+
+ con->http.data_encoding = HTTP_ENCODE_FIELDS;
+
+ if (httpPrintf(HTTP(con), "HTTP/%d.%d %d %s\r\n", con->http.version / 100,
+ con->http.version % 100, code, httpStatus(code)) < 0)
+ return (0);
if (httpPrintf(HTTP(con), "Date: %s\r\n", httpGetDateString(time(NULL))) < 0)
return (0);
if (ServerHeader)
@@ -2262,7 +2269,7 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */
if (con->response != NULL)
{
- ipp_state = ippWrite(&(con->http), con->response);
+ ipp_state = ippWrite(HTTP(con), con->response);
bytes = ipp_state != IPP_ERROR && ipp_state != IPP_DATA;
}
else if ((bytes = read(con->file, buf, sizeof(buf) - 1)) > 0)
@@ -2301,14 +2308,20 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */
if (!strncasecmp(buf, "Location:", 9))
{
cupsdSendHeader(con, HTTP_SEE_OTHER, NULL);
+ con->sent_header = 2;
+
if (httpPrintf(HTTP(con), "Content-Length: 0\r\n") < 0)
return (0);
}
else if (!strncasecmp(buf, "Status:", 7))
+ {
cupsdSendError(con, (http_status_t)atoi(buf + 7));
+ con->sent_header = 2;
+ }
else
{
cupsdSendHeader(con, HTTP_OK, NULL);
+ con->sent_header = 1;
if (con->http.version == HTTP_1_1)
{
@@ -2316,8 +2329,6 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */
return (0);
}
}
-
- con->sent_header = 1;
}
if (strncasecmp(buf, "Status:", 7))
@@ -2342,7 +2353,11 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */
{
con->got_fields = 1;
- cupsdFlushHeader(con);
+ if (cupsdFlushHeader(con) < 0)
+ {
+ cupsdCloseClient(con);
+ return (0);
+ }
if (con->http.version == HTTP_1_1)
con->http.data_encoding = HTTP_ENCODE_CHUNKED;
@@ -2400,9 +2415,9 @@ cupsdWriteClient(cupsd_client_t *con) /* I - Client connection */
httpFlushWrite(HTTP(con));
- if (con->http.data_encoding == HTTP_ENCODE_CHUNKED)
+ if (con->http.data_encoding == HTTP_ENCODE_CHUNKED && con->sent_header == 1)
{
- if (httpPrintf(HTTP(con), "0\r\n\r\n") < 0)
+ if (httpWrite2(HTTP(con), "", 0) < 0)
{
cupsdCloseClient(con);
return (0);
@@ -4152,7 +4167,8 @@ write_file(cupsd_client_t *con, /* I - Client connection */
if (httpPrintf(HTTP(con), "\r\n") < 0)
return (0);
- cupsdFlushHeader(con);
+ if (cupsdFlushHeader(con) < 0)
+ return (0);
con->http.data_encoding = HTTP_ENCODE_LENGTH;
con->http.data_remaining = filestats->st_size;
@@ -4172,5 +4188,5 @@ write_file(cupsd_client_t *con, /* I - Client connection */
/*
- * End of "$Id: client.c 5898 2006-08-28 18:54:10Z mike $".
+ * End of "$Id: client.c 5972 2006-09-19 20:44:07Z mike $".
*/
diff --git a/scheduler/client.h b/scheduler/client.h
index ef376cda8..9f98df2ae 100644
--- a/scheduler/client.h
+++ b/scheduler/client.h
@@ -1,5 +1,5 @@
/*
- * "$Id: client.h 5889 2006-08-24 21:44:35Z mike $"
+ * "$Id: client.h 5932 2006-09-11 14:21:23Z mike $"
*
* Client definitions for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -104,7 +104,7 @@ extern void cupsdAcceptClient(cupsd_listener_t *lis);
extern void cupsdCloseAllClients(void);
extern int cupsdCloseClient(cupsd_client_t *con);
extern void cupsdDeleteAllListeners(void);
-extern void cupsdFlushHeader(cupsd_client_t *con);
+extern int cupsdFlushHeader(cupsd_client_t *con);
extern void cupsdPauseListening(void);
extern int cupsdProcessIPPRequest(cupsd_client_t *con);
extern int cupsdReadClient(cupsd_client_t *con);
@@ -122,5 +122,5 @@ extern int cupsdWriteClient(cupsd_client_t *con);
/*
- * End of "$Id: client.h 5889 2006-08-24 21:44:35Z mike $".
+ * End of "$Id: client.h 5932 2006-09-11 14:21:23Z mike $".
*/
diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c
index cb751549b..eb4f790f5 100644
--- a/scheduler/dirsvc.c
+++ b/scheduler/dirsvc.c
@@ -1,5 +1,5 @@
/*
- * "$Id: dirsvc.c 5889 2006-08-24 21:44:35Z mike $"
+ * "$Id: dirsvc.c 5940 2006-09-11 18:30:09Z mike $"
*
* Directory services routines for the Common UNIX Printing System (CUPS).
*
@@ -1050,9 +1050,9 @@ cupsdStartPolling(void)
int i; /* Looping var */
cupsd_dirsvc_poll_t *pollp; /* Current polling server */
char polld[1024]; /* Poll daemon path */
- char sport[10]; /* Server port */
- char bport[10]; /* Browser port */
- char interval[10]; /* Poll interval */
+ char sport[255]; /* Server port */
+ char bport[255]; /* Browser port */
+ char interval[255]; /* Poll interval */
int statusfds[2]; /* Status pipe */
char *argv[6]; /* Arguments */
char *envp[100]; /* Environment */
@@ -3181,5 +3181,5 @@ slp_url_callback(
/*
- * End of "$Id: dirsvc.c 5889 2006-08-24 21:44:35Z mike $".
+ * End of "$Id: dirsvc.c 5940 2006-09-11 18:30:09Z mike $".
*/
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index d32a71505..22a21f496 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -1,5 +1,5 @@
/*
- * "$Id: ipp.c 5907 2006-08-30 02:18:28Z mike $"
+ * "$Id: ipp.c 5970 2006-09-19 20:11:08Z mike $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -638,8 +638,11 @@ cupsdProcessIPPRequest(
if (con->http.version == HTTP_1_1)
{
- httpPrintf(HTTP(con), "Transfer-Encoding: chunked\r\n\r\n");
- cupsdFlushHeader(con);
+ if (httpPrintf(HTTP(con), "Transfer-Encoding: chunked\r\n\r\n") < 0)
+ return (0);
+
+ if (cupsdFlushHeader(con) < 0)
+ return (0);
con->http.data_encoding = HTTP_ENCODE_CHUNKED;
}
@@ -651,9 +654,12 @@ cupsdProcessIPPRequest(
length = ippLength(con->response);
- httpPrintf(HTTP(con), "Content-Length: " CUPS_LLFMT "\r\n\r\n",
- CUPS_LLCAST length);
- cupsdFlushHeader(con);
+ if (httpPrintf(HTTP(con), "Content-Length: " CUPS_LLFMT "\r\n\r\n",
+ CUPS_LLCAST length) < 0)
+ return (0);
+
+ if (cupsdFlushHeader(con) < 0)
+ return (0);
con->http.data_encoding = HTTP_ENCODE_LENGTH;
con->http.data_remaining = length;
@@ -1121,7 +1127,7 @@ add_file(cupsd_client_t *con, /* I - Connection to client */
if (!compressions || !filetypes)
{
- cupsdCancelJob(job, 1);
+ cupsdCancelJob(job, 1, IPP_JOB_ABORTED);
send_ipp_status(con, IPP_INTERNAL_ERROR,
_("Unable to allocate memory for file types!"));
@@ -3077,10 +3083,7 @@ cancel_job(cupsd_client_t *con, /* I - Client connection */
* Cancel the job and return...
*/
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
- "Job canceled by \"%s\".", username);
-
- cupsdCancelJob(job, 0);
+ cupsdCancelJob(job, 0, IPP_JOB_CANCELED);
cupsdCheckJobs();
cupsdLogMessage(CUPSD_LOG_INFO, "Job %d was canceled by \"%s\".", jobid,
@@ -7521,7 +7524,7 @@ restart_job(cupsd_client_t *con, /* I - Client connection */
cupsdLoadJob(job);
- if (!job->attrs ||job->num_files == 0)
+ if (!job->attrs || job->num_files == 0)
{
/*
* Nope - return a "not possible" error...
@@ -8411,16 +8414,7 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */
return;
}
else if (con->response->request.status.status_code == IPP_OK)
- {
- cupsdCancelJob(job, 0);
-
- if (JobHistory)
- {
- job->state->values[0].integer = attr->values[0].integer;
- job->state_value = (ipp_jstate_t)attr->values[0].integer;
- cupsdSaveJob(job);
- }
- }
+ cupsdCancelJob(job, 0, (ipp_jstate_t)attr->values[0].integer);
break;
}
}
@@ -9231,5 +9225,5 @@ validate_user(cupsd_job_t *job, /* I - Job */
/*
- * End of "$Id: ipp.c 5907 2006-08-30 02:18:28Z mike $".
+ * End of "$Id: ipp.c 5970 2006-09-19 20:11:08Z mike $".
*/
diff --git a/scheduler/job.c b/scheduler/job.c
index 79370fbba..f8edfdf46 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -1,5 +1,5 @@
/*
- * "$Id: job.c 5889 2006-08-24 21:44:35Z mike $"
+ * "$Id: job.c 5974 2006-09-20 18:42:37Z mike $"
*
* Job management routines for the Common UNIX Printing System (CUPS).
*
@@ -148,11 +148,13 @@ cupsdAddJob(int priority, /* I - Job priority */
*/
void
-cupsdCancelJob(cupsd_job_t *job, /* I - Job to cancel */
- int purge) /* I - Purge jobs? */
+cupsdCancelJob(cupsd_job_t *job, /* I - Job to cancel */
+ int purge, /* I - Purge jobs? */
+ ipp_jstate_t newstate) /* I - New job state */
{
int i; /* Looping var */
char filename[1024]; /* Job filename */
+ cupsd_printer_t *printer; /* Printer used by job */
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCancelJob: id = %d", job->id);
@@ -161,18 +163,55 @@ cupsdCancelJob(cupsd_job_t *job, /* I - Job to cancel */
* Stop any processes that are working on the current job...
*/
+ printer = job->printer;
+
if (job->state_value == IPP_JOB_PROCESSING)
cupsdStopJob(job, 0);
cupsdLoadJob(job);
if (job->attrs)
- job->state->values[0].integer = IPP_JOB_CANCELLED;
+ job->state->values[0].integer = newstate;
- job->state_value = IPP_JOB_CANCELLED;
+ job->state_value = newstate;
set_time(job, "time-at-completed");
+ /*
+ * Send any pending notifications and then expire them...
+ */
+
+ switch (newstate)
+ {
+ default :
+ break;
+
+ case IPP_JOB_CANCELED :
+ cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, printer, job,
+ purge ? "Job purged." : "Job canceled.");
+ break;
+
+ case IPP_JOB_ABORTED :
+ cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, printer, job,
+ "Job aborted; please consult the error_log file "
+ "for details.");
+ break;
+
+ case IPP_JOB_COMPLETED :
+ /*
+ * Clear the printer's state_message and state_reasons and move on...
+ */
+
+ printer->state_message[0] = '\0';
+
+ cupsdSetPrinterReasons(printer, "");
+ cupsdSetPrinterState(printer, IPP_PRINTER_IDLE, 0);
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, printer, job,
+ "Job completed.");
+ break;
+ }
+
cupsdExpireSubscriptions(NULL, job);
/*
@@ -270,10 +309,7 @@ cupsdCancelJobs(const char *dest, /* I - Destination to cancel */
* Cancel all jobs matching this destination/user...
*/
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
- purge ? "Job purged." : "Job canceled.");
-
- cupsdCancelJob(job, purge);
+ cupsdCancelJob(job, purge, IPP_JOB_CANCELED);
}
cupsdCheckJobs();
@@ -361,7 +397,7 @@ cupsdCheckJobs(void)
"Job canceled because the destination printer/class has "
"gone away.");
- cupsdCancelJob(job, 1);
+ cupsdCancelJob(job, 1, IPP_JOB_ABORTED);
}
else if (printer)
{
@@ -415,8 +451,8 @@ cupsdCleanJobs(void)
for (job = (cupsd_job_t *)cupsArrayFirst(Jobs);
job && cupsArrayCount(Jobs) >= MaxJobs;
job = (cupsd_job_t *)cupsArrayNext(Jobs))
- if (job->state_value >= IPP_JOB_CANCELLED)
- cupsdCancelJob(job, 1);
+ if (job->state_value >= IPP_JOB_CANCELED)
+ cupsdCancelJob(job, 1, IPP_JOB_CANCELED);
}
@@ -437,7 +473,8 @@ cupsdFinishJob(cupsd_job_t *job) /* I - Job */
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdFinishJob: job->status is %d",
job->status);
- if (job->status_buffer && job->current_file >= job->num_files)
+ if (job->status_buffer &&
+ (job->status < 0 || job->current_file >= job->num_files))
{
/*
* Close the pipe and clear the input bit.
@@ -507,8 +544,7 @@ cupsdFinishJob(cupsd_job_t *job) /* I - Job */
cupsdStopJob(job, 0);
- if (!(printer->type & CUPS_PRINTER_REMOTE) ||
- (printer->type & CUPS_PRINTER_IMPLICIT))
+ if (job->dtype & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT))
{
/*
* Mark the job as pending again - we'll retry on another
@@ -549,12 +585,7 @@ cupsdFinishJob(cupsd_job_t *job) /* I - Job */
"after %d tries.",
job->id, JobRetryLimit);
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, printer, job,
- "Job canceled since it could not be sent after %d "
- "tries.",
- JobRetryLimit);
-
- cupsdCancelJob(job, 0);
+ cupsdCancelJob(job, 0, IPP_JOB_ABORTED);
}
else
{
@@ -563,10 +594,23 @@ cupsdFinishJob(cupsd_job_t *job) /* I - Job */
*/
set_hold_until(job, time(NULL) + JobRetryInterval);
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_STATE, job->printer, job,
+ "Job held due to fax errors; please consult "
+ "the error_log file for details.");
+ cupsdSetPrinterState(printer, IPP_PRINTER_IDLE, 0);
}
}
else if (!strcmp(printer->error_policy, "abort-job"))
- cupsdCancelJob(job, 0);
+ cupsdCancelJob(job, 0, IPP_JOB_ABORTED);
+ else
+ {
+ cupsdSetPrinterState(printer, IPP_PRINTER_STOPPED, 1);
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, printer, job,
+ "Job stopped due to backend errors; please consult "
+ "the error_log file for details.");
+ }
break;
case CUPS_BACKEND_CANCEL :
@@ -574,7 +618,7 @@ cupsdFinishJob(cupsd_job_t *job) /* I - Job */
* Cancel the job...
*/
- cupsdCancelJob(job, 0);
+ cupsdCancelJob(job, 0, IPP_JOB_CANCELED);
break;
case CUPS_BACKEND_HOLD :
@@ -583,8 +627,17 @@ cupsdFinishJob(cupsd_job_t *job) /* I - Job */
*/
cupsdStopJob(job, 0);
+
cupsdSetJobHoldUntil(job, "indefinite");
+
+ job->state->values[0].integer = IPP_JOB_HELD;
+ job->state_value = IPP_JOB_HELD;
+
cupsdSaveJob(job);
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, printer, job,
+ "Job held due to backend errors; please consult "
+ "the error_log file for details.");
break;
case CUPS_BACKEND_STOP :
@@ -593,13 +646,26 @@ cupsdFinishJob(cupsd_job_t *job) /* I - Job */
*/
cupsdStopJob(job, 0);
+
+ job->state->values[0].integer = IPP_JOB_PENDING;
+ job->state_value = IPP_JOB_PENDING;
+
cupsdSaveJob(job);
cupsdSetPrinterState(printer, IPP_PRINTER_STOPPED, 1);
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, printer, job,
+ "Job stopped due to backend errors; please consult "
+ "the error_log file for details.");
break;
case CUPS_BACKEND_AUTH_REQUIRED :
cupsdStopJob(job, 0);
+
cupsdSetJobHoldUntil(job, "authenticated");
+
+ job->state->values[0].integer = IPP_JOB_HELD;
+ job->state_value = IPP_JOB_HELD;
+
cupsdSaveJob(job);
cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, printer, job,
@@ -647,28 +713,9 @@ cupsdFinishJob(cupsd_job_t *job) /* I - Job */
* Close out this job...
*/
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, printer, job,
- "Job completed successfully.");
-
job_history = JobHistory && !(job->dtype & CUPS_PRINTER_REMOTE);
- cupsdCancelJob(job, 0);
-
- if (job_history)
- {
- job->state->values[0].integer = IPP_JOB_COMPLETED;
- job->state_value = IPP_JOB_COMPLETED;
- cupsdSaveJob(job);
- }
-
- /*
- * Clear the printer's state_message and state_reasons and move on...
- */
-
- printer->state_message[0] = '\0';
-
- cupsdSetPrinterReasons(printer, "");
-
+ cupsdCancelJob(job, 0, IPP_JOB_COMPLETED);
cupsdCheckJobs();
}
}
@@ -1194,12 +1241,22 @@ cupsdRestartJob(cupsd_job_t *job) /* I - Job */
if (job->state_value == IPP_JOB_STOPPED || job->num_files)
{
+ ipp_jstate_t old_state; /* Old job state */
+
+
cupsdLoadJob(job);
+ old_state = job->state_value;
+
job->tries = 0;
job->state->values[0].integer = IPP_JOB_PENDING;
job->state_value = IPP_JOB_PENDING;
+
cupsdSaveJob(job);
+
+ if (old_state > IPP_JOB_STOPPED)
+ cupsArrayAdd(ActiveJobs, job);
+
cupsdCheckJobs();
}
}
@@ -1532,17 +1589,9 @@ cupsdStopJob(cupsd_job_t *job, /* I - Job */
FilterLevel -= job->cost;
- if (job->status < 0 &&
- !(job->dtype & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT)) &&
- !(job->printer->type & CUPS_PRINTER_FAX) &&
- !strcmp(job->printer->error_policy, "stop-printer"))
- cupsdSetPrinterState(job->printer, IPP_PRINTER_STOPPED, 1);
- else if (job->printer->state != IPP_PRINTER_STOPPED)
+ if (job->printer->state == IPP_PRINTER_PROCESSING)
cupsdSetPrinterState(job->printer, IPP_PRINTER_IDLE, 0);
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdStopJob: printer state is %d",
- job->printer->state);
-
job->state->values[0].integer = IPP_JOB_STOPPED;
job->state_value = IPP_JOB_STOPPED;
job->printer->job = NULL;
@@ -1632,7 +1681,8 @@ cupsdUpdateJob(cupsd_job_t *job) /* I - Job to check */
int copies; /* Number of copies printed */
char message[1024], /* Message text */
*ptr; /* Pointer update... */
- int loglevel; /* Log level for message */
+ int loglevel, /* Log level for message */
+ event = 0; /* Events? */
while ((ptr = cupsdStatBufUpdate(job->status_buffer, &loglevel,
@@ -1678,6 +1728,7 @@ cupsdUpdateJob(cupsd_job_t *job) /* I - Job to check */
{
cupsdSetPrinterReasons(job->printer, message);
cupsdAddPrinterHistory(job->printer);
+ event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
}
else if (loglevel == CUPSD_LOG_ATTR)
{
@@ -1699,6 +1750,7 @@ cupsdUpdateJob(cupsd_job_t *job) /* I - Job to check */
cupsdSetString(&job->printer->recoverable, ptr);
cupsdAddPrinterHistory(job->printer);
+ event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
}
else if (!strncmp(message, "recovered:", 10))
{
@@ -1711,6 +1763,7 @@ cupsdUpdateJob(cupsd_job_t *job) /* I - Job to check */
cupsdSetString(&job->printer->recoverable, ptr);
cupsdAddPrinterHistory(job->printer);
+ event |= CUPSD_EVENT_PRINTER_STATE_CHANGED;
}
#endif /* __APPLE__ */
else if (loglevel <= CUPSD_LOG_INFO)
@@ -1728,6 +1781,13 @@ cupsdUpdateJob(cupsd_job_t *job) /* I - Job to check */
break;
}
+ if ((event & CUPSD_EVENT_PRINTER_STATE_CHANGED))
+ cupsdAddEvent(CUPSD_EVENT_PRINTER_STATE_CHANGED, job->printer, NULL,
+ (job->printer->type & CUPS_PRINTER_CLASS) ?
+ "Class \"%s\" state changed." :
+ "Printer \"%s\" state changed.",
+ job->printer->name);
+
if (ptr == NULL && !job->status_buffer->bufused)
{
/*
@@ -2297,7 +2357,7 @@ load_request_root(void)
cupsArrayAdd(Jobs, job);
if (job->state_value <= IPP_JOB_STOPPED)
- cupsArrayAdd(ActiveJobs,job);
+ cupsArrayAdd(ActiveJobs, job);
else
unload_job(job);
}
@@ -2437,10 +2497,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */
cupsdLogMessage(CUPSD_LOG_ERROR, "Job ID %d has no files! Canceling it!",
job->id);
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
- "Job canceled because it has no files.");
-
- cupsdCancelJob(job, 0);
+ cupsdCancelJob(job, 0, IPP_JOB_ABORTED);
return;
}
@@ -2503,13 +2560,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */
job->current_file ++;
if (job->current_file == job->num_files)
- {
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
- "Job canceled because it has no files that can be "
- "printed.");
-
- cupsdCancelJob(job, 0);
- }
+ cupsdCancelJob(job, 0, IPP_JOB_ABORTED);
return;
}
@@ -2586,13 +2637,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */
job->current_file ++;
if (job->current_file == job->num_files)
- {
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
- "Job canceled because the print file could not be "
- "decompressed.");
-
- cupsdCancelJob(job, 0);
- }
+ cupsdCancelJob(job, 0, IPP_JOB_ABORTED);
return;
}
@@ -2618,13 +2663,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */
job->current_file ++;
if (job->current_file == job->num_files)
- {
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
- "Job canceled because the port monitor could not be "
- "added.");
-
- cupsdCancelJob(job, 0);
- }
+ cupsdCancelJob(job, 0, IPP_JOB_ABORTED);
return;
}
@@ -2728,10 +2767,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */
FilterLevel -= job->cost;
- cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job,
- "Job canceled because the server ran out of memory.");
-
- cupsdCancelJob(job, 0);
+ cupsdCancelJob(job, 0, IPP_JOB_ABORTED);
return;
}
@@ -3426,5 +3462,5 @@ unload_job(cupsd_job_t *job) /* I - Job */
/*
- * End of "$Id: job.c 5889 2006-08-24 21:44:35Z mike $".
+ * End of "$Id: job.c 5974 2006-09-20 18:42:37Z mike $".
*/
diff --git a/scheduler/job.h b/scheduler/job.h
index 48148c969..5c1b540eb 100644
--- a/scheduler/job.h
+++ b/scheduler/job.h
@@ -1,5 +1,5 @@
/*
- * "$Id: job.h 5833 2006-08-16 20:05:58Z mike $"
+ * "$Id: job.h 5970 2006-09-19 20:11:08Z mike $"
*
* Print job definitions for the Common UNIX Printing System (CUPS) scheduler.
*
@@ -93,7 +93,8 @@ VAR int JobRetryLimit VALUE(5),
*/
extern cupsd_job_t *cupsdAddJob(int priority, const char *dest);
-extern void cupsdCancelJob(cupsd_job_t *job, int purge);
+extern void cupsdCancelJob(cupsd_job_t *job, int purge,
+ ipp_jstate_t newstate);
extern void cupsdCancelJobs(const char *dest, const char *username,
int purge);
extern void cupsdCheckJobs(void);
@@ -121,5 +122,5 @@ extern void cupsdUpdateJob(cupsd_job_t *job);
/*
- * End of "$Id: job.h 5833 2006-08-16 20:05:58Z mike $".
+ * End of "$Id: job.h 5970 2006-09-19 20:11:08Z mike $".
*/
diff --git a/scheduler/listen.c b/scheduler/listen.c
index 098705842..2c5ad2bd7 100644
--- a/scheduler/listen.c
+++ b/scheduler/listen.c
@@ -1,5 +1,5 @@
/*
- * "$Id: listen.c 5724 2006-07-12 19:42:35Z mike $"
+ * "$Id: listen.c 5970 2006-09-19 20:11:08Z mike $"
*
* Server listening routines for the Common UNIX Printing System (CUPS)
* scheduler.
@@ -352,7 +352,8 @@ cupsdStartListening(void)
if (!LocalPort && !have_domain)
{
cupsdLogMessage(CUPSD_LOG_EMERG,
- "No Listen or Port lines were found to allow access via localhost!");
+ "No Listen or Port lines were found to allow access via "
+ "localhost!");
/*
* Commit suicide...
@@ -386,7 +387,9 @@ cupsdStartListening(void)
}
cupsdSetEnv("CUPS_ENCRYPTION", encryptions[LocalEncryption]);
- cupsdSetEnvf("IPP_PORT", "%d", LocalPort);
+
+ if (LocalPort)
+ cupsdSetEnvf("IPP_PORT", "%d", LocalPort);
/*
* Resume listening for connections...
@@ -441,5 +444,5 @@ cupsdStopListening(void)
/*
- * End of "$Id: listen.c 5724 2006-07-12 19:42:35Z mike $".
+ * End of "$Id: listen.c 5970 2006-09-19 20:11:08Z mike $".
*/
diff --git a/scheduler/printers.c b/scheduler/printers.c
index 02e0a219a..936c9d0be 100644
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
@@ -1,5 +1,5 @@
/*
- * "$Id: printers.c 5828 2006-08-15 21:21:45Z mike $"
+ * "$Id: printers.c 5970 2006-09-19 20:11:08Z mike $"
*
* Printer routines for the Common UNIX Printing System (CUPS).
*
@@ -2386,6 +2386,9 @@ cupsdStopPrinter(cupsd_printer_t *p, /* I - Printer to stop */
job->state_value = IPP_JOB_PENDING;
cupsdSaveJob(job);
+
+ cupsdAddEvent(CUPSD_EVENT_JOB_STOPPED, p, job,
+ "Job stopped due to printer being paused");
}
}
@@ -2411,6 +2414,10 @@ cupsdUpdatePrinters(void)
p;
p = (cupsd_printer_t *)cupsArrayNext(Printers))
{
+ /*
+ * Remove remote printers if we are no longer browsing...
+ */
+
if (!Browsing && (p->type & (CUPS_PRINTER_IMPLICIT | CUPS_PRINTER_REMOTE)))
{
if (p->type & CUPS_PRINTER_IMPLICIT)
@@ -2421,8 +2428,6 @@ cupsdUpdatePrinters(void)
cupsArrayRestore(Printers);
continue;
}
- else if (!(p->type & CUPS_PRINTER_REMOTE))
- cupsdSetPrinterAttrs(p);
/*
* Update the operation policy pointer...
@@ -2430,6 +2435,13 @@ cupsdUpdatePrinters(void)
if ((p->op_policy_ptr = cupsdFindPolicy(p->op_policy)) == NULL)
p->op_policy_ptr = DefaultPolicyPtr;
+
+ /*
+ * Update printer attributes as needed...
+ */
+
+ if (!(p->type & CUPS_PRINTER_REMOTE))
+ cupsdSetPrinterAttrs(p);
}
}
@@ -2877,9 +2889,8 @@ add_printer_filter(
snprintf(p->state_message, sizeof(p->state_message),
"Filter \"%s\" for printer \"%s\" not available: %s",
program, p->name, strerror(errno));
- cupsdSetPrinterState(p, IPP_PRINTER_STOPPED, 0);
cupsdSetPrinterReasons(p, "+cups-missing-filter-error");
- cupsdAddPrinterHistory(p);
+ cupsdSetPrinterState(p, IPP_PRINTER_STOPPED, 0);
cupsdLogMessage(CUPSD_LOG_ERROR, "%s", p->state_message);
}
@@ -3316,5 +3327,5 @@ write_irix_state(cupsd_printer_t *p) /* I - Printer to update */
/*
- * End of "$Id: printers.c 5828 2006-08-15 21:21:45Z mike $".
+ * End of "$Id: printers.c 5970 2006-09-19 20:11:08Z mike $".
*/
diff --git a/scheduler/quotas.c b/scheduler/quotas.c
index db10d8677..7d3e4e3eb 100644
--- a/scheduler/quotas.c
+++ b/scheduler/quotas.c
@@ -1,5 +1,5 @@
/*
- * "$Id: quotas.c 5305 2006-03-18 03:05:12Z mike $"
+ * "$Id: quotas.c 5970 2006-09-19 20:11:08Z mike $"
*
* Quota routines for the Common UNIX Printing System (CUPS).
*
@@ -141,7 +141,7 @@ cupsdUpdateQuota(
if (attr->values[0].integer < curtime)
{
if (JobAutoPurge)
- cupsdCancelJob(job, 1);
+ cupsdCancelJob(job, 1, IPP_JOB_CANCELED);
continue;
}
@@ -166,7 +166,7 @@ cupsdUpdateQuota(
* 'add_quota()' - Add a quota record for this printer and user.
*/
-cupsd_quota_t * /* O - Quota data */
+static cupsd_quota_t * /* O - Quota data */
add_quota(cupsd_printer_t *p, /* I - Printer */
const char *username) /* I - User */
{
@@ -209,7 +209,7 @@ compare_quotas(const cupsd_quota_t *q1, /* I - First quota record */
* 'find_quota()' - Find a quota record.
*/
-cupsd_quota_t * /* O - Quota data */
+static cupsd_quota_t * /* O - Quota data */
find_quota(cupsd_printer_t *p, /* I - Printer */
const char *username) /* I - User */
{
@@ -230,5 +230,5 @@ find_quota(cupsd_printer_t *p, /* I - Printer */
/*
- * End of "$Id: quotas.c 5305 2006-03-18 03:05:12Z mike $".
+ * End of "$Id: quotas.c 5970 2006-09-19 20:11:08Z mike $".
*/
diff --git a/scheduler/testsub.c b/scheduler/testsub.c
new file mode 100644
index 000000000..62156bd17
--- /dev/null
+++ b/scheduler/testsub.c
@@ -0,0 +1,531 @@
+/*
+ * "$Id: testsub.c 5940 2006-09-11 18:30:09Z mike $"
+ *
+ * Scheduler notification tester for the Common UNIX Printing System (CUPS).
+ *
+ * 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
+ *
+ * Contents:
+ *
+ * main() - Subscribe to the .
+ * print_attributes() - Print the attributes in a request...
+ * sigterm_handler() - Flag when the user hits CTRL-C...
+ * usage() - Show program usage...
+ */
+
+/*
+ * Include necessary headers...
+ */
+
+#include