Adjust to recent ObjFW changes.
This commit is contained in:
parent
74727c159c
commit
df5e8f04b4
8 changed files with 139 additions and 133 deletions
|
@ -98,7 +98,8 @@
|
|||
|
||||
if ((rc = stringprep_profile([username_ UTF8String], &node,
|
||||
"SASLprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException newWithClass: isa
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
connection: self
|
||||
profile: @"SASLprep"
|
||||
string: username_];
|
||||
|
@ -126,7 +127,7 @@
|
|||
if ((rc = stringprep_profile([resource_ UTF8String], &res,
|
||||
"Resourceprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
connection: self
|
||||
profile: @"Resourceprep"
|
||||
string: resource_];
|
||||
|
@ -154,7 +155,7 @@
|
|||
if ((rc = idna_to_ascii_8z([server_ UTF8String],
|
||||
&srv, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS)
|
||||
@throw [XMPPIDNATranslationFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
connection: self
|
||||
operation: @"ToASCII"
|
||||
string: server_];
|
||||
|
@ -181,7 +182,8 @@
|
|||
|
||||
if ((rc = stringprep_profile([domain_ UTF8String], &srv,
|
||||
"Nameprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException newWithClass: isa
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
connection: self
|
||||
profile: @"Nameprep"
|
||||
string: domain_];
|
||||
|
@ -208,7 +210,8 @@
|
|||
|
||||
if ((rc = stringprep_profile([password_ UTF8String], &pass,
|
||||
"SASLprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException newWithClass: isa
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
connection: self
|
||||
profile: @"SASLprep"
|
||||
string: password_];
|
||||
|
@ -244,7 +247,7 @@
|
|||
if ((rc = idna_to_ascii_8z([domain UTF8String], &cDomainToASCII,
|
||||
IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS)
|
||||
@throw [XMPPIDNATranslationFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
connection: self
|
||||
operation: @"ToASCII"
|
||||
string: domain];
|
||||
|
@ -260,7 +263,6 @@
|
|||
SRVLookup = [XMPPSRVLookup
|
||||
lookupWithDomain: domainToASCII];
|
||||
} @catch (id e) {
|
||||
[e release];
|
||||
}
|
||||
|
||||
enumerator = [SRVLookup objectEnumerator];
|
||||
|
@ -274,9 +276,7 @@
|
|||
break;
|
||||
} @catch (OFAddressTranslationFailedException
|
||||
*e) {
|
||||
[e release];
|
||||
} @catch (OFConnectionFailedException *e) {
|
||||
[e release];
|
||||
}
|
||||
} while ((candidate = [enumerator nextObject]) != nil);
|
||||
} else
|
||||
|
@ -569,7 +569,7 @@
|
|||
elementForName: @"text"
|
||||
namespace: XMPP_NS_XMPP_STREAM] stringValue];
|
||||
|
||||
@throw [XMPPStreamErrorException newWithClass: isa
|
||||
@throw [XMPPStreamErrorException exceptionWithClass: isa
|
||||
connection: self
|
||||
condition: condition
|
||||
reason: reason];
|
||||
|
@ -607,7 +607,7 @@
|
|||
|
||||
if ([[element name] isEqual: @"failure"])
|
||||
/* TODO: Find/create an exception to throw here */
|
||||
@throw [OFException newWithClass: isa];
|
||||
@throw [OFException exceptionWithClass: isa];
|
||||
|
||||
assert(0);
|
||||
}
|
||||
|
@ -655,7 +655,7 @@
|
|||
of_log(@"Auth failed!");
|
||||
// FIXME: Do more parsing/handling
|
||||
@throw [XMPPAuthFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
connection: self
|
||||
reason: [element XMLString]];
|
||||
}
|
||||
|
@ -730,7 +730,7 @@
|
|||
|
||||
if (encryptionRequired && !encrypted)
|
||||
/* TODO: Find/create an exception to throw here */
|
||||
@throw [OFException newWithClass: isa];
|
||||
@throw [OFException exceptionWithClass: isa];
|
||||
|
||||
if (mechs != nil) {
|
||||
OFEnumerator *enumerator;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
@property (readonly, nonatomic) XMPPConnection *connection;
|
||||
#endif
|
||||
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn;
|
||||
- initWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn;
|
||||
|
@ -52,7 +52,7 @@
|
|||
@property (readonly, nonatomic) OFString *reason;
|
||||
#endif
|
||||
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
condition: (OFString*)condition_
|
||||
reason: (OFString*)reason_;
|
||||
|
@ -74,7 +74,7 @@
|
|||
@property (readonly, nonatomic) OFString *profile, *string;
|
||||
#endif
|
||||
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
profile: (OFString*)profile
|
||||
string: (OFString*)string;
|
||||
|
@ -96,7 +96,7 @@
|
|||
@property (readonly, nonatomic) OFString *operation, *string;
|
||||
#endif
|
||||
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
operation: (OFString*)operation
|
||||
string: (OFString*)string;
|
||||
|
@ -117,7 +117,7 @@
|
|||
@property (readonly, nonatomic) OFString *reason;
|
||||
#endif
|
||||
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
reason: (OFString*)reason_;
|
||||
- initWithClass: (Class)class_
|
||||
|
|
|
@ -27,18 +27,18 @@
|
|||
#import "XMPPExceptions.h"
|
||||
|
||||
@implementation XMPPException
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
{
|
||||
return [[self alloc] initWithClass: class_
|
||||
connection: conn];
|
||||
return [[[self alloc] initWithClass: class_
|
||||
connection: conn] autorelease];
|
||||
}
|
||||
|
||||
- initWithClass: (Class)class_
|
||||
{
|
||||
Class c = isa;
|
||||
[self release];
|
||||
@throw [OFNotImplementedException newWithClass: c
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
}
|
||||
|
||||
|
@ -82,15 +82,15 @@
|
|||
@end
|
||||
|
||||
@implementation XMPPStreamErrorException
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
condition: (OFString*)condition_
|
||||
reason: (OFString*)reason_;
|
||||
{
|
||||
return [[self alloc] initWithClass: class_
|
||||
return [[[self alloc] initWithClass: class_
|
||||
connection: conn
|
||||
condition: condition_
|
||||
reason: reason_];
|
||||
reason: reason_] autorelease];
|
||||
}
|
||||
|
||||
- initWithClass: (Class)class_
|
||||
|
@ -98,7 +98,7 @@
|
|||
{
|
||||
Class c = isa;
|
||||
[self release];
|
||||
@throw [OFNotImplementedException newWithClass: c
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
}
|
||||
|
||||
|
@ -152,15 +152,15 @@
|
|||
@end
|
||||
|
||||
@implementation XMPPStringPrepFailedException
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
profile: (OFString*)profile
|
||||
string: (OFString*)string
|
||||
{
|
||||
return [[self alloc] initWithClass: class_
|
||||
return [[[self alloc] initWithClass: class_
|
||||
connection: conn
|
||||
profile: profile
|
||||
string: string];
|
||||
string: string] autorelease];
|
||||
}
|
||||
|
||||
- initWithClass: (Class)class_
|
||||
|
@ -168,7 +168,7 @@
|
|||
{
|
||||
Class c = isa;
|
||||
[self release];
|
||||
@throw [OFNotImplementedException newWithClass: c
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
}
|
||||
|
||||
|
@ -223,15 +223,15 @@
|
|||
@end
|
||||
|
||||
@implementation XMPPIDNATranslationFailedException
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
operation: (OFString*)operation
|
||||
string: (OFString*)string
|
||||
{
|
||||
return [[self alloc] initWithClass: class_
|
||||
return [[[self alloc] initWithClass: class_
|
||||
connection: conn
|
||||
operation: operation
|
||||
string: string];
|
||||
string: string] autorelease];
|
||||
}
|
||||
|
||||
- initWithClass: (Class)class_
|
||||
|
@ -239,7 +239,7 @@
|
|||
{
|
||||
Class c = isa;
|
||||
[self release];
|
||||
@throw [OFNotImplementedException newWithClass: c
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
}
|
||||
|
||||
|
@ -293,13 +293,13 @@
|
|||
@end
|
||||
|
||||
@implementation XMPPAuthFailedException
|
||||
+ newWithClass: (Class)class_
|
||||
+ exceptionWithClass: (Class)class_
|
||||
connection: (XMPPConnection*)conn
|
||||
reason: (OFString*)reason_;
|
||||
{
|
||||
return [[self alloc] initWithClass: class_
|
||||
return [[[self alloc] initWithClass: class_
|
||||
connection: conn
|
||||
reason: reason_];
|
||||
reason: reason_] autorelease];
|
||||
}
|
||||
|
||||
- initWithClass: (Class)class_
|
||||
|
@ -307,7 +307,7 @@
|
|||
{
|
||||
Class c = isa;
|
||||
[self release];
|
||||
@throw [OFNotImplementedException newWithClass: c
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
@try {
|
||||
if (![type_ isEqual: @"get"] && ![type_ isEqual: @"set"] &&
|
||||
![type_ isEqual: @"result"] && ![type_ isEqual: @"error"])
|
||||
@throw [OFInvalidArgumentException newWithClass: isa
|
||||
@throw [OFInvalidArgumentException
|
||||
exceptionWithClass: isa
|
||||
selector: _cmd];
|
||||
} @catch (id e) {
|
||||
[self release];
|
||||
|
|
|
@ -112,7 +112,8 @@
|
|||
|
||||
if ((rc = stringprep_profile([node_ UTF8String], &nodepart,
|
||||
"Nodeprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException newWithClass: isa
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
connection: nil
|
||||
profile: @"Nodeprep"
|
||||
string: node_];
|
||||
|
@ -139,7 +140,8 @@
|
|||
|
||||
if ((rc = stringprep_profile([domain_ UTF8String], &srv,
|
||||
"Nameprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException newWithClass: isa
|
||||
@throw [XMPPStringPrepFailedException
|
||||
exceptionWithClass: isa
|
||||
connection: nil
|
||||
profile: @"Nameprep"
|
||||
string: domain_];
|
||||
|
@ -173,7 +175,7 @@
|
|||
if ((rc = stringprep_profile([resource_ UTF8String], &res,
|
||||
"Resourceprep", 0)) != STRINGPREP_OK)
|
||||
@throw [XMPPStringPrepFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
connection: nil
|
||||
profile: @"Resourceprep"
|
||||
string: resource_];
|
||||
|
|
|
@ -231,9 +231,10 @@
|
|||
if ([comp hasPrefix: @"r="]) {
|
||||
if (![entry hasPrefix: cNonce])
|
||||
@throw [XMPPAuthFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
connection: nil
|
||||
reason: @"Received wrong nonce"];
|
||||
reason: @"Received wrong "
|
||||
@"nonce"];
|
||||
|
||||
sNonce = entry;
|
||||
got |= GOT_SNONCE;
|
||||
|
@ -248,7 +249,7 @@
|
|||
}
|
||||
|
||||
if (got != (GOT_SNONCE | GOT_SALT | GOT_ITERCOUNT))
|
||||
@throw [OFInvalidServerReplyException newWithClass: isa];
|
||||
@throw [OFInvalidServerReplyException exceptionWithClass: isa];
|
||||
|
||||
// Add c=<base64(GS2Header+channelBindingData)>
|
||||
tmpArray = [OFDataArray dataArrayWithItemSize: 1];
|
||||
|
@ -389,12 +390,13 @@
|
|||
if ([mess hasPrefix: @"v="]) {
|
||||
if (![value isEqual: [serverSignature stringByBase64Encoding]])
|
||||
@throw [XMPPAuthFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
connection: nil
|
||||
reason: @"Received wrong ServerSignature"];
|
||||
reason: @"Received wrong "
|
||||
@"ServerSignature"];
|
||||
authenticated = YES;
|
||||
} else
|
||||
@throw [XMPPAuthFailedException newWithClass: isa
|
||||
@throw [XMPPAuthFailedException exceptionWithClass: isa
|
||||
connection: nil
|
||||
reason: value];
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
{
|
||||
Class c = isa;
|
||||
[self release];
|
||||
@throw [OFNotImplementedException newWithClass: c
|
||||
@throw [OFNotImplementedException exceptionWithClass: c
|
||||
selector: _cmd];
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
|||
if (dn_expand(ns_msg_base(handle), ns_msg_end(handle),
|
||||
(uint8_t*)&rdata[3], buffer, NS_MAXDNAME) < 1)
|
||||
@throw [OFInitializationFailedException
|
||||
newWithClass: isa];
|
||||
exceptionWithClass: isa];
|
||||
|
||||
target = [[OFString alloc]
|
||||
initWithCString: buffer
|
||||
|
@ -210,7 +210,7 @@
|
|||
|
||||
if (res_ninit(&resState))
|
||||
@throw [OFAddressTranslationFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
socket: nil
|
||||
host: domain];
|
||||
|
||||
|
@ -225,14 +225,14 @@
|
|||
|
||||
if (answerLen < 1 || answerLen > of_pagesize) {
|
||||
@throw [OFAddressTranslationFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
socket: nil
|
||||
host: domain];
|
||||
}
|
||||
|
||||
if (ns_initparse(answer, answerLen, &handle))
|
||||
@throw [OFAddressTranslationFailedException
|
||||
newWithClass: isa
|
||||
exceptionWithClass: isa
|
||||
socket: nil
|
||||
host: domain];
|
||||
|
||||
|
|
|
@ -96,7 +96,8 @@
|
|||
@try {
|
||||
if (![name_ isEqual: @"iq"] && ![name_ isEqual: @"message"] &&
|
||||
![name_ isEqual: @"presence"])
|
||||
@throw [OFInvalidArgumentException newWithClass: isa
|
||||
@throw [OFInvalidArgumentException
|
||||
exceptionWithClass: isa
|
||||
selector: _cmd];
|
||||
|
||||
[self setDefaultNamespace: XMPP_NS_CLIENT];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue