I added support for KIO HTTP range headers around 8 years ago for a download accelerator, KGet instead of setting start and end simply kills the connection once it has all data it wants and just set the start part. So I really don't know if this code still work, and it also depends on the server side, check which HTTP headers are being sent. But if nothing else broke it, it should just work...
2015-07-22 5:01 GMT-03:00 saheb preet singh <saheb.pr...@gmail.com>: > Hi, > > I am Saheb Preet Singh, a KDE GSOC student. I am working on the okular > project. > > I was working on the linearization support which allows to open the files in > the reader prior to its complete download. I am having some queries related > to KIO. > > I am using KIO::get method to get the contents of the file. I want to get > the file in the specified ranges. So, I tried KIO::Job::addMetadata method > with range-start and range-end, but its not working. Here, is a short code > snippet :- > > KIO::TransferJob * job = KIO::get( KUrl( "http://humanstxt.org/humans.txt" > )); > connect( job, SIGNAL(totalSize(KJob*, qulonglong)), this, > SLOT(slotResult(KJob*, qulonglong)) ); > job->addMetaData( QString( "range-start" ), QString::number( 12 ) ); > job->addMetaData( QString( "range-end" ), QString::number( 25 ) ); > connect( job, SIGNAL(data(KIO::Job*, const QByteArray&)), this, > SLOT(slotHandleData(KIO::Job*, const QByteArray&)) ); > > It just fetches the complete file. I have few doubts:- > > Does KIO::TransferJob supports range-start and range-end? > How should I go about debugging this ? > > It would be great if I could get some help on this. > > Thanks, > Saheb Preet Singh > > >>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe >>> << > -- Daniel Nicoletti KDE Developer - http://dantti.wordpress.com >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<