Anthony Bryan | 20 Jun 2012 06:29
Picon
Gravatar

Re: metalink support

(moved over from libcurl, since this list is probably more appropriate)

> Am 19.06.2012 18:16, schrieb Tatsuhiro Tsujikawa:
> > On Tue, Jun 19, 2012 at 5:45 AM, Guenter<lists_at_gknw.net> wrote:
> >> Hi all,
> >> I did build curl with metalink support, but a test on NetWare failed due to
> >> illegal filename; I tested a link from the curl download page:
> >> http://curl.haxx.se/metalink.cgi?curl=win64-ssl-sspi
> >> this results in the metalink file 'metalink.cgi?curl=win64-ssl-sspi' which
> >> is an illegal one since '?' is not allowed on NetWare, and neither on
> >> Windows; so we need to think about what we do here: just cut off the
> >> filename string beginning with the '?' (simplest) or replace all possible
> >> illegal filename characters with an underscore?
> >> Or, maybe even store it as a temp file, and remove it afterwards if the
> >> metalink download finished and checksum check was successful?
> >>
> >
> > Another solution is use -o option and specify safe name.
> > Since metalink enabled curl parses metalink file based on the
> > content-type the remote server returned, file name does not need to be
> > remote name. I'm sorry if I missed the point..
> ah, ok, I used -O so it was named after the url (though anyway I thought
> that some time back - before metalink support - we discussed this issue
> and agreed that we cut off the url beginning with '?' for using as
> filename);
> but then question is: why do we need an download option at all (-o | -O)
> ? Whouldnt it make sense to support metalink download also if no
> download option is provided but the server headers identify as metalink
> in content-type? Then the metalink data could be stored into a temporary
> file, and deleted after successful download and checksum verification ...
(Continue reading)

Guenter | 20 Jun 2012 08:56

Re: metalink support

Hi Anthony,
Am 20.06.2012 06:29, schrieb Anthony Bryan:
> (moved over from libcurl, since this list is probably more appropriate)
if it would be a pure usage issue then probably yes - but development of 
both libcurl *and* curl is discussed on the curl-library list ...

> Guenter, don't know if you got my previous thanks for
> metalink/libmetalink patches, so thank you :)
oh, a big thanks to you and Tatsuhiro too for writing libmetalink so 
that the metalink XML processing can be hidden from apps like curl ;-)

> we are already having a similar discussion...if you are using a
> metalink download, by default it will write to the filename taken from
> inside the metalink (except for some sanitizing done within
> libmetalink).
yes, thats clear to me, but this is the filename of the final target the 
metalink points to, but I was talking about the storage of the metalink 
data itself ...
usually you might find a metalink URL like this:
http://download.documentfoundation.org/libreoffice/stable/3.5.4/win/x86/LibO_3.5.4_Win_x86_install_multi.msi.meta4
this is fine, and works without issue, and the metalink download happens 
in 3 stages:
1) download the file LibO_3.5.4_Win_x86_install_multi.msi.meta4 and 
store it locally (this works on any platform since the metalink file 
LibO_3.5.4_Win_x86_install_multi.msi.meta4 has no illegal chars in its 
filename)
2) parse this file with help of libmetalink
3) download the file LibO_3.5.4_Win_x86_install_multi.msi
now the problem I see is in those cases when the metalink data is 
generated with a CGI script like what we have on the libcurl download page:
(Continue reading)

Guenter | 20 Jun 2012 09:14

Re: metalink support

Hi Daniel,
Am 20.06.2012 08:56, schrieb Guenter:
> now the problem I see is in those cases when the metalink data is
> generated with a CGI script like what we have on the libcurl download page:
> http://curl.haxx.se/metalink.cgi?curl=win64-ssl-sspi
> now it happens at stage 1 that curl wants to store the metalink data to
> a local file 'metalink.cgi?curl=win64-ssl-sspi' which is an illegal
> filename on some platforms due to the '?' ...
> maybe its even half an issue of our CGI script which might lack to send
> a filename in the headers which curl could use instead? (I dont know ...)
I checked a bit further, and it might be a good idea if our metalink.cgi 
would provide another header for the filename; currently I see only:
curl -I http://curl.haxx.se/metalink.cgi?curl=win64-ssl-sspi
HTTP/1.1 200 OK
Date: Wed, 20 Jun 2012 07:08:38 GMT
Server: Apache
Content-Type: application/metalink+xml

I believe it should additionally output:
Content-Disposition:attachment;filename=curl-7.23.1-win64-ssl-sspi.zip.metalink

Gün.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html


Gmane