This repository was archived by the owner on Jun 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -15,24 +15,23 @@ class ResourceRequester extends BaseObject {
1515 this . cdnRequester = new CDNRequester ( )
1616 this . p2pManager = new P2PManager ( params )
1717 this . isInitialBuffer = true
18- this . sameSource = 0
18+ this . decodingError = false
1919 }
2020
2121 requestResource ( resource , bufferLength , callback ) {
22- if ( resource === this . resource ) {
23- this . sameSource += 1
24- }
2522 this . resource = resource
2623 this . callback = callback
27- if ( bufferLength < Settings . lowBufferLength || this . isInitialBuffer || _ . size ( this . p2pManager . swarm . utils . contributors ) === 0 || this . sameSource >= 3 ) {
24+ if ( this . decodingError ) {
25+ this . requestToCDN ( )
26+ } else if ( bufferLength < Settings . lowBufferLength || this . isInitialBuffer || _ . size ( this . p2pManager . swarm . utils . contributors ) === 0 ) {
2827 this . requestToCDN ( )
29- this . sameSource = 0
3028 } else {
3129 this . requestToP2P ( )
3230 }
3331 }
3432
3533 requestToCDN ( ) {
34+ log . info ( "getting from CDN: " + this . resource )
3635 this . cdnRequester . requestResource ( this . resource , this . callback )
3736 }
3837
You can’t perform that action at this time.
0 commit comments