mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-10-25 21:40:08 +00:00
Refactored http communications to be more abstract and OOP
This commit is contained in:
1 parent
75d3f23f0a
commit
879f304a79
19 files changed
+457
-237
No files matched your search
@@ -9,7 +9,8 @@
|
||||
#import "AppAssetRetriever.h"
|
||||
#import "HttpManager.h"
|
||||
#import "CryptoManager.h"
|
||||
#import "HttpResponse.h"
|
||||
#import "AppAssetResponse.h"
|
||||
#import "HttpRequest.h"
|
||||
|
||||
@implementation AppAssetRetriever
|
||||
static const double RETRY_DELAY = 1; // seconds
|
||||
@@ -29,9 +30,10 @@ static const double RETRY_DELAY = 1; // seconds
|
||||
}
|
||||
if (appImage == nil) {
|
||||
HttpManager* hMan = [[HttpManager alloc] initWithHost:_host.address uniqueId:[CryptoManager getUniqueID] deviceName:deviceName cert:[CryptoManager readCertFromFile]];
|
||||
HttpResponse* appAssetResp = [hMan executeRequestSynchronously:[hMan newAppAssetRequestWithAppId:self.app.appId]];
|
||||
AppAssetResponse* appAssetResp = [[AppAssetResponse alloc] init];
|
||||
[hMan executeRequestSynchronously:[HttpRequest requestForResponse:appAssetResp withUrlRequest:[hMan newAppAssetRequestWithAppId:self.app.appId]]];
|
||||
|
||||
appImage = [UIImage imageWithData:appAssetResp.responseData];
|
||||
appImage = [UIImage imageWithData:appAssetResp.data];
|
||||
self.app.appImage = appImage;
|
||||
if (appImage != nil) {
|
||||
@synchronized(self.cache) {
|
||||
|
||||
Reference in new issue
Block a user