]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 8 Apr 2003 03:48:16 +0000 (03:48 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 8 Apr 2003 03:48:16 +0000 (03:48 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3567 7a7537e8-13f0-0310-91df-b6672ffda945

15 files changed:
cgi-bin/admin.c
cgi-bin/classes.c
cgi-bin/ipp-var.c
cgi-bin/ipp-var.h
cgi-bin/jobs.c
cgi-bin/printers.c
cups/http.c
cups/ipp.c
cups/testipp.c
cups/util.c
scheduler/client.c
scheduler/ipp.c
scheduler/job.c
templates/printers.tmpl
test/run-stp-tests.sh

index bc8d8721fa5dcc4ade113081244e61f5c2d446ed..785e6fc122f77b2484ae17aebd42e214a145d164 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: admin.c,v 1.22.2.21 2003/03/21 17:09:50 mike Exp $"
+ * "$Id: admin.c,v 1.22.2.22 2003/04/08 03:48:02 mike Exp $"
  *
  *   Administration CGI for the Common UNIX Printing System (CUPS).
  *
@@ -233,7 +233,7 @@ do_am_class(http_t      *http,              /* I - HTTP connection */
 
       if ((response = cupsDoRequest(http, request, "/")) != NULL)
       {
-       ippSetCGIVars(response, NULL, NULL, NULL);
+       ippSetCGIVars(response, NULL, NULL, NULL, 0);
        ippDelete(response);
       }
 
@@ -548,7 +548,7 @@ do_am_printer(http_t      *http,    /* I - HTTP connection */
       */
 
       if (oldinfo)
-       ippSetCGIVars(oldinfo, NULL, NULL, NULL);
+       ippSetCGIVars(oldinfo, NULL, NULL, NULL, 0);
 
       cgiCopyTemplateLang(stdout, TEMPLATES, "modify-printer.tmpl", getenv("LANG"));
     }
@@ -610,7 +610,7 @@ do_am_printer(http_t      *http,    /* I - HTTP connection */
 
     if ((response = cupsDoRequest(http, request, "/")) != NULL)
     {
-      ippSetCGIVars(response, NULL, NULL, NULL);
+      ippSetCGIVars(response, NULL, NULL, NULL, 0);
       ippDelete(response);
     }
 
@@ -776,7 +776,7 @@ do_am_printer(http_t      *http,    /* I - HTTP connection */
 
         strlcpy(make, var, sizeof(make));
 
-        ippSetCGIVars(response, "ppd-make", make, NULL);
+        ippSetCGIVars(response, "ppd-make", make, NULL, 0);
        cgiCopyTemplateLang(stdout, TEMPLATES, "choose-model.tmpl",
                            getenv("LANG"));
       }
@@ -1547,5 +1547,5 @@ get_line(char *buf,       /* I - Line buffer */
 
 
 /*
- * End of "$Id: admin.c,v 1.22.2.21 2003/03/21 17:09:50 mike Exp $".
+ * End of "$Id: admin.c,v 1.22.2.22 2003/04/08 03:48:02 mike Exp $".
  */
index 1e4e66ac1859c8fa39cff87e54cd0e76bace70fe..7a89a4ec563692e3c8c072c3f2893cf92bc81042 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: classes.c,v 1.18.2.7 2003/03/21 17:09:50 mike Exp $"
+ * "$Id: classes.c,v 1.18.2.8 2003/04/08 03:48:03 mike Exp $"
  *
  *   Class status CGI for the Common UNIX Printing System (CUPS).
  *
@@ -211,7 +211,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
 
     if ((response = cupsDoRequest(http, request, "/")) != NULL)
     {
-      ippSetCGIVars(response, NULL, NULL, NULL);
+      ippSetCGIVars(response, NULL, NULL, NULL, 0);
       ippDelete(response);
     }
 
@@ -262,7 +262,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
 
       if ((response = cupsDoRequest(http, request, "/")) != NULL)
       {
-       ippSetCGIVars(response, NULL, NULL, NULL);
+       ippSetCGIVars(response, NULL, NULL, NULL, 0);
        ippDelete(response);
 
        cgiCopyTemplateLang(stdout, TEMPLATES, "jobs.tmpl", getenv("LANG"));
@@ -323,7 +323,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
                                       CUPS_DATADIR "/data/testprint.ps")) != NULL)
     {
       status = response->request.status.status_code;
-      ippSetCGIVars(response, NULL, NULL, NULL);
+      ippSetCGIVars(response, NULL, NULL, NULL, 0);
 
       ippDelete(response);
     }
@@ -359,5 +359,5 @@ main(int  argc,                     /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: classes.c,v 1.18.2.7 2003/03/21 17:09:50 mike Exp $".
+ * End of "$Id: classes.c,v 1.18.2.8 2003/04/08 03:48:03 mike Exp $".
  */
index 8a146a4961ee64a6ecd07914a886d493f2927738..9fb570706208b277eb5a4c5612e0b2305099a412 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp-var.c,v 1.23.2.9 2003/03/21 17:09:50 mike Exp $"
+ * "$Id: ipp-var.c,v 1.23.2.10 2003/04/08 03:48:03 mike Exp $"
  *
  *   IPP variable routines for the Common UNIX Printing System (CUPS).
  *
@@ -87,7 +87,8 @@ void
 ippSetCGIVars(ipp_t      *response,    /* I - Response data to be copied... */
               const char *filter_name, /* I - Filter name */
              const char *filter_value, /* I - Filter value */
-             const char *prefix)       /* I - Prefix for name or NULL */
+             const char *prefix,       /* I - Prefix for name or NULL */
+             int        parent_el)     /* I - Parent element number */
 {
   int                  element;        /* Element in CGI array */
   ipp_attribute_t      *attr,          /* Attribute in response... */
@@ -109,11 +110,15 @@ ippSetCGIVars(ipp_t      *response,       /* I - Response data to be copied... */
   struct tm            *date;          /* Date information */
 
 
+  DEBUG_printf(("<P>ippSetCGIVars(response=%p, filter_name=\"%s\", filter_value=\"%s\", prefix=\"%s\")\n",
+                response, filter_name, filter_value, prefix));
+  
  /*
   * Set common CGI template variables...
   */
 
-  ippSetServerVersion();
+  if (!prefix)
+    ippSetServerVersion();
 
  /*
   * Get the server name associated with the client interface as well as
@@ -134,11 +139,13 @@ ippSetCGIVars(ipp_t      *response,       /* I - Response data to be copied... */
   * Loop through the attributes and set them for the template...
   */
 
-  for (attr = response->attrs;
-       attr && attr->group_tag == IPP_TAG_OPERATION;
-       attr = attr->next);
+  attr = response->attrs;
 
-  for (element = 0; attr != NULL; attr = attr->next, element ++)
+  if (!prefix)
+    while (attr && attr->group_tag == IPP_TAG_OPERATION)
+     attr = attr->next;
+
+  for (element = parent_el; attr != NULL; attr = attr->next, element ++)
   {
    /*
     * Copy attributes to a separator...
@@ -309,13 +316,15 @@ ippSetCGIVars(ipp_t      *response,       /* I - Response data to be copied... */
          case IPP_TAG_KEYWORD :
          case IPP_TAG_CHARSET :
          case IPP_TAG_LANGUAGE :
+         case IPP_TAG_MIMETYPE :
              strlcat(valptr, attr->values[i].string.text,
                      sizeof(value) - (valptr - value));
              break;
 
           case IPP_TAG_BEGIN_COLLECTION :
+             snprintf(value, sizeof(value), "%s%d", name, i + 1);
               ippSetCGIVars(attr->values[i].collection, filter_name,
-                           filter_value, name);
+                           filter_value, value, element);
               break;
 
           default :
@@ -328,17 +337,21 @@ ippSetCGIVars(ipp_t      *response,       /* I - Response data to be copied... */
       */
 
       if (attr->value_tag != IPP_TAG_BEGIN_COLLECTION)
+      {
         cgiSetArray(name, element, value);
 
-/*      fprintf(stderr, "DEBUG: %s[%d]=\"%s\"\n", name, element, value);*/
+        DEBUG_printf(("<P>%s[%d]=\"%s\"\n", name, element, value));
+      }
     }
 
     if (attr == NULL)
       break;
   }
+
+  DEBUG_puts("<P>Leaving ippSetCGIVars()...");
 }
 
 
 /*
- * End of "$Id: ipp-var.c,v 1.23.2.9 2003/03/21 17:09:50 mike Exp $".
+ * End of "$Id: ipp-var.c,v 1.23.2.10 2003/04/08 03:48:03 mike Exp $".
  */
index 2333c40d9cfc109903ba16fec39133c25f154baf..cb2f12f36c6f308796f682f47d5ed206b22e4bfa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp-var.h,v 1.5.2.3 2003/03/21 17:09:51 mike Exp $"
+ * "$Id: ipp-var.h,v 1.5.2.4 2003/04/08 03:48:03 mike Exp $"
  *
  *   IPP variable definitions for the Common UNIX Printing System (CUPS).
  *
 
 extern char    *ippGetTemplateDir(void);
 extern void    ippSetServerVersion(void);
-extern void    ippSetCGIVars(ipp_t *, const char *, const char *, const char *);
+extern void    ippSetCGIVars(ipp_t *, const char *, const char *,
+                             const char *, int);
 
 
 /*
- * End of "$Id: ipp-var.h,v 1.5.2.3 2003/03/21 17:09:51 mike Exp $".
+ * End of "$Id: ipp-var.h,v 1.5.2.4 2003/04/08 03:48:03 mike Exp $".
  */
index abf8cb54c39a930a115f29b2c12d575908fd0359..defab0b742cc7670d81eb079b130aa5a46b6af4d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: jobs.c,v 1.15.2.9 2003/03/21 17:09:51 mike Exp $"
+ * "$Id: jobs.c,v 1.15.2.10 2003/04/08 03:48:03 mike Exp $"
  *
  *   Job status CGI for the Common UNIX Printing System (CUPS).
  *
@@ -145,7 +145,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
 
     if ((response = cupsDoRequest(http, request, "/")) != NULL)
     {
-      ippSetCGIVars(response, NULL, NULL, NULL);
+      ippSetCGIVars(response, NULL, NULL, NULL, 0);
       ippDelete(response);
 
       cgiCopyTemplateLang(stdout, TEMPLATES, "jobs.tmpl", getenv("LANG"));
@@ -255,5 +255,5 @@ do_job_op(http_t      *http,                /* I - HTTP connection */
 
 
 /*
- * End of "$Id: jobs.c,v 1.15.2.9 2003/03/21 17:09:51 mike Exp $".
+ * End of "$Id: jobs.c,v 1.15.2.10 2003/04/08 03:48:03 mike Exp $".
  */
index ea6728fee85af84193522686c36857c9e5cba200..9e0fa5f29c747e2ec41daf41ba73904dc7ed876f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: printers.c,v 1.21.2.8 2003/03/21 17:09:51 mike Exp $"
+ * "$Id: printers.c,v 1.21.2.9 2003/04/08 03:48:03 mike Exp $"
  *
  *   Printer status CGI for the Common UNIX Printing System (CUPS).
  *
@@ -54,6 +54,8 @@ main(int  argc,                       /* I - Number of command-line arguments */
   const char   *op;            /* Operation to perform, if any */
  
 
+  setbuf(stdout, NULL);
+
  /*
   * Get any form variables...
   */
@@ -77,7 +79,8 @@ main(int  argc,                       /* I - Number of command-line arguments */
   * Tell the client to expect HTML...
   */
 
-  printf("Content-Type: text/html;charset=%s\n\n", cupsLangEncoding(language));
+  printf("Content-Type: text/html;charset=%s\r\n\r\n",
+         cupsLangEncoding(language));
 
  /*
   * See if we need to show a list of printers or the status of a
@@ -211,9 +214,15 @@ main(int  argc,                    /* I - Number of command-line arguments */
 
     if ((response = cupsDoRequest(http, request, "/")) != NULL)
     {
-      ippSetCGIVars(response, NULL, NULL, NULL);
+      ippSetCGIVars(response, NULL, NULL, NULL, 0);
       ippDelete(response);
     }
+    else if (printer)
+      fprintf(stderr, "ERROR: Get-Printer-Attributes request failed - %s (%x)\n",
+              ippErrorString(cupsLastError()), cupsLastError());
+    else
+      fprintf(stderr, "ERROR: CUPS-Get-Printers request failed - %s (%x)\n",
+              ippErrorString(cupsLastError()), cupsLastError());
 
    /*
     * Write the report...
@@ -262,11 +271,14 @@ main(int  argc,                   /* I - Number of command-line arguments */
 
       if ((response = cupsDoRequest(http, request, "/")) != NULL)
       {
-       ippSetCGIVars(response, NULL, NULL, NULL);
+       ippSetCGIVars(response, NULL, NULL, NULL, 0);
        ippDelete(response);
 
        cgiCopyTemplateLang(stdout, TEMPLATES, "jobs.tmpl", getenv("LANG"));
       }
+      else
+       fprintf(stderr, "ERROR: Get-Jobs request failed - %s (%x)\n",
+               ippErrorString(cupsLastError()), cupsLastError());
     }
   }
   else
@@ -323,7 +335,7 @@ main(int  argc,                     /* I - Number of command-line arguments */
                                       CUPS_DATADIR "/data/testprint.ps")) != NULL)
     {
       status = response->request.status.status_code;
-      ippSetCGIVars(response, NULL, NULL, NULL);
+      ippSetCGIVars(response, NULL, NULL, NULL, 0);
 
       ippDelete(response);
     }
@@ -359,5 +371,5 @@ main(int  argc,                     /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: printers.c,v 1.21.2.8 2003/03/21 17:09:51 mike Exp $".
+ * End of "$Id: printers.c,v 1.21.2.9 2003/04/08 03:48:03 mike Exp $".
  */
index 601bd73eda4bd8057223edc38490a81563275430..1bd275738e26715eede59d55c8eb5c6f848bd9b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: http.c,v 1.82.2.30 2003/03/31 19:20:11 mike Exp $"
+ * "$Id: http.c,v 1.82.2.31 2003/04/08 03:48:04 mike Exp $"
  *
  *   HTTP routines for the Common UNIX Printing System (CUPS).
  *
@@ -822,7 +822,10 @@ httpFlush(http_t *http)    /* I - HTTP data */
   char buffer[8192];   /* Junk buffer */
 
 
-  while (httpRead(http, buffer, sizeof(buffer)) > 0);
+  if (http->state != HTTP_WAITING)
+  {
+    while (httpRead(http, buffer, sizeof(buffer)) > 0);
+  }
 }
 
 
@@ -1644,6 +1647,7 @@ httpUpdate(http_t *http)          /* I - HTTP data */
        case HTTP_POST_RECV :
        case HTTP_PUT :
            http->state ++;
+       case HTTP_POST_SEND :
            break;
 
        default :
@@ -1861,7 +1865,7 @@ httpEncode64(char       *out,     /* I - String to write to */
 int                            /* O - Content length */
 httpGetLength(http_t *http)    /* I - HTTP data */
 {
-  DEBUG_printf(("httpGetLength(%p)\n", http));
+  DEBUG_printf(("httpGetLength(%p), state = %d\n", http, http->state));
 
   if (strcasecmp(http->fields[HTTP_FIELD_TRANSFER_ENCODING], "chunked") == 0)
   {
@@ -2387,5 +2391,5 @@ CDSAWriteFunc(SSLConnectionRef connection,        /* I  - SSL/TLS connection */
 
 
 /*
- * End of "$Id: http.c,v 1.82.2.30 2003/03/31 19:20:11 mike Exp $".
+ * End of "$Id: http.c,v 1.82.2.31 2003/04/08 03:48:04 mike Exp $".
  */
index c6372a6205bfeea1d5a21c030e6cfd5713ecf90c..07b79f6c4c1f370a8957284ae5dc7715b1e7ae38 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.55.2.33 2003/03/26 20:31:56 mike Exp $"
+ * "$Id: ipp.c,v 1.55.2.34 2003/04/08 03:48:05 mike Exp $"
  *
  *   Internet Printing Protocol support functions for the Common UNIX
  *   Printing System (CUPS).
@@ -824,11 +824,14 @@ ipp_state_t                                       /* O - Current state */
 ippRead(http_t *http,                          /* I - HTTP connection */
         ipp_t  *ipp)                           /* I - IPP data */
 {
-  DEBUG_printf(("ippRead(%p, %p)\n", http, ipp));
+  DEBUG_printf(("ippRead(http=%p, ipp=%p), data_remaining=%d\n", http, ipp,
+                http ? http->data_remaining : -1));
 
   if (http == NULL)
     return (IPP_ERROR);
 
+  DEBUG_printf(("http->state = %d\n", http->state));
+
   return (ippReadIO(http, (ipp_iocb_t)ipp_read_http,
                     http->blocking || http->used != 0, NULL, ipp));
 }
@@ -1113,7 +1116,10 @@ ippReadIO(void       *src,                       /* I - Data source */
            case IPP_TAG_INTEGER :
            case IPP_TAG_ENUM :
                if ((*cb)(src, buffer, 4) < 4)
+               {
+                 DEBUG_puts("ippReadIO: Unable to read integer value!");
                  return (IPP_ERROR);
+               }
 
                n = (((((buffer[0] << 8) | buffer[1]) << 8) | buffer[2]) << 8) |
                    buffer[3];
@@ -1122,7 +1128,10 @@ ippReadIO(void       *src,                       /* I - Data source */
                break;
            case IPP_TAG_BOOLEAN :
                if ((*cb)(src, buffer, 1) < 1)
+               {
+                 DEBUG_puts("ippReadIO: Unable to read boolean value!");
                  return (IPP_ERROR);
+               }
 
                 value->boolean = buffer[0];
                break;
@@ -1138,18 +1147,27 @@ ippReadIO(void       *src,                      /* I - Data source */
                 value->string.text = calloc(n + 1, 1);
 
                if ((*cb)(src, (ipp_uchar_t *)value->string.text, n) < n)
+               {
+                 DEBUG_puts("ippReadIO: Unable to read string value!");
                  return (IPP_ERROR);
+               }
 
                DEBUG_printf(("ippReadIO: value = \'%s\'\n",
                              value->string.text));
                break;
            case IPP_TAG_DATE :
                if ((*cb)(src, value->date, 11) < 11)
+               {
+                 DEBUG_puts("ippReadIO: Unable to date integer value!");
                  return (IPP_ERROR);
+               }
                break;
            case IPP_TAG_RESOLUTION :
                if ((*cb)(src, buffer, 9) < 9)
+               {
+                 DEBUG_puts("ippReadIO: Unable to read resolution value!");
                  return (IPP_ERROR);
+               }
 
                 value->resolution.xres =
                    (((((buffer[0] << 8) | buffer[1]) << 8) | buffer[2]) << 8) |
@@ -1162,7 +1180,10 @@ ippReadIO(void       *src,                       /* I - Data source */
                break;
            case IPP_TAG_RANGE :
                if ((*cb)(src, buffer, 8) < 8)
+               {
+                 DEBUG_puts("ippReadIO: Unable to read range value!");
                  return (IPP_ERROR);
+               }
 
                 value->range.lower =
                    (((((buffer[0] << 8) | buffer[1]) << 8) | buffer[2]) << 8) |
@@ -1180,7 +1201,10 @@ ippReadIO(void       *src,                       /* I - Data source */
                }
 
                if ((*cb)(src, buffer, n) < n)
+               {
+                 DEBUG_puts("ippReadIO: Unable to read string w/language value!");
                  return (IPP_ERROR);
+               }
 
                 bufptr = buffer;
 
@@ -1218,15 +1242,26 @@ ippReadIO(void       *src,                      /* I - Data source */
                 value->collection = ippNew();
 
                 if (n > 0)
+               {
+                 DEBUG_puts("ippReadIO: begCollection tag with value length > 0!");
                  return (IPP_ERROR);
+               }
 
                if (ippReadIO(src, cb, 1, ipp, value->collection) == IPP_ERROR)
+               {
+                 DEBUG_puts("ippReadIO: Unable to read collection value!");
                  return (IPP_ERROR);
+               }
                 break;
 
             case IPP_TAG_END_COLLECTION :
                 if (n > 0)
+               {
+                 DEBUG_puts("ippReadIO: endCollection tag with value length > 0!");
                  return (IPP_ERROR);
+               }
+
+               DEBUG_puts("ippReadIO: endCollection tag...");
 
                return (ipp->state = IPP_DATA);
 
@@ -1239,7 +1274,12 @@ ippReadIO(void       *src,                       /* I - Data source */
                attr->name = calloc(n + 1, 1);
 
                if ((*cb)(src, (ipp_uchar_t *)attr->name, n) < n)
+               {
+                 DEBUG_puts("ippReadIO: Unable to read member name value!");
                  return (IPP_ERROR);
+               }
+
+               DEBUG_printf(("ippReadIO: member name = \"%s\"\n", attr->name));
                break;
 
             default : /* Other unsupported values */
@@ -1248,7 +1288,10 @@ ippReadIO(void       *src,                       /* I - Data source */
                {
                  value->unknown.data = malloc(n);
                  if ((*cb)(src, value->unknown.data, n) < n)
+                 {
+                   DEBUG_puts("ippReadIO: Unable to read unsupported value!");
                    return (IPP_ERROR);
+                 }
                }
                else
                  value->unknown.data = NULL;
@@ -2275,6 +2318,9 @@ ipp_length(ipp_t *ipp,                            /* I - IPP request or collection */
     bytes += 2 * attr->num_values;     /* Name lengths */
     bytes += 2 * attr->num_values;     /* Value lengths */
 
+    if (collection)
+      bytes += 5;                      /* Add membername overhead */
+
     switch (attr->value_tag & ~IPP_TAG_COPY)
     {
       case IPP_TAG_INTEGER :
@@ -2335,9 +2381,9 @@ ipp_length(ipp_t *ipp,                            /* I - IPP request or collection */
               i < attr->num_values;
               i ++, value ++)
          {
-            bytes += 5;                /* Overhead of begCollection */
+/*            bytes += 5;*/            /* Overhead of begCollection */
             bytes += ipp_length(attr->values[i].collection, 1);
-            bytes += 5;                /* Overhead of endCollection */
+/*            bytes += 5;*/            /* Overhead of endCollection */
          }
          break;
 
@@ -2351,10 +2397,13 @@ ipp_length(ipp_t *ipp,                          /* I - IPP request or collection */
   }
 
  /*
-  * Finally, add 1 byte for the "end of attributes" tag and return...
+  * Finally, add 1 byte for the "end of attributes" tag or 5 bytes
+  * for the "end of collection" tag and return...
   */
 
-  if (!collection)
+  if (collection)
+    bytes += 5;
+  else
     bytes ++;
 
   DEBUG_printf(("bytes = %d\n", bytes));
@@ -2377,13 +2426,21 @@ ipp_read_http(http_t      *http,                /* I - Client connection */
   char         len[32];                        /* Length string */
   
 
+  DEBUG_printf(("ipp_read_http(http=%p, buffer=%p, length=%d)\n",
+                http, buffer, length));
+
  /*
   * Loop until all bytes are read...
   */
 
   for (tbytes = 0, bytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
   {
-    if (http->used > 0)
+    DEBUG_printf(("tbytes = %d, http->state = %d\n", tbytes, http->state));
+
+    if (http->state == HTTP_WAITING)
+      break;
+
+    if (http->used > 0 && http->data_encoding == HTTP_ENCODE_LENGTH)
     {
      /*
       * Do "fast read" from HTTP buffer directly...
@@ -2434,7 +2491,7 @@ ipp_read_http(http_t      *http,          /* I - Client connection */
         bytes = -1;
        break;
       }
-      else if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) <= 0)
+      else if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) < 0)
         break;
     }
   }
@@ -2446,6 +2503,8 @@ ipp_read_http(http_t      *http,          /* I - Client connection */
   if (tbytes == 0 && bytes < 0)
     tbytes = -1;
 
+  DEBUG_printf(("returning %d bytes...\n", tbytes));
+
   return (tbytes);
 }
 
@@ -2477,5 +2536,5 @@ ipp_write_file(int         *fd,                   /* I - File descriptor */
 
 
 /*
- * End of "$Id: ipp.c,v 1.55.2.33 2003/03/26 20:31:56 mike Exp $".
+ * End of "$Id: ipp.c,v 1.55.2.34 2003/04/08 03:48:05 mike Exp $".
  */
index 9bb90c464859b8070330b0114653bc85813accc7..6b7f7d8754bbe03546771c5793b3fe7691307356 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: testipp.c,v 1.1.2.2 2003/03/26 20:31:57 mike Exp $"
+ * "$Id: testipp.c,v 1.1.2.3 2003/04/08 03:48:06 mike Exp $"
  *
  *   IPP test program for the Common UNIX Printing System (CUPS).
  *
@@ -49,6 +49,27 @@ ipp_uchar_t  collection[] =                  /* Collection buffer */
                  0x01, 0x01,                   /* IPP version */
                  0x00, 0x02,                   /* Print-Job operation */
                  0x00, 0x00, 0x00, 0x01,       /* Request ID */
+                 IPP_TAG_OPERATION,
+                 IPP_TAG_CHARSET,
+                 0x00, 0x12,                   /* Name length + name */
+                 'a','t','t','r','i','b','u','t','e','s','-',
+                 'c','h','a','r','s','e','t',
+                 0x00, 0x05,                   /* Value length + value */
+                 'u','t','f','-','8',
+                 IPP_TAG_LANGUAGE,
+                 0x00, 0x1b,                   /* Name length + name */
+                 'a','t','t','r','i','b','u','t','e','s','-',
+                 'n','a','t','u','r','a','l','-','l','a','n',
+                 'g','u','a','g','e',
+                 0x00, 0x02,                   /* Value length + value */
+                 'e','n',
+                 IPP_TAG_URI,
+                 0x00, 0x0b,                   /* Name length + name */
+                 'p','r','i','n','t','e','r','-','u','r','i',
+                 0x00, 0x1c,                   /* Value length + value */
+                 'i','p','p',':','/','/','l','o','c','a','l',
+                 'h','o','s','t','/','p','r','i','n','t','e',
+                 'r','s','/','f','o','o',
                  IPP_TAG_JOB,                  /* job group tag */
                  IPP_TAG_BEGIN_COLLECTION,     /* begCollection tag */
                  0x00, 0x09,                   /* Name length + name */
@@ -98,6 +119,13 @@ main(int  argc,                     /* I - Number of command-line arguments */
   request->request.op.operation_id = IPP_PRINT_JOB;
   request->request.op.request_id   = 1;
 
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
+               "attributes-charset", NULL, "utf-8");
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
+               "attributes-natural-language", NULL, "en");
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
+               "printer-uri", NULL, "ipp://localhost/printers/foo");
+
   col = ippNew();
   ippAddString(col, IPP_TAG_JOB, IPP_TAG_KEYWORD, "media-color", NULL, "blue");
   ippAddCollection(request, IPP_TAG_JOB, "media-col", col);
@@ -218,5 +246,5 @@ write_cb(void        *data,
 
 
 /*
- * End of "$Id: testipp.c,v 1.1.2.2 2003/03/26 20:31:57 mike Exp $".
+ * End of "$Id: testipp.c,v 1.1.2.3 2003/04/08 03:48:06 mike Exp $".
  */
index cc1ca8a84a5edfd946dc6eb355c9f32f6b739d48..5cdd999af594eaab3e82880b681f759d931c62c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: util.c,v 1.81.2.22 2003/01/24 20:45:15 mike Exp $"
+ * "$Id: util.c,v 1.81.2.23 2003/04/08 03:48:06 mike Exp $"
  *
  *   Printing utilities for the Common UNIX Printing System (CUPS).
  *
@@ -100,6 +100,7 @@ cupsCancelJob(const char *name,     /* I - Name of printer or class */
 
   if (!cups_connect(name, printer, hostname))
   {
+    DEBUG_puts("Unable to connect to server!");
     last_error = IPP_SERVICE_UNAVAILABLE;
     return (0);
   }
@@ -182,6 +183,10 @@ cupsDoFileRequest(http_t     *http,        /* I - HTTP connection to server */
   char         prompt[1024];           /* Prompt string */
 
 
+  DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', \'%s\')\n",
+                http, request, resource ? resource : "(null)",
+               filename ? filename : "(null)"));
+
   if (http == NULL || request == NULL || resource == NULL)
   {
     if (request != NULL)
@@ -191,9 +196,6 @@ cupsDoFileRequest(http_t     *http, /* I - HTTP connection to server */
     return (NULL);
   }
 
-  DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', \'%s\')\n",
-                http, request, resource, filename ? filename : "(null)"));
-
  /*
   * See if we have a file to send...
   */
@@ -432,6 +434,7 @@ cupsDoFileRequest(http_t     *http, /* I - HTTP connection to server */
         * Delete the response...
        */
 
+        DEBUG_puts("IPP read error!");
        ippDelete(response);
        response = NULL;
 
@@ -467,7 +470,11 @@ cupsDoFileRequest(http_t     *http,        /* I - HTTP connection to server */
   else if (status == HTTP_UNAUTHORIZED)
     last_error = IPP_NOT_AUTHORIZED;
   else if (status != HTTP_OK)
+  {
+    DEBUG_printf(("HTTP error %d mapped to IPP_SERVICE_UNAVAILABLE!\n",
+                  status));
     last_error = IPP_SERVICE_UNAVAILABLE;
+  }
 
   return (response);
 }
@@ -526,6 +533,7 @@ cupsGetClasses(char ***classes)     /* O - Classes */
 
   if (!cups_connect("default", NULL, NULL))
   {
+    DEBUG_puts("Unable to connect to server!");
     last_error = IPP_SERVICE_UNAVAILABLE;
     return (0);
   }
@@ -640,6 +648,7 @@ cupsGetDefault(void)
 
   if (!cups_connect("default", NULL, NULL))
   {
+    DEBUG_puts("Unable to connect to server!");
     last_error = IPP_SERVICE_UNAVAILABLE;
     return (NULL);
   }
@@ -745,6 +754,7 @@ cupsGetJobs(cups_job_t **jobs,              /* O - Job data */
 
   if (!cups_connect("default", NULL, NULL))
   {
+    DEBUG_puts("Unable to connect to server!");
     last_error = IPP_SERVICE_UNAVAILABLE;
     return (0);
   }
@@ -995,6 +1005,7 @@ cupsGetPPD(const char *name)               /* I - Printer name */
 
   if (!cups_connect(name, printer, hostname))
   {
+    DEBUG_puts("Unable to connect to server!");
     last_error = IPP_SERVICE_UNAVAILABLE;
     return (NULL);
   }
@@ -1105,6 +1116,7 @@ cupsGetPPD(const char *name)              /* I - Printer name */
     if ((cups_server = httpConnectEncrypt(hostname, ippPort(),
                                           cupsEncryption())) == NULL)
     {
+      DEBUG_puts("Unable to connect to server!");
       last_error = IPP_SERVICE_UNAVAILABLE;
       return (NULL);
     }
@@ -1233,6 +1245,7 @@ cupsGetPPD(const char *name)              /* I - Printer name */
           last_error = IPP_NOT_FOUND;
          break;
       case HTTP_ERROR :
+          DEBUG_puts("Mapping HTTP error to IPP_SERVICE_UNAVAILABLE");
           last_error = IPP_SERVICE_UNAVAILABLE;
          break;
       case HTTP_UNAUTHORIZED :
@@ -1290,6 +1303,7 @@ cupsGetPrinters(char ***printers) /* O - Printers */
 
   if (!cups_connect("default", NULL, NULL))
   {
+    DEBUG_puts("Unable to connect to server!");
     last_error = IPP_SERVICE_UNAVAILABLE;
     return (0);
   }
@@ -1438,6 +1452,7 @@ cupsPrintFiles(const char    *name,       /* I - Printer or class name */
   {
     DEBUG_printf(("cupsPrintFile: Unable to open connection - %s.\n",
                   strerror(errno)));
+    DEBUG_puts("Unable to connect to server!");
     last_error = IPP_SERVICE_UNAVAILABLE;
     return (0);
   }
@@ -1631,6 +1646,7 @@ cups_connect(const char *name,            /* I - Destination (printer[@host]) */
   if ((cups_server = httpConnectEncrypt(hostname, ippPort(),
                                         cupsEncryption())) == NULL)
   {
+    DEBUG_puts("Unable to connect to server!");
     last_error = IPP_SERVICE_UNAVAILABLE;
     return (NULL);
   }
@@ -1728,5 +1744,5 @@ cups_local_auth(http_t *http)     /* I - Connection */
 
 
 /*
- * End of "$Id: util.c,v 1.81.2.22 2003/01/24 20:45:15 mike Exp $".
+ * End of "$Id: util.c,v 1.81.2.23 2003/04/08 03:48:06 mike Exp $".
  */
index 9c64e2588ba13750e8646d697bcafe44b0483f9c..45e8a58ec11451b7c0e67c32dd0e3d8f11569dd3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: client.c,v 1.91.2.56 2003/03/30 21:49:15 mike Exp $"
+ * "$Id: client.c,v 1.91.2.57 2003/04/08 03:48:07 mike Exp $"
  *
  *   Client routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -2925,6 +2925,9 @@ pipe_command(client_t *con,               /* I - Client connection */
                ipp_port[1024],         /* IPP_PORT environment variable */
                lang[1024],             /* LANG environment variable */
                ld_library_path[1024],  /* LD_LIBRARY_PATH environment variable */
+               ld_preload[1024],       /* LD_PRELOAD environment variable */
+               dyld_library_path[1024],/* DYLD_LIBRARY_PATH environment variable */
+               shlib_path[1024],       /* SHLIB_PATH environment variable */
                nlspath[1024],          /* NLSPATH environment variable */
                query_string[10240],    /* QUERY_STRING env variable */
                remote_addr[1024],      /* REMOTE_ADDR environment variable */
@@ -3054,17 +3057,26 @@ pipe_command(client_t *con,             /* I - Client connection */
              getenv("LD_LIBRARY_PATH"));
     envp[envc ++] = ld_library_path;
   }
-  else if (getenv("DYLD_LIBRARY_PATH") != NULL)
+
+  if (getenv("LD_PRELOAD") != NULL)
+  {
+    snprintf(ld_preload, sizeof(ld_preload), "LD_PRELOAD=%s",
+             getenv("LD_PRELOAD"));
+    envp[envc ++] = ld_preload;
+  }
+
+  if (getenv("DYLD_LIBRARY_PATH") != NULL)
   {
-    snprintf(ld_library_path, sizeof(ld_library_path), "DYLD_LIBRARY_PATH=%s",
+    snprintf(dyld_library_path, sizeof(dyld_library_path), "DYLD_LIBRARY_PATH=%s",
              getenv("DYLD_LIBRARY_PATH"));
-    envp[envc ++] = ld_library_path;
+    envp[envc ++] = dyld_library_path;
   }
-  else if (getenv("SHLIB_PATH") != NULL)
+
+  if (getenv("SHLIB_PATH") != NULL)
   {
-    snprintf(ld_library_path, sizeof(ld_library_path), "SHLIB_PATH=%s",
+    snprintf(shlib_path, sizeof(shlib_path), "SHLIB_PATH=%s",
              getenv("SHLIB_PATH"));
-    envp[envc ++] = ld_library_path;
+    envp[envc ++] = shlib_path;
   }
 
   if (getenv("NLSPATH") != NULL)
@@ -3330,5 +3342,5 @@ CDSAWriteFunc(SSLConnectionRef connection,        /* I  - SSL/TLS connection */
 
 
 /*
- * End of "$Id: client.c,v 1.91.2.56 2003/03/30 21:49:15 mike Exp $".
+ * End of "$Id: client.c,v 1.91.2.57 2003/04/08 03:48:07 mike Exp $".
  */
index af131504c51517c34cb0e00280bb179e88905c3c..425ac903a4dd6081e86e8907e9530b1a03e8d5eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ipp.c,v 1.127.2.57 2003/04/01 22:14:31 mike Exp $"
+ * "$Id: ipp.c,v 1.127.2.58 2003/04/08 03:48:08 mike Exp $"
  *
  *   IPP routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -451,11 +451,22 @@ ProcessIPPRequest(client_t *con)  /* I - Client connection */
 
   if (SendHeader(con, HTTP_OK, "application/ipp"))
   {
-    con->http.data_encoding = HTTP_ENCODE_LENGTH;
-    con->http.data_remaining = ippLength(con->response);
+#if 0
+    if (con->http.version == HTTP_1_1)
+    {
+      con->http.data_encoding = HTTP_ENCODE_CHUNKED;
+
+      httpPrintf(HTTP(con), "Transfer-Encoding: chunked\r\n\r\n");
+    }
+    else
+#endif /* 0 */
+    {
+      con->http.data_encoding  = HTTP_ENCODE_LENGTH;
+      con->http.data_remaining = ippLength(con->response);
 
-    httpPrintf(HTTP(con), "Content-Length: %d\r\n\r\n",
-               con->http.data_remaining);
+      httpPrintf(HTTP(con), "Content-Length: %d\r\n\r\n",
+                con->http.data_remaining);
+    }
 
     LogMessage(L_DEBUG2, "ProcessIPPRequest: Adding fd %d to OutputSet...",
                con->http.fd);
@@ -6581,5 +6592,5 @@ validate_user(client_t   *con,            /* I - Client connection */
 
 
 /*
- * End of "$Id: ipp.c,v 1.127.2.57 2003/04/01 22:14:31 mike Exp $".
+ * End of "$Id: ipp.c,v 1.127.2.58 2003/04/08 03:48:08 mike Exp $".
  */
index 7e9706cf56ff75af5d8fbf66b8f0b71fe49a8e36..61f15f3b078e96ba00138066427abdcd81fc110d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: job.c,v 1.124.2.62 2003/04/03 03:33:40 mike Exp $"
+ * "$Id: job.c,v 1.124.2.63 2003/04/08 03:48:13 mike Exp $"
  *
  *   Job management routines for the Common UNIX Printing System (CUPS).
  *
@@ -1149,56 +1149,53 @@ SetJobPriority(int id,          /* I - Job ID */
  */
 
 void
-StartJob(int       id,         /* I - Job ID */
-         printer_t *printer)   /* I - Printer to print job */
+StartJob(int       id,                 /* I - Job ID */
+         printer_t *printer)           /* I - Printer to print job */
 {
-  job_t                *current;       /* Current job */
-  int          i;              /* Looping var */
-  int          slot;           /* Pipe slot */
-  int          num_filters;    /* Number of filters for job */
-  mime_filter_t        *filters;       /* Filters for job */
-  char         method[255],    /* Method for output */
-               *optptr;        /* Pointer to options */
-  ipp_attribute_t *attr;       /* Current attribute */
-  int          pid;            /* Process ID of new filter process */
-  int          banner_page;    /* 1 if banner page, 0 otherwise */
-  int          statusfds[2],   /* Pipes used between the filters and scheduler */
-               filterfds[2][2];/* Pipes used between the filters */
-  char         *argv[8],       /* Filter command-line arguments */
-               filename[1024], /* Job filename */
-               command[1024],  /* Full path to filter/backend command */
-               jobid[255],     /* Job ID string */
-               title[IPP_MAX_NAME],
-                               /* Job title string */
-               copies[255],    /* # copies string */
-               *envp[21],      /* Environment variables */
+  job_t                *current;               /* Current job */
+  int          i;                      /* Looping var */
+  int          slot;                   /* Pipe slot */
+  int          num_filters;            /* Number of filters for job */
+  mime_filter_t        *filters;               /* Filters for job */
+  char         method[255],            /* Method for output */
+               *optptr;                /* Pointer to options */
+  ipp_attribute_t *attr;               /* Current attribute */
+  int          pid;                    /* Process ID of new filter process */
+  int          banner_page;            /* 1 if banner page, 0 otherwise */
+  int          statusfds[2],           /* Pipes used between the filters and scheduler */
+               filterfds[2][2];        /* Pipes used between the filters */
+  int          envc;                   /* Number of environment variables */
+  char         *argv[8],               /* Filter command-line arguments */
+               filename[1024],         /* Job filename */
+               command[1024],          /* Full path to filter/backend command */
+               jobid[255],             /* Job ID string */
+               title[IPP_MAX_NAME],    /* Job title string */
+               copies[255],            /* # copies string */
+               *envp[100],             /* Environment variables */
 #ifdef __APPLE__
-               processPath[1050],
-                               /* CFProcessPath environment variable */
+               processPath[1050],      /* CFProcessPath environment variable */
 #endif /* __APPLE__ */
-               path[1024],     /* PATH environment variable */
-               language[255],  /* LANG environment variable */
-               charset[255],   /* CHARSET environment variable */
-               classification[1024],
-                               /* CLASSIFICATION environment variable */
-               content_type[1024],
-                               /* CONTENT_TYPE environment variable */
-               device_uri[1024],
-                               /* DEVICE_URI environment variable */
-               ppd[1024],      /* PPD environment variable */
-               class_name[255],
-                               /* CLASS environment variable */
-               printer_name[255],
-                               /* PRINTER environment variable */
-               root[1024],     /* CUPS_SERVERROOT environment variable */
-               cache[255],     /* RIP_MAX_CACHE environment variable */
-               tmpdir[1024],   /* TMPDIR environment variable */
-               ldpath[1024],   /* LD_LIBRARY_PATH environment variable */
-               nlspath[1024],  /* NLSPATH environment variable */
-               datadir[1024],  /* CUPS_DATADIR environment variable */
-               fontpath[1050]; /* CUPS_FONTPATH environment variable */
-  static char  *options = NULL;/* Full list of options */
-  static int   optlength = 0;  /* Length of option buffer */
+               path[1024],             /* PATH environment variable */
+               language[255],          /* LANG environment variable */
+               charset[255],           /* CHARSET environment variable */
+               classification[1024],   /* CLASSIFICATION environment variable */
+               content_type[1024],     /* CONTENT_TYPE environment variable */
+               device_uri[1024],       /* DEVICE_URI environment variable */
+               ppd[1024],              /* PPD environment variable */
+               class_name[255],        /* CLASS environment variable */
+               printer_name[255],      /* PRINTER environment variable */
+               root[1024],             /* CUPS_SERVERROOT environment variable */
+               cache[255],             /* RIP_MAX_CACHE environment variable */
+               tmpdir[1024],           /* TMPDIR environment variable */
+               ld_library_path[1024],  /* LD_LIBRARY_PATH environment variable */
+               ld_preload[1024],       /* LD_PRELOAD environment variable */
+               dyld_library_path[1024],/* DYLD_LIBRARY_PATH environment variable */
+               shlib_path[1024],       /* SHLIB_PATH environment variable */
+               nlspath[1024],          /* NLSPATH environment variable */
+               datadir[1024],          /* CUPS_DATADIR environment variable */
+               fontpath[1050];         /* CUPS_FONTPATH environment variable */
+  static char  *options = NULL;        /* Full list of options */
+  static int   optlength = 0;          /* Length of option buffer */
 
 
   LogMessage(L_DEBUG, "StartJob(%d, %p)", id, printer);
@@ -1689,10 +1686,57 @@ StartJob(int       id,          /* I - Job ID */
   snprintf(datadir, sizeof(datadir), "CUPS_DATADIR=%s", DataDir);
   snprintf(fontpath, sizeof(fontpath), "CUPS_FONTPATH=%s", FontPath);
 
-  if (current->dtype & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT))
-    snprintf(class_name, sizeof(class_name), "CLASS=%s", current->dest);
-  else
-    class_name[0] = '\0';
+  envc = 0;
+
+  envp[envc ++] = path;
+  envp[envc ++] = "SOFTWARE=CUPS/1.1";
+  envp[envc ++] = "USER=root";
+  envp[envc ++] = charset;
+  envp[envc ++] = language;
+  envp[envc ++] = TZ;
+  envp[envc ++] = ppd;
+  envp[envc ++] = root;
+  envp[envc ++] = cache;
+  envp[envc ++] = tmpdir;
+  envp[envc ++] = content_type;
+  envp[envc ++] = device_uri;
+  envp[envc ++] = printer_name;
+  envp[envc ++] = datadir;
+  envp[envc ++] = fontpath;
+
+  if (getenv("LD_LIBRARY_PATH") != NULL)
+  {
+    snprintf(ld_library_path, sizeof(ld_library_path), "LD_LIBRARY_PATH=%s",
+             getenv("LD_LIBRARY_PATH"));
+    envp[envc ++] = ld_library_path;
+  }
+
+  if (getenv("LD_PRELOAD") != NULL)
+  {
+    snprintf(ld_preload, sizeof(ld_preload), "LD_PRELOAD=%s",
+             getenv("LD_PRELOAD"));
+    envp[envc ++] = ld_preload;
+  }
+
+  if (getenv("DYLD_LIBRARY_PATH") != NULL)
+  {
+    snprintf(dyld_library_path, sizeof(dyld_library_path), "DYLD_LIBRARY_PATH=%s",
+             getenv("DYLD_LIBRARY_PATH"));
+    envp[envc ++] = dyld_library_path;
+  }
+
+  if (getenv("SHLIB_PATH") != NULL)
+  {
+    snprintf(shlib_path, sizeof(shlib_path), "SHLIB_PATH=%s",
+             getenv("SHLIB_PATH"));
+    envp[envc ++] = shlib_path;
+  }
+
+  if (getenv("NLSPATH") != NULL)
+  {
+    snprintf(nlspath, sizeof(nlspath), "NLSPATH=%s", getenv("NLSPATH"));
+    envp[envc ++] = nlspath;
+  }
 
   if (Classification && !banner_page)
   {
@@ -1707,60 +1751,24 @@ StartJob(int       id,          /* I - Job ID */
     else
       snprintf(classification, sizeof(classification), "CLASSIFICATION=%s",
                attr->values[0].string.text);
+
+    envp[envc ++] = classification;
   }
-  else
-    classification[0] = '\0';
 
-  if (getenv("LD_LIBRARY_PATH") != NULL)
-    snprintf(ldpath, sizeof(ldpath), "LD_LIBRARY_PATH=%s",
-             getenv("LD_LIBRARY_PATH"));
-  else if (getenv("DYLD_LIBRARY_PATH") != NULL)
-    snprintf(ldpath, sizeof(ldpath), "DYLD_LIBRARY_PATH=%s",
-             getenv("DYLD_LIBRARY_PATH"));
-  else if (getenv("SHLIB_PATH") != NULL)
-    snprintf(ldpath, sizeof(ldpath), "SHLIB_PATH=%s",
-             getenv("SHLIB_PATH"));
-  else
-    ldpath[0] = '\0';
+  if (current->dtype & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT))
+  {
+    snprintf(class_name, sizeof(class_name), "CLASS=%s", current->dest);
+    envp[envc ++] = class_name;
+  }
 
-  if (getenv("NLSPATH") != NULL)
-    snprintf(nlspath, sizeof(nlspath), "NLSPATH=%s", getenv("NLSPATH"));
-  else
-    nlspath[0] = '\0';
-
-  envp[0]  = path;
-  envp[1]  = "SOFTWARE=CUPS/1.1";
-  envp[2]  = "USER=root";
-  envp[3]  = charset;
-  envp[4]  = language;
-  envp[5]  = TZ;
-  envp[6]  = ppd;
-  envp[7]  = root;
-  envp[8]  = cache;
-  envp[9]  = tmpdir;
-  envp[10] = content_type;
-  envp[11] = device_uri;
-  envp[12] = printer_name;
-  envp[13] = datadir;
-  envp[14] = fontpath;
-  envp[15] = ldpath;
-  envp[16] = nlspath;
-  envp[17] = classification;
-  envp[18] = class_name;
 #ifdef __APPLE__
-  envp[19] = processPath;
-  envp[20] = NULL;
-#else
-  envp[19] = NULL;
+  envp[envc ++] = processPath;
 #endif /* __APPLE__ */
 
-  LogMessage(L_DEBUG, "StartJob: envp = \"%s\",\"%s\",\"%s\",\"%s\","
-                      "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\","
-                     "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"",
-            envp[0], envp[1], envp[2], envp[3], envp[4],
-            envp[5], envp[6], envp[7], envp[8], envp[9],
-            envp[10], envp[11], envp[12], envp[13], envp[14],
-            envp[15], envp[16], envp[17], envp[18]);
+  envp[envc ++] = NULL;
+
+  for (i = 0; i < envc; i ++)
+    LogMessage(L_DEBUG, "StartJob: envp[%d]=\"%s\"", i, envp[i]);
 
   current->current_file ++;
 
@@ -2721,5 +2729,5 @@ start_process(const char *command,        /* I - Full path to command */
 
 
 /*
- * End of "$Id: job.c,v 1.124.2.62 2003/04/03 03:33:40 mike Exp $".
+ * End of "$Id: job.c,v 1.124.2.63 2003/04/08 03:48:13 mike Exp $".
  */
index 1505c36bac7ed8ee15521136c3442e66b7374c2a..9fde2119a19f0cc97cd7a753756675a0d33164e9 100644 (file)
@@ -1,5 +1,5 @@
 {#printer_name=0?No printers:
-<P><B>Default Destination:</B> <A HREF="{default_uri}">{default_name}</A>
+<P><B>Default Destination:</B> {default_name?<A HREF="{default_uri}">{default_name}</A>:none}
 <P><TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%">
 {[printer_name]
 <TR>
        Printer State: {printer_state=3?idle:{printer_state=4?processing:stopped}},
        {printer_is_accepting_jobs=0?rejecting jobs:accepting jobs}.
        {?printer_state_message=?:<BR><I>"{printer_state_message}"</I>}
+       {?printer_state_history2.printer_state_message=?:<BR><I>"{printer_state_history2.printer_state_message}"</I>}
+       {?printer_state_history3.printer_state_message=?:<BR><I>"{printer_state_history3.printer_state_message}"</I>}
+       {?printer_state_history4.printer_state_message=?:<BR><I>"{printer_state_history4.printer_state_message}"</I>}
+       {?printer_state_history5.printer_state_message=?:<BR><I>"{printer_state_history5.printer_state_message}"</I>}
        {?device_uri=?:<BR>Device URI: {device_uri}}
        <P>
        <A HREF="{printer_uri_supported}?op=print-test-page">
index 86cf920591a27e973cf2a719fdf6581ef68a3ef1..74a7dc7c2c71bd2925bdc0ac358caab234da1a4a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# "$Id: run-stp-tests.sh,v 1.4.2.12 2003/03/07 19:25:51 mike Exp $"
+# "$Id: run-stp-tests.sh,v 1.4.2.13 2003/04/08 03:48:16 mike Exp $"
 #
 #   Perform the complete set of IPP compliance tests specified in the
 #   CUPS Software Test Plan.
@@ -163,7 +163,7 @@ TempDir /tmp/$user/spool/temp
 AccessLog /tmp/$user/log/access_log
 ErrorLog /tmp/$user/log/error_log
 PageLog /tmp/$user/log/page_log
-LogLevel debug
+LogLevel debug2
 PreserveJobHistory Yes
 <Location />
 Order deny,allow
@@ -272,7 +272,7 @@ export HOME
 
 echo "Starting scheduler..."
 
-../scheduler/cupsd -c /tmp/$user/cupsd.conf -f &
+../scheduler/cupsd -c /tmp/$user/cupsd.conf -f >/tmp/$user/log/debug_log &
 cupsd=$!
 
 #if test -x /usr/bin/strace; then
@@ -442,5 +442,5 @@ echo "    $pdffile"
 echo ""
 
 #
-# End of "$Id: run-stp-tests.sh,v 1.4.2.12 2003/03/07 19:25:51 mike Exp $"
+# End of "$Id: run-stp-tests.sh,v 1.4.2.13 2003/04/08 03:48:16 mike Exp $"
 #