]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/http-support.c
Merge changes from CUPS 1.5svn-r9374.
[thirdparty/cups.git] / cups / http-support.c
index 452a946f3adf51683f536b8ee79ce95ebeb4009b..443ce6c2150be5ed49816fa1b0e05d49b7f58536 100644 (file)
@@ -36,6 +36,7 @@
  *   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.
@@ -1288,6 +1289,22 @@ _cups_hstrerror(int error)               /* I - Error number */
 #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.
  */