|
|
@@ -56,7 +56,7 @@
|
|
|
{
|
|
|
_customerInfo=customerInfo;
|
|
|
int count=customerInfo[@"count"];
|
|
|
- assert(count==0);
|
|
|
+ //assert(count==0);
|
|
|
|
|
|
}
|
|
|
-(void) set_main_button_panel
|
|
|
@@ -1295,7 +1295,7 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
int count=0;
|
|
|
// __block bool preparing = true;
|
|
|
- while ([[download_json valueForKey:@"result"] intValue]!=2&&count<REQUEST_DOWNLOAD_RETRY_TIMES) //超过10分钟还没准被好数据就视为服务器出错。
|
|
|
+ while ([[download_json valueForKey:@"result"] intValue]!=2&&count<REQUEST_DOWNLOAD_RETRY_TIMES) //超过60分钟还没准被好数据就视为服务器出错。
|
|
|
{
|
|
|
sleep(RETRY_DELAY);
|
|
|
|
|
|
@@ -1562,6 +1562,7 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
int count = [[self.download_task valueForKey:@"count"] intValue];
|
|
|
bool alldone=true;
|
|
|
bool trouble=false;
|
|
|
+ bool response = false;
|
|
|
for (int i = 0;i<count;i++)
|
|
|
{
|
|
|
NSDictionary* itemjson = [self.download_task objectForKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
|
@@ -1583,6 +1584,7 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
{
|
|
|
alldone=false;
|
|
|
trouble=true;
|
|
|
+ response = [itemjson[@"response"] boolValue];
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -1590,7 +1592,12 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
}
|
|
|
if(trouble)
|
|
|
{
|
|
|
- [self add_downloadlog:@"offline sync got some trouble, sync canceled."];
|
|
|
+ NSString* msg =@"offline sync got some trouble, sync canceled.";
|
|
|
+ if(response==false)
|
|
|
+ {
|
|
|
+ msg=@"Cannot connect to server, please check your network.";
|
|
|
+ }
|
|
|
+ [self add_downloadlog:msg];
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
// self.downloadlog=nil;
|
|
|
self.downloading=false;
|
|
|
@@ -1936,6 +1943,7 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
//self.fileName = response.suggestedFilename;
|
|
|
|
|
|
currenttask[@"fileName"] = response.suggestedFilename;
|
|
|
+ currenttask[@"response"] = @"true";
|
|
|
[self add_downloadlog:[NSString stringWithFormat:@"Begin download file %@.",currenttask[@"fileName"]]];
|
|
|
|
|
|
self.download_task [[NSString stringWithFormat:@"item_%d",self.current_task]]=currenttask;
|