Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -18,15 +18,16 @@ XMPPPresence.m \ XMPPRoster.m \ XMPPRosterItem.m \ XMPPSCRAMAuth.m \ XMPPSRVLookup.m \ - XMPPStanza.m + XMPPStanza.m \ + XMPPXMLElementBuilder.m INCLUDES = ${SRCS:.m=.h} \ namespaces.h \ ObjXMPP.h include ../buildsys.mk CPPFLAGS += -I.. -DHAVE_CONFIG_H LD = ${OBJC} Index: src/XMPPConnection.m ================================================================== --- src/XMPPConnection.m +++ src/XMPPConnection.m @@ -500,14 +500,14 @@ if ([[element namespace] isEqual: XMPP_NS_SASL]) [self XMPP_handleSASL: element]; } -- (void)elementBuilder: (OFXMLElementBuilder *)builder - didNotExpectCloseTag: (OFString *)name - withPrefix: (OFString *)prefix - namespace: (OFString *)ns +- (void)elementBuilder: (OFXMLElementBuilder*)builder + didNotExpectCloseTag: (OFString*)name + withPrefix: (OFString*)prefix + namespace: (OFString*)ns { if (![name isEqual: @"stream"] || ![prefix isEqual: @"stream"] || ![ns isEqual: XMPP_NS_STREAM]) @throw [OFMalformedXMLException exceptionWithClass: [builder class] @@ -531,11 +531,11 @@ oldElementBuilder = elementBuilder; parser = [[OFXMLParser alloc] init]; [parser setDelegate: self]; - elementBuilder = [[OFXMLElementBuilder alloc] init]; + elementBuilder = [[XMPPXMLElementBuilder alloc] init]; [elementBuilder setDelegate: self]; [sock writeFormat: @"\n" @" + * + * https://webkeks.org/hg/objxmpp/ + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +@interface XMPPXMLElementBuilder: OFXMLElementBuilder +@end ADDED src/XMPPXMLElementBuilder.m Index: src/XMPPXMLElementBuilder.m ================================================================== --- src/XMPPXMLElementBuilder.m +++ src/XMPPXMLElementBuilder.m @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2012, Jonathan Schleifer + * + * https://webkeks.org/hg/objxmpp/ + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#import "XMPPXMLElementBuilder.h" + +#import + +@implementation XMPPXMLElementBuilder +- (void)parser: (OFXMLParser*)parser + foundProcessingInstructions: (OFString*)pi +{ + @throw [OFMalformedXMLException exceptionWithClass: isa]; +} + +- (void)parser: (OFXMLParser*)parser + foundComment: (OFString*)comment +{ + @throw [OFMalformedXMLException exceptionWithClass: isa]; +} +@end