]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Now use the printer's name for the PPD instead of the name passed in by
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 17 Jun 1999 19:40:25 +0000 (19:40 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 17 Jun 1999 19:40:25 +0000 (19:40 +0000)
the client (files aren't case insensitive like printer names...)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@405 7a7537e8-13f0-0310-91df-b6672ffda945

scheduler/client.c

index edd9b57d7fb4b3496f19db39a4abedeeb420bae4..d0ea85ee560bfec35896f29068e0570afe525adf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: client.c,v 1.20 1999/06/09 20:07:02 mike Exp $"
+ * "$Id: client.c,v 1.21 1999/06/17 19:40:25 mike Exp $"
  *
  *   Client routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -251,6 +251,7 @@ ReadClient(client_t *con)   /* I - Client to read from */
   mime_type_t  *type;          /* MIME type of file */
   char         command[1024],  /* Command to run */
                *options;       /* Options/CGI data */
+  printer_t    *p;             /* Printer */
 
 
   status = HTTP_CONTINUE;
@@ -455,11 +456,22 @@ ReadClient(client_t *con) /* I - Client to read from */
              strcmp(con->uri + strlen(con->uri) - 4, ".ppd") == 0)
          {
           /*
-           * Send PPD file...
+           * Send PPD file - get the real printer name since printer
+           * names are not case sensitive but filename can be...
            */
 
-            sprintf(command, "/ppd/%s", con->uri + 10);
-           strcpy(con->uri, command);
+            if ((p = FindPrinter(con->uri + 10)) != NULL)
+             sprintf(con->uri, "/ppd/%s.ppd", p->name);
+           else
+           {
+             if (!SendError(con, HTTP_NOT_FOUND))
+             {
+               CloseClient(con);
+               return (0);
+             }
+
+             break;
+           }
          }
 
          if (strncmp(con->uri, "/printers", 9) == 0 ||
@@ -1614,5 +1626,5 @@ pipe_command(client_t *con,       /* I - Client connection */
 
 
 /*
- * End of "$Id: client.c,v 1.20 1999/06/09 20:07:02 mike Exp $".
+ * End of "$Id: client.c,v 1.21 1999/06/17 19:40:25 mike Exp $".
  */