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
|
[sock asyncReadIntoBuffer: buffer
|
||||||
length: BUFFER_LENGTH
|
length: BUFFER_LENGTH
|
||||||
target: self
|
target: self
|
||||||
selector: @selector(stream:didReadIntoBuffer:length:)];
|
selector: @selector(stream:didReadIntoBuffer:length:
|
||||||
|
exception:)];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)XMPP_parseBuffer: (const void*)buffer
|
- (BOOL)XMPP_parseBuffer: (const void*)buffer
|
||||||
|
@ -340,7 +341,13 @@
|
||||||
- (BOOL)stream: (OFStream*)stream
|
- (BOOL)stream: (OFStream*)stream
|
||||||
didReadIntoBuffer: (char*)buffer
|
didReadIntoBuffer: (char*)buffer
|
||||||
length: (size_t)length
|
length: (size_t)length
|
||||||
|
exception: (OFException*)exception
|
||||||
{
|
{
|
||||||
|
if (exception != nil) {
|
||||||
|
[self close];
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
if (![self XMPP_parseBuffer: buffer
|
if (![self XMPP_parseBuffer: buffer
|
||||||
length: length])
|
length: length])
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -355,8 +362,8 @@
|
||||||
[sock asyncReadIntoBuffer: buffer
|
[sock asyncReadIntoBuffer: buffer
|
||||||
length: BUFFER_LENGTH
|
length: BUFFER_LENGTH
|
||||||
target: self
|
target: self
|
||||||
selector: @selector(stream:
|
selector: @selector(stream:didReadIntoBuffer:
|
||||||
didReadIntoBuffer:length:)];
|
length:exception:)];
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue