]> granicus.if.org Git - curl/commitdiff
Metalink: ignore --include if --metalink is used.
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Fri, 22 Jun 2012 14:20:16 +0000 (23:20 +0900)
committerYang Tse <yangsita@gmail.com>
Fri, 22 Jun 2012 16:58:30 +0000 (18:58 +0200)
Including headers in response body will break Metalink XML parser.
If it is included in the file described in Metalink XML, hash check
will fail. Therefore, --include should be ignored if --metalink is
used.

src/tool_operate.c

index 3fcdf4781e66d9981eda205fae56901f84506205..d944a00937693cc82b82f962d2f71833a4ca0c7c 100644 (file)
@@ -879,7 +879,10 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
           my_setopt(curl, CURLOPT_NOBODY, 1);
           my_setopt(curl, CURLOPT_HEADER, 1);
         }
-        else
+        /* If --metalink is used, we ignore --include (headers in
+           output) option because mixing headers to the body will
+           confuse XML parser and/or hash check will fail. */
+        else if(!config->use_metalink)
           my_setopt(curl, CURLOPT_HEADER, config->include_headers);
 
 #if !defined(CURL_DISABLE_PROXY)