Changeset 1007

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

#826: Download Fails when size is unknown
aka. Silence of the NaN

Files:

Legend:

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

    r942 r1007  
    628628 
    629629                                case 'content-length': 
    630                                         this.contentlength = Number(aValue); 
     630                                        let contentlength = new Number(aValue); 
     631                                        if (contentLength > 0 && !isNaN(contentLength)) { 
     632                                                this.contentlength = Math.floor(contentLength); 
     633                                        } 
    631634                                break; 
    632635 
     
    982985        get totalSize() { return this._totalSize; }, 
    983986        set totalSize(nv) { 
    984                 this._totalSize = nv; 
     987                if (this._totalsize == nv) { 
     988                        return nv; 
     989                } 
     990                if (nv >= 0 && !isNaN(nv)) { 
     991                        this._totalSize = Math.floor(nv); 
     992                } 
    985993                this.invalidate(); 
    986994                return this._totalSize; 
     
    20182026                if (visitor.contentlength > 0) { 
    20192027                        d.totalSize = visitor.contentlength; 
    2020                 } else { 
     2028                } 
     2029                else { 
    20212030                        d.totalSize = 0; 
    20222031                }