]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.4svn-r7844.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 14 Aug 2008 06:33:44 +0000 (06:33 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 14 Aug 2008 06:33:44 +0000 (06:33 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@909 a1ca3aef-8c08-0410-bb20-df032aa958be

config-scripts/cups-defaults.m4
cups/http-support.c
cups/ppd.c
man/cups-lpd.man.in
scheduler/client.c
scheduler/ipp.c

index 624b3d6f2558b9c676b5e24c4139c3473a864384..bdc22ebb011a9227ec7e4a2146d115621184784f 100644 (file)
@@ -28,11 +28,7 @@ AC_SUBST(LANGUAGES)
 dnl Default ConfigFilePerm
 AC_ARG_WITH(config_file_perm, [  --with-config-file-perm set default ConfigFilePerm value, default=0640],
        CUPS_CONFIG_FILE_PERM="$withval",
 dnl Default ConfigFilePerm
 AC_ARG_WITH(config_file_perm, [  --with-config-file-perm set default ConfigFilePerm value, default=0640],
        CUPS_CONFIG_FILE_PERM="$withval",
-       if test "x$uname" = xDarwin; then
-               CUPS_CONFIG_FILE_PERM="644"
-       else
-               CUPS_CONFIG_FILE_PERM="640"
-       fi)
+       CUPS_CONFIG_FILE_PERM="640")
 AC_SUBST(CUPS_CONFIG_FILE_PERM)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
 
 AC_SUBST(CUPS_CONFIG_FILE_PERM)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
 
@@ -51,9 +47,9 @@ AC_SUBST(CUPS_LOG_LEVEL)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
 
 dnl Default AccessLogLevel
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LOG_LEVEL, "$CUPS_LOG_LEVEL")
 
 dnl Default AccessLogLevel
-AC_ARG_WITH(log_level, [  --with-access-log-level set default AccessLogLevel value, default=actions],
-       CUPS_LOG_LEVEL="$withval",
-       CUPS_LOG_LEVEL="actions")
+AC_ARG_WITH(access_log_level, [  --with-access-log-level set default AccessLogLevel value, default=actions],
+       CUPS_ACCESS_LOG_LEVEL="$withval",
+       CUPS_ACCESS_LOG_LEVEL="actions")
 AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
 
 AC_SUBST(CUPS_ACCESS_LOG_LEVEL)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_ACCESS_LOG_LEVEL, "$CUPS_ACCESS_LOG_LEVEL")
 
index 56e27515cbc2e46a51a246e3dd91980b6eed545c..30998136a743bc4920ea161578a5a71472b90779 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   HTTP support routines for the Common UNIX Printing System (CUPS) scheduler.
  *
  *
  *   HTTP support routines for the Common UNIX Printing System (CUPS) scheduler.
  *
