Index: ObjXMPP.xcodeproj/project.pbxproj ================================================================== --- ObjXMPP.xcodeproj/project.pbxproj +++ ObjXMPP.xcodeproj/project.pbxproj @@ -9,10 +9,15 @@ /* Begin PBXBuildFile section */ 4B01D020137C7E7D005624EA /* namespaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B01D01F137C7E7D005624EA /* namespaces.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B1295EF1337BD5F00154B25 /* test.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B1295EE1337BD5F00154B25 /* test.m */; }; 4B1295F11337C37E00154B25 /* ObjXMPP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BC559911337A65400E345C7 /* ObjXMPP.framework */; }; 4B1295F21337C3CF00154B25 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BC559D61337ABD300E345C7 /* ObjFW.framework */; }; + 4B19F57A14D17082005D52DC /* XMPPCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19F57614D17081005D52DC /* XMPPCallback.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B19F57B14D17082005D52DC /* XMPPCallback.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B19F57714D17081005D52DC /* XMPPCallback.m */; }; + 4B19F57C14D17082005D52DC /* XMPPEXTERNALAuth.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B19F57814D17081005D52DC /* XMPPEXTERNALAuth.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4B19F57D14D17082005D52DC /* XMPPEXTERNALAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B19F57914D17081005D52DC /* XMPPEXTERNALAuth.m */; }; + 4B19F5A314D1779E005D52DC /* ObjOpenSSL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B19F5A214D1779E005D52DC /* ObjOpenSSL.framework */; }; 4B4844F5138BBC7500EB48A5 /* XMPPSRVLookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B4844F3138BBC7400EB48A5 /* XMPPSRVLookup.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4B4844F6138BBC7500EB48A5 /* XMPPSRVLookup.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B4844F4138BBC7500EB48A5 /* XMPPSRVLookup.m */; }; 4B484501138BBEEB00EB48A5 /* libresolv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B484500138BBEEB00EB48A5 /* libresolv.dylib */; }; 4BC559D71337ABD300E345C7 /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BC559D61337ABD300E345C7 /* ObjFW.framework */; }; 4BC559EC1337AC0900E345C7 /* XMPPAuthenticator.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC559DA1337AC0900E345C7 /* XMPPAuthenticator.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -33,11 +38,10 @@ 4BC559FB1337AC0900E345C7 /* XMPPPresence.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BC559E91337AC0900E345C7 /* XMPPPresence.m */; }; 4BC559FC1337AC0900E345C7 /* XMPPSCRAMAuth.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC559EA1337AC0900E345C7 /* XMPPSCRAMAuth.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BC55A001337AC1800E345C7 /* XMPPSCRAMAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BC559FD1337AC1800E345C7 /* XMPPSCRAMAuth.m */; }; 4BC55A011337AC1800E345C7 /* XMPPStanza.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC559FE1337AC1800E345C7 /* XMPPStanza.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BC55A021337AC1800E345C7 /* XMPPStanza.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BC559FF1337AC1800E345C7 /* XMPPStanza.m */; }; - 4BD0AB16134129B900445289 /* ObjOpenSSL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BD0AB15134129B900445289 /* ObjOpenSSL.framework */; }; 4BD9BF59134003F700DAB43A /* XMPPRosterItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD9BF57134003F700DAB43A /* XMPPRosterItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BD9BF5A134003F700DAB43A /* XMPPRosterItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD9BF58134003F700DAB43A /* XMPPRosterItem.m */; }; 4BDEF8071340B240000156D1 /* XMPPRoster.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDEF8051340B240000156D1 /* XMPPRoster.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4BDEF8081340B240000156D1 /* XMPPRoster.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BDEF8061340B240000156D1 /* XMPPRoster.m */; }; /* End PBXBuildFile section */ @@ -57,10 +61,15 @@ /* Begin PBXFileReference section */ 4B01D01C137C7D6E005624EA /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = src/Makefile; sourceTree = SOURCE_ROOT; }; 4B01D01F137C7E7D005624EA /* namespaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = namespaces.h; path = src/namespaces.h; sourceTree = SOURCE_ROOT; }; 4B1295E01337BD2D00154B25 /* ObjXMPPTests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ObjXMPPTests; sourceTree = BUILT_PRODUCTS_DIR; }; 4B1295EE1337BD5F00154B25 /* test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = test.m; path = tests/test.m; sourceTree = SOURCE_ROOT; }; + 4B19F57614D17081005D52DC /* XMPPCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPCallback.h; path = src/XMPPCallback.h; sourceTree = SOURCE_ROOT; }; + 4B19F57714D17081005D52DC /* XMPPCallback.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPCallback.m; path = src/XMPPCallback.m; sourceTree = SOURCE_ROOT; }; + 4B19F57814D17081005D52DC /* XMPPEXTERNALAuth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPEXTERNALAuth.h; path = src/XMPPEXTERNALAuth.h; sourceTree = SOURCE_ROOT; }; + 4B19F57914D17081005D52DC /* XMPPEXTERNALAuth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPEXTERNALAuth.m; path = src/XMPPEXTERNALAuth.m; sourceTree = SOURCE_ROOT; }; + 4B19F5A214D1779E005D52DC /* ObjOpenSSL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjOpenSSL.framework; path = /Library/Frameworks/ObjOpenSSL.framework; sourceTree = ""; }; 4B4844F3138BBC7400EB48A5 /* XMPPSRVLookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPSRVLookup.h; path = src/XMPPSRVLookup.h; sourceTree = SOURCE_ROOT; }; 4B4844F4138BBC7500EB48A5 /* XMPPSRVLookup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPSRVLookup.m; path = src/XMPPSRVLookup.m; sourceTree = SOURCE_ROOT; }; 4B484500138BBEEB00EB48A5 /* libresolv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libresolv.dylib; path = usr/lib/libresolv.dylib; sourceTree = SDKROOT; }; 4BC559911337A65400E345C7 /* ObjXMPP.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ObjXMPP.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4BC559D61337ABD300E345C7 /* ObjFW.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjFW.framework; path = ../../../../Library/Frameworks/ObjFW.framework; sourceTree = ""; }; @@ -83,11 +92,10 @@ 4BC559EA1337AC0900E345C7 /* XMPPSCRAMAuth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPSCRAMAuth.h; path = src/XMPPSCRAMAuth.h; sourceTree = SOURCE_ROOT; }; 4BC559FD1337AC1800E345C7 /* XMPPSCRAMAuth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPSCRAMAuth.m; path = src/XMPPSCRAMAuth.m; sourceTree = SOURCE_ROOT; }; 4BC559FE1337AC1800E345C7 /* XMPPStanza.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPStanza.h; path = src/XMPPStanza.h; sourceTree = SOURCE_ROOT; }; 4BC559FF1337AC1800E345C7 /* XMPPStanza.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPStanza.m; path = src/XMPPStanza.m; sourceTree = SOURCE_ROOT; }; 4BC55A051337ADA800E345C7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; - 4BD0AB15134129B900445289 /* ObjOpenSSL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjOpenSSL.framework; path = ../ObjOpenSSL/build/Debug/ObjOpenSSL.framework; sourceTree = ""; }; 4BD9BF57134003F700DAB43A /* XMPPRosterItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPRosterItem.h; path = src/XMPPRosterItem.h; sourceTree = SOURCE_ROOT; }; 4BD9BF58134003F700DAB43A /* XMPPRosterItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPRosterItem.m; path = src/XMPPRosterItem.m; sourceTree = SOURCE_ROOT; }; 4BDEF8051340B240000156D1 /* XMPPRoster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMPPRoster.h; path = src/XMPPRoster.h; sourceTree = SOURCE_ROOT; }; 4BDEF8061340B240000156D1 /* XMPPRoster.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMPPRoster.m; path = src/XMPPRoster.m; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -104,12 +112,12 @@ }; 4BC5598D1337A65400E345C7 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4BD0AB16134129B900445289 /* ObjOpenSSL.framework in Frameworks */, 4BC559D71337ABD300E345C7 /* ObjFW.framework in Frameworks */, + 4B19F5A314D1779E005D52DC /* ObjOpenSSL.framework in Frameworks */, 4B484501138BBEEB00EB48A5 /* libresolv.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ @@ -153,11 +161,11 @@ }; 4BC559931337A65400E345C7 /* Frameworks */ = { isa = PBXGroup; children = ( 4BC559D61337ABD300E345C7 /* ObjFW.framework */, - 4BD0AB15134129B900445289 /* ObjOpenSSL.framework */, + 4B19F5A214D1779E005D52DC /* ObjOpenSSL.framework */, ); name = Frameworks; sourceTree = ""; }; 4BC5599A1337A65400E345C7 /* ObjXMPP */ = { @@ -164,14 +172,18 @@ isa = PBXGroup; children = ( 4BC5599B1337A65400E345C7 /* Supporting Files */, 4BC559DA1337AC0900E345C7 /* XMPPAuthenticator.h */, 4BC559DB1337AC0900E345C7 /* XMPPAuthenticator.m */, + 4B19F57614D17081005D52DC /* XMPPCallback.h */, + 4B19F57714D17081005D52DC /* XMPPCallback.m */, 4BC559DC1337AC0900E345C7 /* XMPPConnection.h */, 4BC559DD1337AC0900E345C7 /* XMPPConnection.m */, 4BC559DE1337AC0900E345C7 /* XMPPExceptions.h */, 4BC559DF1337AC0900E345C7 /* XMPPExceptions.m */, + 4B19F57814D17081005D52DC /* XMPPEXTERNALAuth.h */, + 4B19F57914D17081005D52DC /* XMPPEXTERNALAuth.m */, 4BC559E01337AC0900E345C7 /* XMPPIQ.h */, 4BC559E11337AC0900E345C7 /* XMPPIQ.m */, 4BC559E21337AC0900E345C7 /* XMPPJID.h */, 4BC559E31337AC0900E345C7 /* XMPPJID.m */, 4BC559E41337AC0900E345C7 /* XMPPMessage.h */, @@ -210,12 +222,14 @@ 4BC5598E1337A65400E345C7 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 4BC559EC1337AC0900E345C7 /* XMPPAuthenticator.h in Headers */, + 4B19F57A14D17082005D52DC /* XMPPCallback.h in Headers */, 4BC559EE1337AC0900E345C7 /* XMPPConnection.h in Headers */, 4BC559F01337AC0900E345C7 /* XMPPExceptions.h in Headers */, + 4B19F57C14D17082005D52DC /* XMPPEXTERNALAuth.h in Headers */, 4BC559F21337AC0900E345C7 /* XMPPIQ.h in Headers */, 4BC559F41337AC0900E345C7 /* XMPPJID.h in Headers */, 4BC559F61337AC0900E345C7 /* XMPPMessage.h in Headers */, 4BC559F81337AC0900E345C7 /* XMPPPLAINAuth.h in Headers */, 4BC559FA1337AC0900E345C7 /* XMPPPresence.h in Headers */, @@ -269,10 +283,13 @@ /* End PBXNativeTarget section */ /* Begin PBXProject section */ 4BC559871337A65400E345C7 /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; buildConfigurationList = 4BC5598A1337A65400E345C7 /* Build configuration list for PBXProject "ObjXMPP" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( @@ -311,12 +328,14 @@ 4BC5598C1337A65400E345C7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 4BC559ED1337AC0900E345C7 /* XMPPAuthenticator.m in Sources */, + 4B19F57B14D17082005D52DC /* XMPPCallback.m in Sources */, 4BC559EF1337AC0900E345C7 /* XMPPConnection.m in Sources */, 4BC559F11337AC0900E345C7 /* XMPPExceptions.m in Sources */, + 4B19F57D14D17082005D52DC /* XMPPEXTERNALAuth.m in Sources */, 4BC559F31337AC0900E345C7 /* XMPPIQ.m in Sources */, 4BC559F51337AC0900E345C7 /* XMPPJID.m in Sources */, 4BC559F71337AC0900E345C7 /* XMPPMessage.m in Sources */, 4BC559F91337AC0900E345C7 /* XMPPPLAINAuth.m in Sources */, 4BC559FB1337AC0900E345C7 /* XMPPPresence.m in Sources */, @@ -361,11 +380,11 @@ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = 4.2; + GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.6; ONLY_ACTIVE_ARCH = YES; @@ -372,37 +391,29 @@ OTHER_CFLAGS = ( "-I/opt/local/include", "-fconstant-string-class=OFConstantString", "-fno-constant-cfstrings", ); - OTHER_LDFLAGS = ( - "-L/opt/local/lib", - "-lidn", - ); SDKROOT = macosx; }; name = Debug; }; 4BC559B71337A65500E345C7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_VERSION = 4.2; + GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CFLAGS = ( "-I/opt/local/include", "-fconstant-string-class=OFConstantString", "-fno-constant-cfstrings", ); - OTHER_LDFLAGS = ( - "-L/opt/local/lib", - "-lidn", - ); SDKROOT = macosx; }; name = Release; }; 4BC559B91337A65500E345C7 /* Debug */ = { @@ -415,15 +426,14 @@ FRAMEWORK_VERSION = A; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = HAVE_RES_NDESTROY; - GCC_VERSION = 4.2; INFOPLIST_FILE = Info.plist; OTHER_LDFLAGS = ( + "-Wl,-reexport_framework,ObjOpenSSL", "-lcrypto", - "-L/opt/local/lib", "-lidn", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = framework; }; @@ -439,15 +449,14 @@ DYLIB_CURRENT_VERSION = 0; FRAMEWORK_VERSION = A; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = HAVE_RES_NDESTROY; - GCC_VERSION = 4.2; INFOPLIST_FILE = Info.plist; OTHER_LDFLAGS = ( + "-Wl,-reexport_framework,ObjOpenSSL", "-lcrypto", - "-L/opt/local/lib", "-lidn", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = framework; }; Index: src/XMPPCallback.h ================================================================== --- src/XMPPCallback.h +++ src/XMPPCallback.h @@ -23,24 +23,26 @@ #import @class XMPPIQ; #ifdef OF_HAVE_BLOCKS -typedef void(^xmpp_callback_block)(XMPPIQ*); +typedef void(^xmpp_callback_block_t)(XMPPIQ*); #endif @interface XMPPCallback: OFObject { id object; SEL selector; } + #ifdef OF_HAVE_BLOCKS -+ callbackWithCallbackBlock: (xmpp_callback_block)callback; -- initWithCallbackBlock: (xmpp_callback_block)callback; ++ callbackWithCallbackBlock: (xmpp_callback_block_t)callback; +- initWithCallbackBlock: (xmpp_callback_block_t)callback; #endif + + callbackWithCallbackObject: (id)object selector: (SEL)selector; - initWithCallbackObject: (id)object selector: (SEL)selector; - (void)runWithIQ: (XMPPIQ*)iq; @end Index: src/XMPPCallback.m ================================================================== --- src/XMPPCallback.m +++ src/XMPPCallback.m @@ -26,16 +26,16 @@ #import "XMPPCallback.h" @implementation XMPPCallback #ifdef OF_HAVE_BLOCKS -+ callbackWithCallbackBlock: (xmpp_callback_block)callback ++ callbackWithCallbackBlock: (xmpp_callback_block_t)callback { return [[[self alloc] initWithCallbackBlock: callback] autorelease]; } -- initWithCallbackBlock: (xmpp_callback_block)callback +- initWithCallbackBlock: (xmpp_callback_block_t)callback { self = [super init]; object = [callback copy]; @@ -53,30 +53,27 @@ - initWithCallbackObject: (id)object_ selector: (SEL)selector_ { self = [super init]; - // TODO: Retain or follow delegate paradigm? - object = [object_ retain]; + object = object_; selector = selector_; return self; } - (void)dealloc { - [object release]; - [super dealloc]; } - (void)runWithIQ: (XMPPIQ*)iq { #ifdef OF_HAVE_BLOCKS if ([object isKindOfClass: [OFBlock class]]) - ((xmpp_callback_block)object)(iq); + ((xmpp_callback_block_t)object)(iq); else #endif [object performSelector: selector withObject: iq]; } @end Index: src/XMPPConnection.m ================================================================== --- src/XMPPConnection.m +++ src/XMPPConnection.m @@ -381,13 +381,13 @@ didSendElement: element]; [sock writeString: [element XMLString]]; } -- (void)sendIQ: (XMPPIQ*)iq -withCallbackObject: (id)object - selector: (SEL)selector +- (void)sendIQ: (XMPPIQ*)iq + withCallbackObject: (id)object + selector: (SEL)selector { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; @try { if (![iq ID]) [iq setID: [self generateStanzaID]]; @@ -402,12 +402,12 @@ [self sendStanza: iq]; } #ifdef OF_HAVE_BLOCKS -- (void)sendIQ: (XMPPIQ*)iq -withCallbackBlock: (xmpp_callback_block)callback; +- (void)sendIQ: (XMPPIQ*)iq + withCallbackBlock: (xmpp_callback_block_t)callback; { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; @try { if (![iq ID]) [iq setID: [self generateStanzaID]]; @@ -931,13 +931,13 @@ namespace: XMPP_NS_BIND stringValue: resource]]; [iq addChild: bind]; - [self sendIQ: iq - withCallbackObject: self - selector: @selector(XMPP_handleResourceBind:)]; + [self sendIQ: iq + withCallbackObject: self + selector: @selector(XMPP_handleResourceBind:)]; } - (void)XMPP_sendStreamError: (OFString*)condition text: (OFString*)text { @@ -990,13 +990,13 @@ iq = [XMPPIQ IQWithType: @"set" ID: [self generateStanzaID]]; [iq addChild: [OFXMLElement elementWithName: @"session" namespace: XMPP_NS_SESSION]]; - [self sendIQ: iq - withCallbackObject: self - selector: @selector(XMPP_handleSession:)]; + [self sendIQ: iq + withCallbackObject: self + selector: @selector(XMPP_handleSession:)]; } - (void)XMPP_handleSession: (XMPPIQ*)iq { if (![[iq type] isEqual: @"result"]) Index: src/XMPPEXTERNALAuth.m ================================================================== --- src/XMPPEXTERNALAuth.m +++ src/XMPPEXTERNALAuth.m @@ -40,14 +40,14 @@ password: nil] autorelease]; } - (OFDataArray*)initialMessage { - OFDataArray *message = [OFDataArray dataArrayWithItemSize: 1]; + OFDataArray *message = [OFDataArray dataArray]; /* authzid */ if (authzid) [message addItem: authzid]; return message; } @end Index: src/XMPPPLAINAuth.m ================================================================== --- src/XMPPPLAINAuth.m +++ src/XMPPPLAINAuth.m @@ -44,11 +44,11 @@ password: password] autorelease]; } - (OFDataArray*)initialMessage { - OFDataArray *message = [OFDataArray dataArrayWithItemSize: 1]; + OFDataArray *message = [OFDataArray dataArray]; /* authzid */ if (authzid) [message addItem: authzid]; Index: src/XMPPPresence.m ================================================================== --- src/XMPPPresence.m +++ src/XMPPPresence.m @@ -79,10 +79,11 @@ - (OFString*)type { if (type == nil) return @"available"; + return [[type copy] autorelease]; } - (void)addShow: (OFString*)show { Index: src/XMPPSCRAMAuth.m ================================================================== --- src/XMPPSCRAMAuth.m +++ src/XMPPSCRAMAuth.m @@ -143,11 +143,11 @@ [old release]; } - (OFDataArray*)initialMessage { - OFDataArray *ret = [OFDataArray dataArrayWithItemSize: 1]; + OFDataArray *ret = [OFDataArray dataArray]; /* New authentication attempt, reset status */ [cNonce release]; cNonce = nil; [GS2Header release]; @@ -213,12 +213,12 @@ GOT_SALT = 0x02, GOT_ITERCOUNT = 0x04 } got = 0; hash = [[[hashType alloc] init] autorelease]; - ret = [OFDataArray dataArrayWithItemSize: 1]; - authMessage = [OFDataArray dataArrayWithItemSize: 1]; + ret = [OFDataArray dataArray]; + authMessage = [OFDataArray dataArray]; OFString *chal = [OFString stringWithUTF8String: [data cArray] length: [data count] * [data itemSize]]; @@ -250,11 +250,11 @@ if (got != (GOT_SNONCE | GOT_SALT | GOT_ITERCOUNT)) @throw [OFInvalidServerReplyException exceptionWithClass: isa]; // Add c= - tmpArray = [OFDataArray dataArrayWithItemSize: 1]; + tmpArray = [OFDataArray dataArray]; [tmpArray addNItems: [GS2Header UTF8StringLength] fromCArray: [GS2Header UTF8String]]; if (plusAvailable && [connection encrypted]) { OFDataArray *channelBinding = [((SSLSocket*)[connection socket]) channelBindingDataWithType: @"tls-unique"]; @@ -276,11 +276,11 @@ /* * IETF RFC 5802: * SaltedPassword := Hi(Normalize(password), salt, i) */ - tmpArray = [OFDataArray dataArrayWithItemSize: 1]; + tmpArray = [OFDataArray dataArray]; [tmpArray addNItems: [password UTF8StringLength] fromCArray: [password UTF8String]]; saltedPassword = [self XMPP_hiWithData: tmpArray salt: salt @@ -303,11 +303,11 @@ /* * IETF RFC 5802: * ClientKey := HMAC(SaltedPassword, "Client Key") */ - tmpArray = [OFDataArray dataArrayWithItemSize: 1]; + tmpArray = [OFDataArray dataArray]; [tmpArray addNItems: 10 fromCArray: "Client Key"]; clientKey = [self XMPP_HMACWithKey: saltedPassword data: tmpArray]; @@ -315,11 +315,11 @@ * IETF RFC 5802: * StoredKey := H(ClientKey) */ [hash updateWithBuffer: (void*) clientKey length: [hashType digestSize]]; - tmpArray = [OFDataArray dataArrayWithItemSize: 1]; + tmpArray = [OFDataArray dataArray]; [tmpArray addNItems: [hashType digestSize] fromCArray: [hash digest]]; /* * IETF RFC 5802: @@ -330,33 +330,33 @@ /* * IETF RFC 5802: * ServerKey := HMAC(SaltedPassword, "Server Key") */ - tmpArray = [OFDataArray dataArrayWithItemSize: 1]; + tmpArray = [OFDataArray dataArray]; [tmpArray addNItems: 10 fromCArray: "Server Key"]; serverKey = [self XMPP_HMACWithKey: saltedPassword data: tmpArray]; /* * IETF RFC 5802: * ServerSignature := HMAC(ServerKey, AuthMessage) */ - tmpArray = [OFDataArray dataArrayWithItemSize: 1]; + tmpArray = [OFDataArray dataArray]; [tmpArray addNItems: [hashType digestSize] fromCArray: serverKey]; - serverSignature = [[OFDataArray alloc] initWithItemSize: 1]; + serverSignature = [[OFDataArray alloc] init]; [serverSignature addNItems: [hashType digestSize] fromCArray: [self XMPP_HMACWithKey: tmpArray data: authMessage]]; /* * IETF RFC 5802: * ClientProof := ClientKey XOR ClientSignature */ - tmpArray = [OFDataArray dataArrayWithItemSize: 1]; + tmpArray = [OFDataArray dataArray]; for (i = 0; i < [hashType digestSize]; i++) { uint8_t c = clientKey[i] ^ clientSignature[i]; [tmpArray addItem: &c]; } @@ -426,11 +426,11 @@ - (uint8_t*)XMPP_HMACWithKey: (OFDataArray*)key data: (OFDataArray*)data { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; - OFDataArray *k = [OFDataArray dataArrayWithItemSize: 1]; + OFDataArray *k = [OFDataArray dataArray]; size_t i, kSize, blockSize = [hashType blockSize]; uint8_t *kI = NULL, *kO = NULL; OFHash *hashI, *hashO; if ([key itemSize] * [key count] > blockSize) { @@ -503,11 +503,11 @@ for (j = 0; j < digestSize; j++) result[j] ^= uOld[j]; for (j = 0; j < i - 1; j++) { - tmp = [OFDataArray dataArrayWithItemSize: 1]; + tmp = [OFDataArray dataArray]; [tmp addNItems: digestSize fromCArray: uOld]; u = [self XMPP_HMACWithKey: str data: tmp]; @@ -518,11 +518,11 @@ uOld = u; [pool releaseObjects]; } - ret = [OFDataArray dataArrayWithItemSize: 1]; + ret = [OFDataArray dataArray]; [ret addNItems: digestSize fromCArray: result]; } @finally { [self freeMemory: result]; }