Skip to content

Commit

Permalink
Merge pull request #190 from sonic-ios-dev/dev
Browse files Browse the repository at this point in the history
Fix sub-resource loading can not bridge network flow problem
  • Loading branch information
vasdeveloper authored Jan 5, 2018
2 parents 5ccc710 + b6dcce1 commit 839a46d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//

#import <Foundation/Foundation.h>
#import "sonicSession.h"
#import "SonicSession.h"

@interface SonicResourceLoadOperation : NSOperation

Expand Down
4 changes: 2 additions & 2 deletions sonic-iOS/Sonic/ResourceLoader/SonicResourceLoadOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ - (void)preloadDataWithProtocolCallBack:(SonicURLProtocolCallBack)callBack
if (self.isComplete) {
[self.lock lock];
rspItem = [SonicUtil protocolActionItem:SonicURLProtocolActionRecvResponse param:self.originResponse];
dataItem = [SonicUtil protocolActionItem:SonicURLProtocolActionLoadData param:self.cacheFileData];
dataItem = [SonicUtil protocolActionItem:SonicURLProtocolActionLoadData param:self.responseData];
[self.lock unlock];
finishItem = [SonicUtil protocolActionItem:SonicURLProtocolActionDidSuccess param:nil];
NSLog(@"resource read from network:%@",self.url);
Expand All @@ -138,7 +138,7 @@ - (void)preloadDataWithProtocolCallBack:(SonicURLProtocolCallBack)callBack
[actions addObject:rspItem];
}
if (self.responseData.length> 0) {
dataItem = [SonicUtil protocolActionItem:SonicURLProtocolActionLoadData param:self.cacheFileData];
dataItem = [SonicUtil protocolActionItem:SonicURLProtocolActionLoadData param:self.responseData];
[actions addObject:dataItem];
}
[self.lock unlock];
Expand Down

0 comments on commit 839a46d

Please sign in to comment.