@@ -1,11 +1,11 @@ /* - * Copyright (c) 2011, 2012, 2013, 2014, 2015 - * Jonathan Schleifer - * Copyright (c) 2011, Florian Zeitz + * Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016 + * Jonathan Schleifer + * Copyright (c) 2011, 2012, 2013, 2014, Florian Zeitz * - * https://webkeks.org/git/?p=objxmpp.git + * https://heap.zone/git/?p=objxmpp.git * * 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. * @@ -38,10 +38,14 @@ #import "XMPPSRVLookup.h" #import @implementation XMPPSRVEntry +@synthesize priority = _priority, weight = _weight; +@synthesize accumulatedWeight = _accumulatedWeight, port = _port; +@synthesize target = _target; + + (instancetype)entryWithPriority: (uint16_t)priority weight: (uint16_t)weight port: (uint16_t)port target: (OFString*)target { @@ -131,43 +135,15 @@ { return [OFString stringWithFormat: @"<%@ priority: %" PRIu16 @", weight: %" PRIu16 @", target: %@:%" PRIu16 @">", [self class], _priority, _weight, _target, _port]; } - -- (uint16_t)priority -{ - return _priority; -} - -- (uint16_t)weight -{ - return _weight; -} - -- (void)setAccumulatedWeight: (uint32_t)accumulatedWeight -{ - _accumulatedWeight = accumulatedWeight; -} - -- (uint32_t)accumulatedWeight -{ - return _accumulatedWeight; -} - -- (uint16_t)port -{ - return _port; -} - -- (OFString*)target -{ - OF_GETTER(_target, true) -} @end @implementation XMPPSRVLookup +@synthesize domain = _domain; + + (instancetype)lookupWithDomain: (OFString*)domain { return [[[self alloc] initWithDomain: domain] autorelease]; } @@ -194,15 +170,10 @@ [_domain release]; [super dealloc]; } -- (OFString*)domain; -{ - OF_GETTER(_domain, true) -} - - (void)XMPP_lookup { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; unsigned char *answer = NULL; size_t pageSize = [OFSystemInfo pageSize];