Browse Source

Fixed timeout for connection

master
Igor Zhukov 10 years ago
parent
commit
7c8171d09f
  1. 13
      app/js/lib/mtproto.js

13
app/js/lib/mtproto.js

@ -546,7 +546,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
}) })
.factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpTimeManager, MtpSecureRandom, Storage, CryptoWorker, $http, $q, $timeout, $interval, $rootScope) { .factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpTimeManager, MtpSecureRandom, Storage, CryptoWorker, AppRuntimeManager, $http, $q, $timeout, $interval, $rootScope) {
var updatesProcessor, var updatesProcessor,
iii = 0, iii = 0,
@ -1128,7 +1128,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
var requestPromise; var requestPromise;
try { try {
options = angular.copy(options || {}, { options = angular.extend(options || {}, {
responseType: 'arraybuffer', responseType: 'arraybuffer',
transformRequest: null transformRequest: null
}); });
@ -1144,6 +1144,15 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
return result; return result;
}, },
function (error) { function (error) {
if (error.status == 404 &&
(error.data || '').indexOf('nginx/0.3.33') != -1) {
Storage.remove(
'dc' + self.dcID + '_server_salt',
'dc' + self.dcID + '_auth_key'
).then(function () {
AppRuntimeManager.reload();
});
}
if (!error.message && !error.type) { if (!error.message && !error.type) {
error = {code: 406, type: 'NETWORK_BAD_REQUEST'}; error = {code: 406, type: 'NETWORK_BAD_REQUEST'};
} }

Loading…
Cancel
Save