- *   Copyright 2007 by Apple Inc.
+ *   Copyright 2007-2008 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -1155,55 +1155,90 @@ httpSeparateURI(
 
 /*
  * 'httpStatus()' - Return a short string describing a HTTP status code.
 
 /*
  * 'httpStatus()' - Return a short string describing a HTTP status code.
+ *
+ * The returned string is localized to the current POSIX locale and is based
+ * on the status strings defined in RFC 2616.
  */
 
  */
 
-const char *                           /* O - String or NULL */
+const char *                           /* O - Localized status string */
 httpStatus(http_status_t status)       /* I - HTTP status code */
 {
 httpStatus(http_status_t status)       /* I - HTTP status code */
 {
+  const char   *s;                     /* Status string */
+  _cups_globals_t *cg = _cupsGlobals();        /* Global data */
+
+
+  if (!cg->lang_default)
+    cg->lang_default = cupsLangDefault();
+
   switch (status)
   {
     case HTTP_CONTINUE :
   switch (status)
   {
     case HTTP_CONTINUE :
-        return ("Continue");
+        s = _("Continue");
+       break;
     case HTTP_SWITCHING_PROTOCOLS :
     case HTTP_SWITCHING_PROTOCOLS :
-        return ("Switching Protocols");
+        s = _("Switching Protocols");
+       break;
     case HTTP_OK :
     case HTTP_OK :
-        return ("OK");
+        s = _("OK");
+       break;
     case HTTP_CREATED :
     case HTTP_CREATED :
-        return ("Created");
+        s = _("Created");
+       break;
     case HTTP_ACCEPTED :
     case HTTP_ACCEPTED :
-        return ("Accepted");
+        s = _("Accepted");
+       break;
     case HTTP_NO_CONTENT :
     case HTTP_NO_CONTENT :
-        return ("No Content");
+        s = _("No Content");
+       break;
     case HTTP_MOVED_PERMANENTLY :
     case HTTP_MOVED_PERMANENTLY :
-        return ("Moved Permanently");
+        s = _("Moved Permanently");
+       break;
     case HTTP_SEE_OTHER :
     case HTTP_SEE_OTHER :
-        return ("See Other");
+        s = _("See Other");
+       break;
     case HTTP_NOT_MODIFIED :
     case HTTP_NOT_MODIFIED :
-        return ("Not Modified");
+        s = _("Not Modified");
+       break;
     case HTTP_BAD_REQUEST :
     case HTTP_BAD_REQUEST :
-        return ("Bad Request");
+        s = _("Bad Request");
+       break;
     case HTTP_UNAUTHORIZED :
     case HTTP_UNAUTHORIZED :
-        return ("Unauthorized");
+        s = _("Unauthorized");
+       break;
     case HTTP_FORBIDDEN :
     case HTTP_FORBIDDEN :
-        return ("Forbidden");
+        s = _("Forbidden");
+       break;
     case HTTP_NOT_FOUND :
     case HTTP_NOT_FOUND :
-        return ("Not Found");
+        s = _("Not Found");
+       break;
     case HTTP_REQUEST_TOO_LARGE :
     case HTTP_REQUEST_TOO_LARGE :
-        return ("Request Entity Too Large");
+        s = _("Request Entity Too Large");
+       break;
     case HTTP_URI_TOO_LONG :
     case HTTP_URI_TOO_LONG :
-        return ("URI Too Long");
+        s = _("URI Too Long");
+       break;
     case HTTP_UPGRADE_REQUIRED :
     case HTTP_UPGRADE_REQUIRED :
-        return ("Upgrade Required");
+        s = _("Upgrade Required");
+       break;
     case HTTP_NOT_IMPLEMENTED :
     case HTTP_NOT_IMPLEMENTED :
-        return ("Not Implemented");
+        s = _("Not Implemented");
+       break;
     case HTTP_NOT_SUPPORTED :
     case HTTP_NOT_SUPPORTED :
-        return ("Not Supported");
+        s = _("Not Supported");
+       break;
     case HTTP_EXPECTATION_FAILED :
     case HTTP_EXPECTATION_FAILED :
-        return ("Expectation Failed");
+        s = _("Expectation Failed");
+       break;
+    case HTTP_SERVICE_UNAVAILABLE :
+        s = _("Service Unavailable");
+       break;
 
     default :
 
     default :
-        return ("Unknown");
+        s = _("Unknown");
+       break;
   }
   }
+
+  return (_cupsLangString(cg->lang_default, s));
 }
 
 
 }
 
 
index e88dad15b7f78b1289596fa543ea152a7d10e8af..110f230ef00884eed4546af89dcc307b609b3988 100644 (file)
@@ -588,6 +588,7 @@ ppdOpen2(cups_file_t *fp)           /* I - File to read from */
       cg->ppd_status = PPD_MISSING_PPDADOBE4;
 
     _cupsStrFree(string);
       cg->ppd_status = PPD_MISSING_PPDADOBE4;
 
     _cupsStrFree(string);
+    ppd_free(line.buffer);
 
     return (NULL);
   }
 
     return (NULL);
   }
@@ -604,6 +605,9 @@ ppdOpen2(cups_file_t *fp)           /* I - File to read from */
   {
     cg->ppd_status = PPD_ALLOC_ERROR;
 
   {
     cg->ppd_status = PPD_ALLOC_ERROR;
 
+    _cupsStrFree(string);
+    ppd_free(line.buffer);
+
     return (NULL);
   }
 
     return (NULL);
   }
 
@@ -1881,8 +1885,7 @@ ppdOpen2(cups_file_t *fp)         /* I - File to read from */
       _cupsStrFree(string);
   }
 
       _cupsStrFree(string);
   }
 
-  if (line.buffer)
-    free(line.buffer);
+  ppd_free(line.buffer);
 
  /*
   * Reset language preferences...
 
  /*
   * Reset language preferences...
@@ -1955,10 +1958,8 @@ ppdOpen2(cups_file_t *fp)                /* I - File to read from */
 
   error:
 
 
   error:
 
-  if (line.buffer)
-    free(line.buffer);
-
   _cupsStrFree(string);
   _cupsStrFree(string);
+  ppd_free(line.buffer);
 
   ppdClose(ppd);
 
 
   ppdClose(ppd);
 
index 3c5dcb059b55b5d383cc349b35817b47afc717fa..54ad4b6ba3dc5dc7bdebe352ccbdee659959dc5e 100644 (file)
@@ -61,7 +61,7 @@ named \fI/etc/xinetd.d/cups\fR containing the following lines:
 .fi
 .SH OPTIONS
 .TP 5
 .fi
 .SH OPTIONS
 .TP 5
-.h hostname[:port]
+-h hostname[:port]
 .br
 Sets the CUPS server (and port) to use.
 .TP 5
 .br
 Sets the CUPS server (and port) to use.
 .TP 5
index b9e525c9f87fdb29b3b26cab264ccb0a74623a4f..a4e249790881b47cc6fd94ba438e0c1066136161 100644 (file)
@@ -697,6 +697,7 @@ cupsdCloseClient(cupsd_client_t *con)       /* I - Client to close */
       free(con->http.input_set);
 
     httpClearCookie(HTTP(con));
       free(con->http.input_set);
 
     httpClearCookie(HTTP(con));
+    httpClearFields(HTTP(con));
 
     cupsdClearString(&con->filename);
     cupsdClearString(&con->command);
 
     cupsdClearString(&con->filename);
     cupsdClearString(&con->command);
index 23d15ad8b81abb5283e4f5ab859345bedb14059f..ccd8d851c0006fc665de38a4ec418b6da4cef78e 100644 (file)
@@ -249,7 +249,7 @@ cupsdProcessIPPRequest(
   ipp_attribute_t      *attr;          /* Current attribute */
   ipp_attribute_t      *charset;       /* Character set attribute */
   ipp_attribute_t      *language;      /* Language attribute */
   ipp_attribute_t      *attr;          /* Current attribute */
   ipp_attribute_t      *charset;       /* Character set attribute */
   ipp_attribute_t      *language;      /* Language attribute */
-  ipp_attribute_t      *uri;           /* Printer URI attribute */
+  ipp_attribute_t      *uri = NULL;    /* Printer or job URI attribute */
   ipp_attribute_t      *username;      /* requesting-user-name attr */
   int                  sub_id;         /* Subscription ID */
 
   ipp_attribute_t      *username;      /* requesting-user-name attr */
   int                  sub_id;         /* Subscription ID */
 
@@ -680,9 +680,10 @@ cupsdProcessIPPRequest(
 
     cupsdLogMessage(con->response->request.status.status_code
                         >= IPP_BAD_REQUEST ? CUPSD_LOG_ERROR : CUPSD_LOG_DEBUG,
 
     cupsdLogMessage(con->response->request.status.status_code
                         >= IPP_BAD_REQUEST ? CUPSD_LOG_ERROR : CUPSD_LOG_DEBUG,
-                    "Returning %s for %s from %s",
+                    "Returning IPP %s for %s (%s) from %s",
                    ippErrorString(con->response->request.status.status_code),
                    ippOpString(con->request->request.op.operation_id),
                    ippErrorString(con->response->request.status.status_code),
                    ippOpString(con->request->request.op.operation_id),
+                   uri ? uri->values[0].string.text : "no URI",
                    con->http.hostname);
 
     if (cupsdSendHeader(con, HTTP_OK, "application/ipp", CUPSD_AUTH_NONE))
                    con->http.hostname);
 
     if (cupsdSendHeader(con, HTTP_OK, "application/ipp", CUPSD_AUTH_NONE))
@@ -9796,9 +9797,19 @@ send_http_error(
     http_status_t   status,            /* I - HTTP status code */
     cupsd_printer_t *printer)          /* I - Printer, if any */
 {
     http_status_t   status,            /* I - HTTP status code */
     cupsd_printer_t *printer)          /* I - Printer, if any */
 {
-  cupsdLogMessage(CUPSD_LOG_ERROR, "%s: %s",
-                  ippOpString(con->request->request.op.operation_id),
-                 httpStatus(status));
+  ipp_attribute_t      *uri;           /* Request URI, if any */
+
+
+  if ((uri = ippFindAttribute(con->request, "printer-uri",
+                              IPP_TAG_URI)) == NULL)
+    uri = ippFindAttribute(con->request, "job-uri", IPP_TAG_URI);
+
+  cupsdLogMessage(status == HTTP_FORBIDDEN ? CUPSD_LOG_ERROR : CUPSD_LOG_DEBUG,
+                  "Returning HTTP %s for %s (%s) from %s",
+                  httpStatus(status),
+                 ippOpString(con->request->request.op.operation_id),
+                 uri ? uri->values[0].string.text : "no URI",
+                 con->http.hostname);
 
   if (status == HTTP_UNAUTHORIZED &&
       printer && printer->num_auth_info_required > 0 &&
 
   if (status == HTTP_UNAUTHORIZED &&
       printer && printer->num_auth_info_required > 0 &&