]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix STRs 253 and 254 (backend and content-length fixes)
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 30 Aug 2003 23:12:10 +0000 (23:12 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 30 Aug 2003 23:12:10 +0000 (23:12 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@3893 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
backend/parallel.c
backend/serial.c
backend/socket.c
backend/usb.c
scheduler/client.c

index 14f1f6ecffc401f07cbdbb937841bea53533ec29..1579d911aa351447712733b44c3e2a7046275235 100644 (file)
@@ -1,8 +1,13 @@
-CHANGES.txt - 08/29/2003
+CHANGES.txt - 08/30/2003
 ------------------------
 
 CHANGES IN CUPS V1.1.20rc1
 
+       - Added backend tweeks and content-length check from Red
+         Hat (STR #253)
+       - The USB backend now uses the 8255 constants instead of
+         the standard constants when reporting printer status
+         bits on Linux (STR #254)
        - Added new cupsDoAuthentication(), cupsGetFd(),
          cupsGetFile(), cupsPutFd(), and cupsPutFile() functions
          to the CUPS API (STR #112)
index 186008fe1dc67660f68886f946b5c14599e18d6a..58fb5f11756e5d57484a2c4355d399c9bf897225 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: parallel.c,v 1.45 2002/12/17 18:56:33 swdev Exp $"
+ * "$Id: parallel.c,v 1.46 2003/08/30 23:12:09 mike Exp $"
  *
  *   Parallel port backend for the Common UNIX Printing System (CUPS).
  *
@@ -281,6 +281,9 @@ main(int  argc,             /* I - Number of command-line arguments (6 or 7) */
        bufptr += wbytes;
       }
 
+      if (wbytes < 0)
+        break;
+
       if (argc > 6)
        fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
                (unsigned long)tbytes);
@@ -672,5 +675,5 @@ list_devices(void)
 
 
 /*
- * End of "$Id: parallel.c,v 1.45 2002/12/17 18:56:33 swdev Exp $".
+ * End of "$Id: parallel.c,v 1.46 2003/08/30 23:12:09 mike Exp $".
  */
index 646cfbd8174047bf1429e9c40d5a995faaf1307c..68c7749d3141318d1ee45c4940b7afafb30d4383 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: serial.c,v 1.50 2002/12/17 18:56:34 swdev Exp $"
+ * "$Id: serial.c,v 1.51 2003/08/30 23:12:10 mike Exp $"
  *
  *   Serial port backend for the Common UNIX Printing System (CUPS).
  *
@@ -508,6 +508,9 @@ main(int  argc,             /* I - Number of command-line arguments (6 or 7) */
        bufptr += wbytes;
       }
 
+      if (wbytes < 0)
+        break;
+
       if (argc > 6)
        fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
                (unsigned long)tbytes);
@@ -987,5 +990,5 @@ list_devices(void)
 
 
 /*
- * End of "$Id: serial.c,v 1.50 2002/12/17 18:56:34 swdev Exp $".
+ * End of "$Id: serial.c,v 1.51 2003/08/30 23:12:10 mike Exp $".
  */
index 71bdb4c1bd1f9a2f912d996bc9cb4c0a9555c1a9..20ec5ce6511f4ede734ba95bc70695bc3ea7cce0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: socket.c,v 1.37 2003/04/10 12:57:40 mike Exp $"
+ * "$Id: socket.c,v 1.38 2003/08/30 23:12:10 mike Exp $"
  *
  *   AppSocket backend for the Common UNIX Printing System (CUPS).
  *
@@ -313,6 +313,9 @@ main(int  argc,                     /* I - Number of command-line arguments (6 or 7) */
        bufptr += wbytes;
       }
 
+      if (wbytes < 0)
+        break;
+
      /*
       * Check for possible data coming back from the printer...
       */
@@ -443,5 +446,5 @@ print_backchannel(const unsigned char *buffer,      /* I - Data buffer */
 
 
 /*
- * End of "$Id: socket.c,v 1.37 2003/04/10 12:57:40 mike Exp $".
+ * End of "$Id: socket.c,v 1.38 2003/08/30 23:12:10 mike Exp $".
  */
index c9af231493ffcea1e3c391c02d945c3cd4ab6ab5..34c44be7a94db2085b11d9b59c52cd95831b6a02 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: usb.c,v 1.46 2003/07/22 18:12:43 mike Exp $"
+ * "$Id: usb.c,v 1.47 2003/08/30 23:12:10 mike Exp $"
  *
  *   USB port backend for the Common UNIX Printing System (CUPS).
  *
@@ -236,17 +236,21 @@ main(int  argc,           /* I - Number of command-line arguments (6 or 7) */
   * do this while we write data to the printer, however at least some
   * Linux kernels have buggy USB drivers which don't like to be
   * queried while sending data to the printer...
+  *
+  * Also, we're using the 8255 constants instead of the ones that are
+  * supposed to be used, as it appears that the USB driver also doesn't
+  * follow standards...
   */
 
   if (ioctl(fd, LPGETSTATUS, &status) == 0)
   {
     fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
 
-    if (status & LP_NOPA)
+    if (!(status & LP_POUTPA))
       fputs("WARNING: Media tray empty!\n", stderr);
-    else if (status & LP_ERR)
+    else if (!(status & LP_PERRORP)
       fputs("WARNING: Printer fault!\n", stderr);
-    else if (status & LP_OFFL)
+    else if (!(status & LP_PSELECD))
       fputs("WARNING: Printer off-line.\n", stderr);
   }
 #endif /* __linux */
@@ -292,6 +296,9 @@ main(int  argc,             /* I - Number of command-line arguments (6 or 7) */
        bufptr += wbytes;
       }
 
+      if (wbytes < 0)
+        break;
+
       if (argc > 6)
        fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
                (unsigned long)tbytes);
@@ -795,5 +802,5 @@ open_device(const char *uri)                /* I - Device URI */
 
 
 /*
- * End of "$Id: usb.c,v 1.46 2003/07/22 18:12:43 mike Exp $".
+ * End of "$Id: usb.c,v 1.47 2003/08/30 23:12:10 mike Exp $".
  */
index b5b814e8c32ea911eb19ee5a359a09f04e1bb4a0..56c4e8fdec5ea6bfb9237883e89a85305530bb1a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: client.c,v 1.169 2003/08/01 20:00:52 mike Exp $"
+ * "$Id: client.c,v 1.170 2003/08/30 23:12:10 mike Exp $"
  *
  *   Client routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -1498,6 +1498,20 @@ ReadClient(client_t *con)        /* I - Client to read from */
 
              break;
             }
+           else if (atoi(con->http.fields[HTTP_FIELD_CONTENT_LENGTH]) < 0)
+           {
+            /*
+             * Negative content lengths are invalid!
+             */
+
+              if (!SendError(con, HTTP_BAD_REQUEST))
+             {
+               CloseClient(con);
+               return (0);
+             }
+
+             break;
+           }
 
            /*
            * Open a temporary file to hold the request...
@@ -3329,5 +3343,5 @@ CDSAWriteFunc(SSLConnectionRef connection,        /* I  - SSL/TLS connection */
 
 
 /*
- * End of "$Id: client.c,v 1.169 2003/08/01 20:00:52 mike Exp $".
+ * End of "$Id: client.c,v 1.170 2003/08/30 23:12:10 mike Exp $".
  */