зеркало из https://github.com/nextcloud/talk-ios.git
Correctly reset the websocket in all cases
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Родитель
8b8f3e1264
Коммит
c3d3db6d4a
|
@ -159,11 +159,7 @@ static NSTimeInterval kWebSocketTimeoutInterval = 15;
|
|||
|
||||
[self executeAllCompletionBlocksWithError];
|
||||
|
||||
[_webSocket cancel];
|
||||
_webSocket = nil;
|
||||
_helloResponseReceived = NO;
|
||||
[_helloMessage ignoreCompletionBlock];
|
||||
_helloMessage = nil;
|
||||
[self resetWebSocket];
|
||||
|
||||
[self setReconnectionTimer];
|
||||
}
|
||||
|
@ -180,13 +176,20 @@ static NSTimeInterval kWebSocketTimeoutInterval = 15;
|
|||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self invalidateReconnectionTimer];
|
||||
[self->_webSocket cancel];
|
||||
self->_webSocket = nil;
|
||||
self->_helloResponseReceived = NO;
|
||||
self->_disconnected = YES;
|
||||
[self resetWebSocket];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)resetWebSocket
|
||||
{
|
||||
[_webSocket cancel];
|
||||
_webSocket = nil;
|
||||
_helloResponseReceived = NO;
|
||||
[_helloMessage ignoreCompletionBlock];
|
||||
_helloMessage = nil;
|
||||
_disconnected = YES;
|
||||
}
|
||||
|
||||
- (void)setReconnectionTimer
|
||||
{
|
||||
[self invalidateReconnectionTimer];
|
||||
|
|
Загрузка…
Ссылка в новой задаче