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_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")
*
* 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
/*
* '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 */
{
+ 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 :
- return ("Continue");
+ s = _("Continue");
+ break;
case HTTP_SWITCHING_PROTOCOLS :
- return ("Switching Protocols");
+ s = _("Switching Protocols");
+ break;
case HTTP_OK :
- return ("OK");
+ s = _("OK");
+ break;
case HTTP_CREATED :
- return ("Created");
+ s = _("Created");
+ break;
case HTTP_ACCEPTED :
- return ("Accepted");
+ s = _("Accepted");
+ break;
case HTTP_NO_CONTENT :
- return ("No Content");
+ s = _("No Content");
+ break;
case HTTP_MOVED_PERMANENTLY :
- return ("Moved Permanently");
+ s = _("Moved Permanently");
+ break;
case HTTP_SEE_OTHER :
- return ("See Other");
+ s = _("See Other");
+ break;
case HTTP_NOT_MODIFIED :
- return ("Not Modified");
+ s = _("Not Modified");
+ break;
case HTTP_BAD_REQUEST :
- return ("Bad Request");
+ s = _("Bad Request");
+ break;
case HTTP_UNAUTHORIZED :
- return ("Unauthorized");
+ s = _("Unauthorized");
+ break;
case HTTP_FORBIDDEN :
- return ("Forbidden");
+ s = _("Forbidden");
+ break;
case HTTP_NOT_FOUND :
- return ("Not Found");
+ s = _("Not Found");
+ break;
case HTTP_REQUEST_TOO_LARGE :
- return ("Request Entity Too Large");
+ s = _("Request Entity Too Large");
+ break;
case HTTP_URI_TOO_LONG :
- return ("URI Too Long");
+ s = _("URI Too Long");
+ break;
case HTTP_UPGRADE_REQUIRED :
- return ("Upgrade Required");
+ s = _("Upgrade Required");
+ break;
case HTTP_NOT_IMPLEMENTED :
- return ("Not Implemented");
+ s = _("Not Implemented");
+ break;
case HTTP_NOT_SUPPORTED :
- return ("Not Supported");
+ s = _("Not Supported");
+ break;
case HTTP_EXPECTATION_FAILED :
- return ("Expectation Failed");
+ s = _("Expectation Failed");
+ break;
+ case HTTP_SERVICE_UNAVAILABLE :
+ s = _("Service Unavailable");
+ break;
default :
- return ("Unknown");
+ s = _("Unknown");
+ break;
}
+
+ return (_cupsLangString(cg->lang_default, s));
}
cg->ppd_status = PPD_MISSING_PPDADOBE4;
_cupsStrFree(string);
+ ppd_free(line.buffer);
return (NULL);
}
{
cg->ppd_status = PPD_ALLOC_ERROR;
+ _cupsStrFree(string);
+ ppd_free(line.buffer);
+
return (NULL);
}
_cupsStrFree(string);
}
- if (line.buffer)
- free(line.buffer);
+ ppd_free(line.buffer);
/*
* Reset language preferences...
error:
- if (line.buffer)
- free(line.buffer);
-
_cupsStrFree(string);
+ ppd_free(line.buffer);
ppdClose(ppd);
.fi
.SH OPTIONS
.TP 5
-.h hostname[:port]
+-h hostname[:port]
.br
Sets the CUPS server (and port) to use.
.TP 5
free(con->http.input_set);
httpClearCookie(HTTP(con));
+ httpClearFields(HTTP(con));
cupsdClearString(&con->filename);
cupsdClearString(&con->command);
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 */
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),
+ uri ? uri->values[0].string.text : "no URI",
con->http.hostname);
if (cupsdSendHeader(con, HTTP_OK, "application/ipp", CUPSD_AUTH_NONE))
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 &&