On Fri, May 25, 2012 at 7:57 PM, Aish Raj Dahal <dahalaishraj@gmail.com> wrote:
> I am using
> http://download.services.openoffice.org/files/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz
> to check the Metalink/HTTP. It works fine while running
>
> curl -sI
> http://download.services.openoffice.org/files/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz
>
> However, while doing so using KIO, I've encountered problems. It seems
> that the header replies that KIO gets are of the download link, just as
> Konqueror gets it while typing the link in the address bar. :-/
>
> The output that I get is
> "HTTP/1.1 200 OK
>
> server: nginx/0.8.54
>
> date: Fri, 25 May 2012 14:32:56 GMT
>
> content-type: application/octet-stream
>
> content-length: 8957266
> last-modified: Mon, 17 Jan 2011 22:03:15 GMT
> connection: close
> accept-ranges: bytes"
>
> And the output that I should be actually getting is:
>
> HTTP/1.1 302 Found
> Date: Fri, 25 May 2012 13:13:14 GMT
> Server: Apache/2.2.22 (Linux/SUSE)
> X-Prefix: 49.244.64.0/21
> X-AS: 23752
> X-MirrorBrain-Mirror: mirror.averse.net
> X-MirrorBrain-Realm: region
> Link:
> <http://download.services.openoffice.org/files/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz.meta4>;
> rel=describedby; type="application/metalink4+xml"
> Link:
> <http://download.services.openoffice.org/files/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz.torrent>;
> rel=describedby; type="application/x-bittorrent"
> Link:
> <http://mirror.averse.net/openoffice/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz>;
> rel=duplicate; pri=1; geo=sg
> Link:
> <http://ftp.isu.edu.tw/pub/OpenOffice/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz>;
> rel=duplicate; pri=2; geo=tw
> Link:
> <http://ftp.twaren.net/OpenOffice/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz>;
> rel=duplicate; pri=3; geo=tw
> Link:
> <http://ftp.kaist.ac.kr/openoffice/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz>;
> rel=duplicate; pri=4; geo=kr
> Link:
> <http://mirror.yongbok.net/openoffice/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz>;
> rel=duplicate; pri=5; geo=kr
> Digest: MD5=chZROzRjy791zYb5mUhk3A==
> Digest: SHA=nRgEtguiGxDlu8PKSxyBSc7TlGw=
> Digest: SHA-256=VO2S9pgCq1lqgTFTKssVj6amn0npNdagtjI8ziDtiRQ=
> Location:
> http://mirror.averse.net/openoffice/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz
> Connection: close
> Content-Type: text/html; charset=iso-8859-1

Judging by the Location header in the reply you expect, KIO::get is
automatically redirecting the request, which is, I think, a very good
thing (the one time I wanted to use KIO::get I wanted to do exactly
that). You then need to go with something more basic, like
QNetworkAccessManager's head method to get the headers and do nothing
more. The attached patch against your sources achieves that (assuming
you have an error on the URL in the code).

David E. Narvaez
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gsoc2012_metalink_headers.diff
Type: application/octet-stream
Size: 2486 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kde-devel/attachments/20120525/8d518d51/attachment.obj>

------------------------------

_______________________________________________
kde-devel mailing list
kde-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-devel


End of kde-devel Digest, Vol 110, Issue 26
******************************************


Hello David,

Thank you very much for the help. I tried to apply the patch atttached but ran into some errors. Later I resorted to achieve it by using QNetworkAccessManager, as told by you.
Thank you once again. :)

Regards,
Aish Raj Dahal
Google Summer of Code Student (Metalink) 2012