Close connection when an exception occurs.
This commit is contained in:
parent
d4ebc7ed17
commit
1602ca3148
1 changed files with 10 additions and 3 deletions
|
@ -299,7 +299,8 @@
|
|||
[sock asyncReadIntoBuffer: buffer
|
||||
length: BUFFER_LENGTH
|
||||
target: self
|
||||
selector: @selector(stream:didReadIntoBuffer:length:)];
|
||||
selector: @selector(stream:didReadIntoBuffer:length:
|
||||
exception:)];
|
||||
}
|
||||
|
||||
- (BOOL)XMPP_parseBuffer: (const void*)buffer
|
||||
|
@ -340,7 +341,13 @@
|
|||
- (BOOL)stream: (OFStream*)stream
|
||||
didReadIntoBuffer: (char*)buffer
|
||||
length: (size_t)length
|
||||
exception: (OFException*)exception
|
||||
{
|
||||
if (exception != nil) {
|
||||
[self close];
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (![self XMPP_parseBuffer: buffer
|
||||
length: length])
|
||||
return NO;
|
||||
|
@ -355,8 +362,8 @@
|
|||
[sock asyncReadIntoBuffer: buffer
|
||||
length: BUFFER_LENGTH
|
||||
target: self
|
||||
selector: @selector(stream:
|
||||
didReadIntoBuffer:length:)];
|
||||
selector: @selector(stream:didReadIntoBuffer:
|
||||
length:exception:)];
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue