Changeset 1008

Show
Ignore:
Timestamp:
07/31/08 04:24:05 (1 month ago)
Author:
MaierMan
Message:

#826: Download Fails when size is unknown
PS: prettify && content-range path

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.x/chrome/content/dta/manager.js

    r1007 r1008  
    592592        fileName: null, 
    593593        acceptRanges: 'bytes', 
    594         contentlength: 0, 
     594        contentLength: 0, 
    595595        time: null, 
    596596 
     
    628628 
    629629                                case 'content-length': 
    630                                         let contentlength = new Number(aValue); 
     630                                        let contentLength = new Number(aValue); 
    631631                                        if (contentLength > 0 && !isNaN(contentLength)) { 
    632                                                 this.contentlength = Math.floor(contentLength); 
     632                                                this.contentLength = Math.floor(contentLength); 
     633                                                Debug.dump("cl: " + contentLength); 
    633634                                        } 
    634635                                break; 
    635636 
    636637                                case 'content-range': { 
    637                                         let cl = new Number(aValue.split('/').pop()); 
    638                                         if (cl > 0) { 
    639                                                 this.contentlength = cl
     638                                        let contentLength = new Number(aValue.split('/').pop()); 
     639                                        if (contentLength > 0 && !isNan(contentLength)) { 
     640                                                this.contentLength = Math.floor(contentLength)
    640641                                        } 
    641642                                } 
     
    985986        get totalSize() { return this._totalSize; }, 
    986987        set totalSize(nv) { 
    987                 if (this._totalsize == nv) { 
     988                if (this._totalSize == nv) { 
    988989                        return nv; 
    989990                } 
     
    20242025                } 
    20252026 
    2026                 if (visitor.contentlength > 0) { 
    2027                         d.totalSize = visitor.contentlength; 
     2027                if (visitor.contentLength > 0) { 
     2028                        d.totalSize = visitor.contentLength; 
    20282029                } 
    20292030                else {