*
* HTTP support routines for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 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.
* _cups_hstrerror() - hstrerror() emulation function for Solaris and
* others...
+ * _httpDecodeURI() - Percent-decode a HTTP request URI.
* _httpEncodeURI() - Percent-encode a HTTP request URI.
* _httpResolveURI() - Resolve a DNS-SD URI.
* http_copy_decode() - Copy and decode a URI.
case HTTP_PKI_ERROR :
s = _("SSL/TLS Negotiation Error");
break;
+ case HTTP_WEBIF_DISABLED :
+ s = _("Web Interface is Disabled");
+ break;
default :
s = _("Unknown");
#endif /* !HAVE_HSTRERROR */
+/*
+ * '_httpDecodeURI()' - Percent-decode a HTTP request URI.
+ */
+
+char * /* O - Decoded URI or NULL on error */
+_httpDecodeURI(char *dst, /* I - Destination buffer */
+ const char *src, /* I - Source URI */
+ size_t dstsize) /* I - Size of destination buffer */
+{
+ if (http_copy_decode(dst, src, (int)dstsize, NULL, 1))
+ return (dst);
+ else
+ return (NULL);
+}
+
+
/*
* '_httpEncodeURI()' - Percent-encode a HTTP request URI.
*/
#endif /* DEBUG */
{
if (logit)
- _cupsLangPrintf(stderr, _("Bad device URI \"%s\"\n"), uri);
+ _cupsLangPrintFilter(stderr, "ERROR", _("Bad device-uri \"%s\"."), uri);
DEBUG_printf(("6_httpResolveURI: httpSeparateURI returned %d!", status));
DEBUG_puts("5_httpResolveURI: Returning NULL");
for (;;)
{
if (logit)
- _cupsLangPuts(stderr, _("INFO: Looking for printer...\n"));
+ _cupsLangPrintFilter(stderr, "INFO", _("Looking for printer."));
/*
* For the first minute, wakeup every 2 seconds to emit a
#endif /* HAVE_DNSSD */
if (logit && !uri)
- _cupsLangPuts(stderr, _("Unable to find printer\n"));
+ _cupsLangPrintFilter(stderr, "ERROR", _("Unable to find printer."));
}
DEBUG_printf(("5_httpResolveURI: Returning \"%s\"", uri));