@@ -96,14 +96,15 @@ char *node; Stringprep_rc rc; if ((rc = stringprep_profile([username_ UTF8String], &node, "SASLprep", 0)) != STRINGPREP_OK) - @throw [XMPPStringPrepFailedException newWithClass: isa - connection: self - profile: @"SASLprep" - string: username_]; + @throw [XMPPStringPrepFailedException + exceptionWithClass: isa + connection: self + profile: @"SASLprep" + string: username_]; @try { username = [[OFString alloc] initWithUTF8String: node]; } @finally { free(node); @@ -124,14 +125,14 @@ Stringprep_rc rc; if ((rc = stringprep_profile([resource_ UTF8String], &res, "Resourceprep", 0)) != STRINGPREP_OK) @throw [XMPPStringPrepFailedException - newWithClass: isa - connection: self - profile: @"Resourceprep" - string: resource_]; + exceptionWithClass: isa + connection: self + profile: @"Resourceprep" + string: resource_]; @try { resource = [[OFString alloc] initWithUTF8String: res]; } @finally { free(res); @@ -152,14 +153,14 @@ Idna_rc rc; if ((rc = idna_to_ascii_8z([server_ UTF8String], &srv, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS) @throw [XMPPIDNATranslationFailedException - newWithClass: isa - connection: self - operation: @"ToASCII" - string: server_]; + exceptionWithClass: isa + connection: self + operation: @"ToASCII" + string: server_]; @try { server = [[OFString alloc] initWithUTF8String: srv]; } @finally { free(srv); @@ -179,14 +180,15 @@ char *srv; Stringprep_rc rc; if ((rc = stringprep_profile([domain_ UTF8String], &srv, "Nameprep", 0)) != STRINGPREP_OK) - @throw [XMPPStringPrepFailedException newWithClass: isa - connection: self - profile: @"Nameprep" - string: domain_]; + @throw [XMPPStringPrepFailedException + exceptionWithClass: isa + connection: self + profile: @"Nameprep" + string: domain_]; @try { domain = [[OFString alloc] initWithUTF8String: srv]; } @finally { free(srv); @@ -206,14 +208,15 @@ char *pass; Stringprep_rc rc; if ((rc = stringprep_profile([password_ UTF8String], &pass, "SASLprep", 0)) != STRINGPREP_OK) - @throw [XMPPStringPrepFailedException newWithClass: isa - connection: self - profile: @"SASLprep" - string: password_]; + @throw [XMPPStringPrepFailedException + exceptionWithClass: isa + connection: self + profile: @"SASLprep" + string: password_]; @try { password = [[OFString alloc] initWithUTF8String: pass]; } @finally { free(pass); @@ -242,14 +245,14 @@ port: port]; else { if ((rc = idna_to_ascii_8z([domain UTF8String], &cDomainToASCII, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS) @throw [XMPPIDNATranslationFailedException - newWithClass: isa - connection: self - operation: @"ToASCII" - string: domain]; + exceptionWithClass: isa + connection: self + operation: @"ToASCII" + string: domain]; @try { domainToASCII = [OFString stringWithUTF8String: cDomainToASCII]; } @finally { @@ -258,11 +261,10 @@ @try { SRVLookup = [XMPPSRVLookup lookupWithDomain: domainToASCII]; } @catch (id e) { - [e release]; } enumerator = [SRVLookup objectEnumerator]; /* Iterate over SRV records, if any */ @@ -272,13 +274,11 @@ [sock connectToHost: [candidate target] port: [candidate port]]; break; } @catch (OFAddressTranslationFailedException *e) { - [e release]; } @catch (OFConnectionFailedException *e) { - [e release]; } } while ((candidate = [enumerator nextObject]) != nil); } else /* No SRV records -> fall back to A / AAAA record */ [sock connectToHost: domainToASCII @@ -567,14 +567,14 @@ reason = [[element elementForName: @"text" namespace: XMPP_NS_XMPP_STREAM] stringValue]; - @throw [XMPPStreamErrorException newWithClass: isa - connection: self - condition: condition - reason: reason]; + @throw [XMPPStreamErrorException exceptionWithClass: isa + connection: self + condition: condition + reason: reason]; return; } assert(0); } @@ -605,11 +605,11 @@ return; } if ([[element name] isEqual: @"failure"]) /* TODO: Find/create an exception to throw here */ - @throw [OFException newWithClass: isa]; + @throw [OFException exceptionWithClass: isa]; assert(0); } - (void)XMPP_handleSASL: (OFXMLElement*)element @@ -653,13 +653,13 @@ if ([[element name] isEqual: @"failure"]) { of_log(@"Auth failed!"); // FIXME: Do more parsing/handling @throw [XMPPAuthFailedException - newWithClass: isa - connection: self - reason: [element XMLString]]; + exceptionWithClass: isa + connection: self + reason: [element XMLString]]; } assert(0); } @@ -728,11 +728,11 @@ return; } if (encryptionRequired && !encrypted) /* TODO: Find/create an exception to throw here */ - @throw [OFException newWithClass: isa]; + @throw [OFException exceptionWithClass: isa]; if (mechs != nil) { OFEnumerator *enumerator; OFXMLElement *mech;