Fix accumulatedWeight and iterate priorities in the right order.
This commit is contained in:
parent
9fd6e76322
commit
53a2499381
2 changed files with 9 additions and 6 deletions
|
@ -28,7 +28,8 @@
|
|||
@interface XMPPSRVEntry: OFObject
|
||||
{
|
||||
uint16_t priority;
|
||||
uint16_t weight, accumulatedWeight;
|
||||
uint16_t weight;
|
||||
uint32_t accumulatedWeight;
|
||||
uint16_t port;
|
||||
OFString *target;
|
||||
}
|
||||
|
@ -36,7 +37,7 @@
|
|||
#ifdef OF_HAVE_PROPERTIES
|
||||
@property (readonly, assign) uint16_t priority;
|
||||
@property (readonly, assign) uint16_t weight;
|
||||
@property (assign) uint16_t accumulatedWeight;
|
||||
@property (assign) uint32_t accumulatedWeight;
|
||||
@property (readonly, assign) uint16_t port;
|
||||
@property (readonly, copy) OFString *target;
|
||||
#endif
|
||||
|
@ -55,6 +56,8 @@
|
|||
handle: (ns_msg)handle;
|
||||
- (uint16_t)priority;
|
||||
- (uint16_t)weight;
|
||||
- (uint32_t)accumulatedWeight;
|
||||
- (void)setAccumulatedWeight: (uint32_t)accumulatedWeight;
|
||||
- (uint16_t)port;
|
||||
- (OFString*)target;
|
||||
@end
|
||||
|
|
|
@ -132,12 +132,12 @@
|
|||
return weight;
|
||||
}
|
||||
|
||||
- (void)setAccumulatedWeight: (uint16_t)accumulatedWeight_
|
||||
- (void)setAccumulatedWeight: (uint32_t)accumulatedWeight_
|
||||
{
|
||||
accumulatedWeight = accumulatedWeight_;
|
||||
}
|
||||
|
||||
- (uint16_t)accumulatedWeight
|
||||
- (uint32_t)accumulatedWeight
|
||||
{
|
||||
return accumulatedWeight;
|
||||
}
|
||||
|
@ -326,7 +326,7 @@
|
|||
return nil;
|
||||
|
||||
if (listIter == NULL)
|
||||
listIter = [list lastListObject];
|
||||
listIter = [list firstListObject];
|
||||
|
||||
if (listIter == NULL)
|
||||
return nil;
|
||||
|
@ -362,7 +362,7 @@
|
|||
[subListCopy release];
|
||||
subListCopy = nil;
|
||||
|
||||
listIter = listIter->previous;
|
||||
listIter = listIter->next;
|
||||
|
||||
if (listIter == NULL)
|
||||
done = YES;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue