Bug 24228

Summary: downloading file with unknown(?) size results in 100% progress bar
Product: [Frameworks and Libraries] kio Reporter: tim
Component: generalAssignee: David Faure <faure>
Severity: normal CC: faure, jhaar
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description tim 2001-04-16 16:54:18 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           konqueror
Version:           unknown (using KDE 2.1.1 )
Severity:          wishlist
Installed from:    Debian Package 4:2.1.1-6 (testing/unstable)
Compiler:          gcc version 2.95.3 20010315 (Debian release)
OS:                Linux 2.4.3 i686
OS/Compiler notes: 

When downloading a song from amazon.com over http the progress bar is at 100% the whole time and it states things like "1.2 MB of 1.2 MB complete" even though the file size is 4 MB. I guess this is because the script that sends the file does not sent the file size in the http header. It would be better if there wasnt a progress bar in this case and the text would be something like "x MB downloaded filesize unknown". 
The file I downloaded can be found at 
(hit the large yellow "download song now" button).

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 John Firebaugh 2002-10-15 08:05:03 UTC
*** Bug 28846 has been marked as a duplicate of this bug. ***
Comment 2 Dawit Alemayehu 2004-01-05 21:47:53 UTC
This was resolved a long time ago (KDE 3.0). I guess this report fell through the cracks and noone got around to updating it. Anyways, thanks for the report just the same...
Comment 3 Dawit Alemayehu 2004-01-05 21:48:42 UTC
Sorry wrong report :(
Comment 4 Stephan Binner 2004-07-31 09:40:45 UTC
Confirmed with HEAD.
Comment 5 Malte S. Stretz 2004-08-20 21:55:00 UTC
Even more confusing is that the title also displays 100% while the copy/download goes on.  Very easy to reproduce with kio_http and a (big) download which doesn't have a Content-Length header .
Comment 6 Martin Koller 2006-11-03 18:18:11 UTC
Still the case in KDE-3.5.5.
The download dialog shows 100% and "X MB of X MB complete."
Comment 7 David Faure 2007-11-12 00:33:35 UTC
Yes we should fix this for kde4, since it's confusing.
The amazon url doesn't work anymore (not surprising, 6 years later :)
Does someone have another url for a big download without Content-Length header?
Comment 8 Malte S. Stretz 2007-11-12 01:02:51 UTC
package LookMomNoContentLength;

use strict;
use warnings;

use base qw(Net::Server);

sub process_request {
  my $self = shift;
  while (<STDIN>) {
    last if /^$/;
  print "200 foo HTTP/1.1\r\n";
  print "Content-Type: application/octet-stream\r\n";
  print "\r\n";
  while (my $x = 1) {
    print $x++;
    sleep 1;

__PACKAGE__->run(port => 8080);
Comment 9 David Faure 2007-11-14 18:54:42 UTC
SVN commit 736745 by dfaure:

Better handling of the case where the total size of a job is unknown (very old kde bug).
Instead of showing 100% all the time, and a fake total size, simply don't show a total size at all, nor a remaining time; and the percent isn't emitted so the progressbar stays at 0 (maybe a jumping-back-and-forth progress bar would be better though).
BUG: 24228

 M  +5 -13     kdecore/jobs/kjob.cpp  
 M  +2 -0      kdeui/jobs/kstatusbarjobtracker.cpp  
 M  +3 -3      kdeui/jobs/kstatusbarjobtracker_p.h  
 M  +30 -24    kdeui/jobs/kwidgetjobtracker.cpp  
 M  +6 -4      kdeui/jobs/kwidgetjobtracker_p.h  
 M  +7 -11     kio/kio/job.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=736745
Comment 10 David Faure 2007-11-14 19:12:49 UTC
SVN commit 736752 by dfaure:

now with jumping progress bar when no total is known
CCBUG: 24228

 M  +4 -0      kwidgetjobtracker.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=736752