]> sjero.net Git - wget/commitdiff
[svn] Document parse_content_disposition.
authorhniksic <devnull@localhost>
Sat, 8 Apr 2006 16:05:42 +0000 (09:05 -0700)
committerhniksic <devnull@localhost>
Sat, 8 Apr 2006 16:05:42 +0000 (09:05 -0700)
src/ChangeLog
src/http.c

index 846fa4b2c92a00edb1b7d21d833c55b372efb7e7..86ba0a162de87b35c81601c2866b8b922b521f86 100644 (file)
@@ -1,3 +1,7 @@
+2006-04-08  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * http.c (parse_content_disposition): Doc fix.
+
 2006-03-15  Mauro Tortonesi  <mauro@ferrara.linux.it>
 
        * utils.c: Restricted operational semantics of frontcmp and proclist
index d28ee7a87231a79ded111c37d5b3c5d0a781a63f..70f6aa00e7373e43679503b82fa273c7a86fb7d1 100644 (file)
@@ -932,6 +932,23 @@ extract_param (const char **source, param_token *name, param_token *value,
 #undef MAX
 #define MAX(p, q) ((p) > (q) ? (p) : (q))
 
+/* Parse the contents of the `Content-Disposition' header, extracting
+   the information useful to Wget.  Content-Disposition is a header
+   borrowed from MIME; when used in HTTP, it typically serves for
+   specifying the desired file name of the resource.  For example:
+
+       Content-Disposition: attachment; filename="flora.jpg"
+
+   Wget will skip the tokens it doesn't care about, such as
+   "attachment" in the previous example; it will also skip other
+   unrecognized params.  If the header is syntactically correct and
+   contains a file name, a copy of the file name is stored in
+   *filename and true is returned.  Otherwise, the function returns
+   false.
+
+   The file name is stripped of directory components and must not be
+   empty.  */
+
 static bool
 parse_content_disposition (const char *hdr, char **filename)
 {