Don't access isa directly.
This commit is contained in:
parent
867450105e
commit
f590ff46fe
10 changed files with 43 additions and 40 deletions
|
@ -110,7 +110,7 @@
|
|||
if ((rc = stringprep_profile([username_ UTF8String], &node,
|
||||
"SASLprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: self
|
||||
profile: @"SASLprep"
|
||||
string: username_];
|
||||
|
@ -138,7 +138,7 @@
|
|||
if ((rc = stringprep_profile([resource_ UTF8String], &res,
|
||||
"Resourceprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: self
|
||||
profile: @"Resourceprep"
|
||||
string: resource_];
|
||||
|
@ -179,7 +179,7 @@
|
|||
if ((rc = stringprep_profile([domain_ UTF8String], &srv,
|
||||
"Nameprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: self
|
||||
profile: @"Nameprep"
|
||||
string: domain_];
|
||||
|
@ -209,7 +209,7 @@
|
|||
if ((rc = stringprep_profile([password_ UTF8String], &pass,
|
||||
"SASLprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: self
|
||||
profile: @"SASLprep"
|
||||
string: password_];
|
||||
|
@ -695,10 +695,11 @@
|
|||
elementForName: @"text"
|
||||
namespace: XMPP_NS_XMPP_STREAM] stringValue];
|
||||
|
||||
@throw [XMPPStreamErrorException exceptionWithClass: isa
|
||||
connection: self
|
||||
condition: condition
|
||||
reason: reason];
|
||||
@throw [XMPPStreamErrorException
|
||||
exceptionWithClass: [self class]
|
||||
connection: self
|
||||
condition: condition
|
||||
reason: reason];
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -735,7 +736,7 @@
|
|||
|
||||
if ([[element name] isEqual: @"failure"])
|
||||
/* TODO: Find/create an exception to throw here */
|
||||
@throw [OFException exceptionWithClass: isa];
|
||||
@throw [OFException exceptionWithClass: [self class]];
|
||||
|
||||
assert(0);
|
||||
}
|
||||
|
@ -781,7 +782,7 @@
|
|||
of_log(@"Auth failed!");
|
||||
// FIXME: Do more parsing/handling
|
||||
@throw [XMPPAuthFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: self
|
||||
reason: [element XMLString]];
|
||||
}
|
||||
|
@ -848,7 +849,7 @@
|
|||
|
||||
if (encryptionRequired && !encrypted)
|
||||
/* TODO: Find/create an exception to throw here */
|
||||
@throw [OFException exceptionWithClass: isa];
|
||||
@throw [OFException exceptionWithClass: [self class]];
|
||||
|
||||
if ([element elementForName: @"ver"
|
||||
namespace: XMPP_NS_ROSTERVER] != nil)
|
||||
|
@ -1038,7 +1039,7 @@
|
|||
if ((rc = idna_to_ascii_8z([domain_ UTF8String],
|
||||
&cDomain, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS)
|
||||
@throw [XMPPIDNATranslationFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: self
|
||||
operation: @"ToASCII"
|
||||
string: domain_];
|
||||
|
@ -1070,7 +1071,8 @@
|
|||
- (void)setDataStorage: (id <XMPPStorage>)dataStorage_
|
||||
{
|
||||
if (streamOpen)
|
||||
@throw [OFInvalidArgumentException exceptionWithClass: isa];
|
||||
@throw [OFInvalidArgumentException
|
||||
exceptionWithClass: [self class]];
|
||||
|
||||
dataStorage = dataStorage_;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
- initWithClass: (Class)class_
|
||||
{
|
||||
Class c = isa;
|
||||
Class c = [self class];
|
||||
[self release];
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
|
@ -97,7 +97,7 @@
|
|||
- initWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
{
|
||||
Class c = isa;
|
||||
Class c = [self class];
|
||||
[self release];
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
|
@ -167,7 +167,7 @@
|
|||
- initWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
{
|
||||
Class c = isa;
|
||||
Class c = [self class];
|
||||
[self release];
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
|
@ -238,7 +238,7 @@
|
|||
- initWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
{
|
||||
Class c = isa;
|
||||
Class c = [self class];
|
||||
[self release];
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
|
@ -306,7 +306,7 @@
|
|||
- initWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
{
|
||||
Class c = isa;
|
||||
Class c = [self class];
|
||||
[self release];
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
if (![type_ isEqual: @"get"] && ![type_ isEqual: @"set"] &&
|
||||
![type_ isEqual: @"result"] && ![type_ isEqual: @"error"])
|
||||
@throw [OFInvalidArgumentException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
selector: _cmd];
|
||||
} @catch (id e) {
|
||||
[self release];
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
"Nodeprep", 0)) != STRINGPREP_OK) || (nodepart[0] == '\0') ||
|
||||
(strlen(nodepart) > 1023))
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: nil
|
||||
profile: @"Nodeprep"
|
||||
string: node_];
|
||||
|
@ -145,7 +145,7 @@
|
|||
"Nameprep", 0)) != STRINGPREP_OK) || (srv[0] == '\0') ||
|
||||
(strlen(srv) > 1023))
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: nil
|
||||
profile: @"Nameprep"
|
||||
string: domain_];
|
||||
|
@ -180,7 +180,7 @@
|
|||
"Resourceprep", 0)) != STRINGPREP_OK) || (res[0] == '\0') ||
|
||||
(strlen(res) > 1023))
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: nil
|
||||
profile: @"Resourceprep"
|
||||
string: resource_];
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
@implementation XMPPJSONFileStorage
|
||||
- init
|
||||
{
|
||||
Class c = isa;
|
||||
Class c = [self class];
|
||||
[self release];
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
|
|
|
@ -213,7 +213,8 @@
|
|||
- (void)setDataStorage: (id <XMPPStorage>)dataStorage_
|
||||
{
|
||||
if (rosterRequested)
|
||||
@throw [OFInvalidArgumentException exceptionWithClass: isa];
|
||||
@throw [OFInvalidArgumentException
|
||||
exceptionWithClass: [self class]];
|
||||
|
||||
dataStorage = dataStorage_;
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@
|
|||
if ([comp hasPrefix: @"r="]) {
|
||||
if (![entry hasPrefix: cNonce])
|
||||
@throw [XMPPAuthFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: nil
|
||||
reason: @"Received wrong "
|
||||
@"nonce"];
|
||||
|
@ -249,7 +249,8 @@
|
|||
}
|
||||
|
||||
if (got != (GOT_SNONCE | GOT_SALT | GOT_ITERCOUNT))
|
||||
@throw [OFInvalidServerReplyException exceptionWithClass: isa];
|
||||
@throw [OFInvalidServerReplyException
|
||||
exceptionWithClass: [self class]];
|
||||
|
||||
// Add c=<base64(GS2Header+channelBindingData)>
|
||||
tmpArray = [OFDataArray dataArray];
|
||||
|
@ -392,13 +393,13 @@
|
|||
if ([mess hasPrefix: @"v="]) {
|
||||
if (![value isEqual: [serverSignature stringByBase64Encoding]])
|
||||
@throw [XMPPAuthFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
connection: nil
|
||||
reason: @"Received wrong "
|
||||
@"ServerSignature"];
|
||||
authenticated = YES;
|
||||
} else
|
||||
@throw [XMPPAuthFailedException exceptionWithClass: isa
|
||||
@throw [XMPPAuthFailedException exceptionWithClass: [self class]
|
||||
connection: nil
|
||||
reason: value];
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
- init
|
||||
{
|
||||
Class c = isa;
|
||||
Class c = [self class];
|
||||
[self release];
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
|
@ -98,7 +98,7 @@
|
|||
if (dn_expand(ns_msg_base(handle), ns_msg_end(handle),
|
||||
(uint8_t*)&rdata[3], buffer, NS_MAXDNAME) < 1)
|
||||
@throw [OFInitializationFailedException
|
||||
exceptionWithClass: isa];
|
||||
exceptionWithClass: [self class]];
|
||||
|
||||
target = [[OFString alloc]
|
||||
initWithCString: buffer
|
||||
|
@ -120,10 +120,9 @@
|
|||
|
||||
- (OFString*)description
|
||||
{
|
||||
return [OFString stringWithFormat: @"<%@ priority: %" PRIu16
|
||||
@", weight: %" PRIu16
|
||||
@", target: %@:%" PRIu16 @">",
|
||||
isa, priority, weight, target, port];
|
||||
return [OFString stringWithFormat:
|
||||
@"<%@ priority: %" PRIu16 @", weight: %" PRIu16 @", target: %@:%"
|
||||
PRIu16 @">", [self class], priority, weight, target, port];
|
||||
}
|
||||
|
||||
- (uint16_t)priority
|
||||
|
@ -208,7 +207,7 @@
|
|||
|
||||
if (res_ninit(&resState))
|
||||
@throw [OFAddressTranslationFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
socket: nil
|
||||
host: domain];
|
||||
|
||||
|
@ -223,14 +222,14 @@
|
|||
|
||||
if (answerLen < 1 || answerLen > of_pagesize) {
|
||||
@throw [OFAddressTranslationFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
socket: nil
|
||||
host: domain];
|
||||
}
|
||||
|
||||
if (ns_initparse(answer, answerLen, &handle))
|
||||
@throw [OFAddressTranslationFailedException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
socket: nil
|
||||
host: domain];
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
if (![name_ isEqual: @"iq"] && ![name_ isEqual: @"message"] &&
|
||||
![name_ isEqual: @"presence"])
|
||||
@throw [OFInvalidArgumentException
|
||||
exceptionWithClass: isa
|
||||
exceptionWithClass: [self class]
|
||||
selector: _cmd];
|
||||
|
||||
[self setDefaultNamespace: XMPP_NS_CLIENT];
|
||||
|
|
|
@ -32,12 +32,12 @@
|
|||
- (void)parser: (OFXMLParser*)parser
|
||||
foundProcessingInstructions: (OFString*)pi
|
||||
{
|
||||
@throw [OFMalformedXMLException exceptionWithClass: isa];
|
||||
@throw [OFMalformedXMLException exceptionWithClass: [self class]];
|
||||
}
|
||||
|
||||
- (void)parser: (OFXMLParser*)parser
|
||||
foundComment: (OFString*)comment
|
||||
{
|
||||
@throw [OFMalformedXMLException exceptionWithClass: isa];
|
||||
@throw [OFMalformedXMLException exceptionWithClass: [self class]];
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue