Closed Bug 225275 Opened 16 years ago Closed 4 years ago

Use content-length to determine if download is successful; retry if not (testcase)


(Core :: Networking, enhancement)

Not set





(Reporter: bugzilla, Unassigned)



(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.5) Gecko/20031007
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.5) Gecko/20031007

The attached testcase is a php script which sends the first 10240 bytes of a
file when the whole file is asked for, or the entire range asked for if any
range apart from the whole file is asked for. Content-length, content-range
headers are sent properly.

This simulates the behaviour of may webservers, which will occasionally drop the
TCP connection if the downstream link is slow or losing packets.

It is possible for a user agent to compare the length of the data received with
the content-length header, determine that the former is less than the latter,
and go back to the server with a request for the range that is missing. Wget
(for example) does this.

It would be nice if mozilla did this too.

Reproducible: Always

Steps to Reproduce:
1. Install the php script on a webserver.
2. copy a jpeg larger than 10240 bytes to the same directory, name it "cltest.jpg"
3. open the URL of the script in mozilla

Actual Results:  
Mozilla displays a partial (or broken) image - the simulated closing of the
connection has left it with only 10240 bytes, and it does not retry.

Expected Results:  
Mozilla displays the complete image - the simulated closing of the connection
has left it with only 10240 bytes (less than Content-length), so mozilla
reconnects to get the rest.
Log of wget doing the Right Thing. Hostnames have been altered.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
This testcase still reproduces the behaviour in firefox 1.5b2.

Wget can still get the image correctly.
Assignee: darin → nobody
QA Contact: benc → networking
I'm observing this behavior on a local web server in both Firefox, and on a trunk build.  Confirming...
Ever confirmed: true
I was shooting for four years sitting on unconfirmed despite having a straightforward and conclusive testcase.

I guess I'll have to settle for three-and-a-half.
We have test cases for this since a while in our ordinary test suite.
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.