-CHANGES.txt - 02/05/2004
+CHANGES.txt - 02/06/2004
------------------------
CHANGES IN CUPS V1.1.21rc1
+ - The LPD backend used the full length of the hostname
+ when creating the data and control filenames, which
+ causes problems with older systems that can't handle
+ long filenames (STR #560)
- The scheduler did not refresh the common printer data
after a fast reload; this prevented banner and other
information from being updated (STR #562)
/*
- * "$Id: lpd.c,v 1.56 2003/11/19 18:58:04 mike Exp $"
+ * "$Id: lpd.c,v 1.57 2004/02/06 21:01:51 mike Exp $"
*
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
*
timeout = 300;
sanitize_title = 1;
+#if defined(__APPLE__)
+ /* We want to use a reserved port if possible (3471949) */
+ reserve = 1;
+
+ /* We want to pass utf-8 characters, not re-map them (3071945) */
+ sanitize_title= 0;
+#endif
+
if ((options = strchr(resource, '?')) != NULL)
{
/*
while (copies > 0)
{
- snprintf(cptr, sizeof(control) - (cptr - control), "%cdfA%03d%s\n", format,
+ snprintf(cptr, sizeof(control) - (cptr - control), "%cdfA%03d%.15s\n", format,
getpid() % 1000, localhost);
cptr += strlen(cptr);
copies --;
}
snprintf(cptr, sizeof(control) - (cptr - control),
- "UdfA%03d%s\nN%s\n",
+ "UdfA%03d%.15s\nN%s\n",
getpid() % 1000, localhost, title);
fprintf(stderr, "DEBUG: Control file is:\n%s", control);
if (order == ORDER_CONTROL_DATA)
{
- if (lpd_command(fd, timeout, "\002%d cfA%03.3d%s\n", strlen(control),
+ if (lpd_command(fd, timeout, "\002%d cfA%03.3d%.15s\n", strlen(control),
getpid() % 1000, localhost))
return (1);
* Send the print file...
*/
- if (lpd_command(fd, timeout, "\003%u dfA%03.3d%s\n",
+ if (lpd_command(fd, timeout, "\003%u dfA%03.3d%.15s\n",
(unsigned)filestats.st_size, getpid() % 1000,
localhost))
return (1);
if (status == 0 && order == ORDER_DATA_CONTROL)
{
- if (lpd_command(fd, timeout, "\002%d cfA%03.3d%s\n", strlen(control),
+ if (lpd_command(fd, timeout, "\002%d cfA%03.3d%.15s\n", strlen(control),
getpid() % 1000, localhost))
return (1);
/*
- * End of "$Id: lpd.c,v 1.56 2003/11/19 18:58:04 mike Exp $".
+ * End of "$Id: lpd.c,v 1.57 2004/02/06 21:01:51 mike Exp $".
*/
// got a command - execute it
if (obj.isCmd()) {
if (printCommands) {
- obj.print(stdout);
+ fputs("DEBUG2: ", stderr);
+ obj.print(stderr);
for (i = 0; i < numArgs; ++i) {
- printf(" ");
- args[i].print(stdout);
+ putc(' ', stderr);
+ args[i].print(stderr);
}
- printf("\n");
- fflush(stdout);
+ putc('\n', stderr);
+ fflush(stderr);
}
execOp(&obj, args, numArgs);
obj.free();
} else {
error(getPos(), "Too many args in content stream");
if (printCommands) {
- printf("throwing away arg: ");
- obj.print(stdout);
- printf("\n");
- fflush(stdout);
+ fputs("DEBUG2: throwing away arg: ", stderr);
+ obj.print(stderr);
+ putc('\n', stderr);
+ fflush(stderr);
}
obj.free();
}
if (numArgs > 0) {
error(getPos(), "Leftover args in content stream");
if (printCommands) {
- printf("%d leftovers:", numArgs);
+ fprintf(stderr, "DEBUG2: %d leftovers:", numArgs);
for (i = 0; i < numArgs; ++i) {
- printf(" ");
- args[i].print(stdout);
+ putc(' ', stderr);
+ args[i].print(stderr);
}
- printf("\n");
- fflush(stdout);
+ putc('\n', stderr);
+ fflush(stderr);
}
for (i = 0; i < numArgs; ++i)
args[i].free();
return;
}
if (printCommands) {
- printf(" font: tag=%s name='%s' %g\n",
- font->getTag()->getCString(),
- font->getName() ? font->getName()->getCString() : "???",
- args[1].getNum());
- fflush(stdout);
+ fprintf(stderr, "DEBUG2: font: tag=%s name='%s' %g\n",
+ font->getTag()->getCString(),
+ font->getName() ? font->getName()->getCString() : "???",
+ args[1].getNum());
+ fflush(stderr);
}
state->setFont(font, args[1].getNum());
fontChanged = gTrue;
void Gfx::opBeginMarkedContent(Object args[], int numArgs) {
if (printCommands) {
- printf(" marked content: %s ", args[0].getName());
+ fprintf(stderr, "DEBUG2: marked content: %s ", args[0].getName());
if (numArgs == 2)
- args[2].print(stdout);
- printf("\n");
- fflush(stdout);
+ args[2].print(stderr);
+ putc('\n', stderr);
+ fflush(stderr);
}
}
void Gfx::opMarkPoint(Object args[], int numArgs) {
if (printCommands) {
- printf(" mark point: %s ", args[0].getName());
+ fprintf(stderr, "DEBUG2: mark point: %s ", args[0].getName());
if (numArgs == 2)
- args[2].print(stdout);
- printf("\n");
- fflush(stdout);
+ args[2].print(stderr);
+ putc('\n', stderr);
+ fflush(stderr);
}
}
Page *p;
if (globalParams->getPrintCommands()) {
- printf("***** page %d *****\n", page);
+ fprintf(stderr, "DEBUG2: ***** page %d *****\n", page);
}
p = catalog->getPage(page);
if (doLinks) {
cropBox = getCropBox();
if (globalParams->getPrintCommands()) {
- printf("***** MediaBox = ll:%g,%g ur:%g,%g\n",
- box.x1, box.y1, box.x2, box.y2);
+ fprintf(stderr, "DEBUG2: ***** MediaBox = ll:%g,%g ur:%g,%g\n",
+ box.x1, box.y1, box.x2, box.y2);
if (isCropped()) {
- printf("***** CropBox = ll:%g,%g ur:%g,%g\n",
- cropBox->x1, cropBox->y1, cropBox->x2, cropBox->y2);
+ fprintf(stderr, "DEBUG2: ***** CropBox = ll:%g,%g ur:%g,%g\n",
+ cropBox->x1, cropBox->y1, cropBox->x2, cropBox->y2);
}
- printf("***** Rotate = %d\n", attrs->getRotate());
+ fprintf(stderr, "DEBUG2: ***** Rotate = %d\n", attrs->getRotate());
}
gfx = new Gfx(xref, out, num, attrs->getResourceDict(),
obj.free();
if (annotList->getNumAnnots() > 0) {
if (globalParams->getPrintCommands()) {
- printf("***** Annotations\n");
+ fprintf(stderr, "DEBUG2: ***** Annotations\n");
}
for (i = 0; i < annotList->getNumAnnots(); ++i) {
annotList->getAnnot(i)->draw(gfx);
//
-// "$Id: pdftops.cxx,v 1.19 2004/02/02 22:41:09 mike Exp $"
+// "$Id: pdftops.cxx,v 1.20 2004/02/06 21:01:51 mike Exp $"
//
// PDF to PostScript filter front-end for the Common UNIX Printing
// System (CUPS).
int temp; // Temporary var
int duplex; // Duplex the output?
int fit; // Fit the pages to the output
+ int printCommands; // Output debug info for commands?
// Make sure status messages are not buffered...
break;
}
+ if ((val = cupsGetOption("debug", num_options, options)) != NULL &&
+ strcasecmp(val, "no") && strcasecmp(val, "off") &&
+ strcasecmp(val, "false"))
+ printCommands = 1;
+ else
+ printCommands = 0;
+
if ((val = cupsGetOption("fitplot", num_options, options)) != NULL &&
strcasecmp(val, "no") && strcasecmp(val, "off") &&
strcasecmp(val, "false"))
globalParams->setPSEmbedTrueType(1);
globalParams->setPSEmbedCIDPostScript(1);
globalParams->setErrQuiet(0);
- globalParams->setPrintCommands(0);
+ globalParams->setPrintCommands(printCommands);
+
+ if (printCommands)
+ setbuf(stdout, NULL);
// open PDF file
doc = new PDFDoc(fileName, NULL, NULL);
//
-// End of "$Id: pdftops.cxx,v 1.19 2004/02/02 22:41:09 mike Exp $".
+// End of "$Id: pdftops.cxx,v 1.20 2004/02/06 21:01:51 mike Exp $".
//